Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/498467cf44e871a6abdb1e16714f6e91c7b10a80

>---------------------------------------------------------------

commit 498467cf44e871a6abdb1e16714f6e91c7b10a80
Author: Ian Lynagh <[email protected]>
Date:   Fri Nov 25 01:12:47 2011 +0000

    Fixes for NetBSD
    
    Based on a patch from Arnaud Degroote <[email protected]> in
    trac #5480.

>---------------------------------------------------------------

 aclocal.m4                        |    5 ++++-
 compiler/main/DriverPipeline.hs   |    2 +-
 compiler/main/StaticFlags.hs      |    4 ++--
 compiler/nativeGen/PPC/CodeGen.hs |    1 +
 compiler/utils/Platform.hs        |    2 ++
 mk/config.mk.in                   |    1 +
 rts/RtsUtils.c                    |    2 +-
 7 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 590a125..2bba7b7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -224,7 +224,10 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
         openbsd)
             test -z "[$]2" || eval "[$]2=OSOpenBSD"
             ;;
-        
netbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
+        netbsd)
+            test -z "[$]2" || eval "[$]2=OSNetBSD"
+            ;;
+        
dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|cygwin32|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
             test -z "[$]2" || eval "[$]2=OSUnknown"
             ;;
         *)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index c33730e..2230f3f 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1714,7 +1714,7 @@ linkBinary dflags o_files dep_packages = do
 
     let
         thread_opts | WayThreaded `elem` ways = [
-#if !defined(mingw32_TARGET_OS) && !defined(freebsd_TARGET_OS) && 
!defined(openbsd_TARGET_OS) && !defined(haiku_TARGET_OS)
+#if !defined(mingw32_TARGET_OS) && !defined(freebsd_TARGET_OS) && 
!defined(openbsd_TARGET_OS) && !defined(netbsd_TARGET_OS) && 
!defined(haiku_TARGET_OS)
                         "-lpthread"
 #endif
 #if defined(osf3_TARGET_OS)
diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs
index dd00d3d..e89d9b3 100644
--- a/compiler/main/StaticFlags.hs
+++ b/compiler/main/StaticFlags.hs
@@ -491,7 +491,7 @@ way_details =
        -- the problems are our fault or theirs, but it seems that using the
        -- alternative 1:1 threading library libthr works around it:
          "-optl-lthr"
-#elif defined(openbsd_TARGET_OS)
+#elif defined(openbsd_TARGET_OS) || defined(netbsd_TARGET_OS)
          "-optc-pthread"
        , "-optl-pthread"
 #elif defined(solaris2_TARGET_OS)
@@ -509,7 +509,7 @@ way_details =
        --      with -fPIC. Labels not in the current package are assumed to be 
in a DLL
        --      different from the current one.
        , "-fPIC"
-#elif defined(openbsd_TARGET_OS)
+#elif defined(openbsd_TARGET_OS) || defined(netbsd_TARGET_OS)
        -- Without this, linking the shared libHSffi fails because
        -- it uses pthread mutexes.
        , "-optl-pthread"
diff --git a/compiler/nativeGen/PPC/CodeGen.hs 
b/compiler/nativeGen/PPC/CodeGen.hs
index 607e05d..8c80ec4 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -853,6 +853,7 @@ genCCall target dest_regs argsAndHints
           OSMinGW32  -> panic "PPC.CodeGen.genCCall: not defined for this os"
           OSFreeBSD  -> panic "PPC.CodeGen.genCCall: not defined for this os"
           OSOpenBSD  -> panic "PPC.CodeGen.genCCall: not defined for this os"
+          OSNetBSD   -> panic "PPC.CodeGen.genCCall: not defined for this os"
           OSUnknown  -> panic "PPC.CodeGen.genCCall: not defined for this os"
 
 data GenCCallPlatform = GCPLinux | GCPDarwin
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index e99d706..027c510 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -55,6 +55,7 @@ data OS
         | OSMinGW32
         | OSFreeBSD
         | OSOpenBSD
+        | OSNetBSD
         deriving (Read, Show, Eq)
 
 -- | ARM Instruction Set Architecture and Extensions
@@ -90,6 +91,7 @@ osElfTarget :: OS -> Bool
 osElfTarget OSLinux    = True
 osElfTarget OSFreeBSD  = True
 osElfTarget OSOpenBSD  = True
+osElfTarget OSNetBSD   = True
 osElfTarget OSSolaris2 = True
 osElfTarget OSDarwin   = False
 osElfTarget OSMinGW32  = False
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 583bc47..f45404a 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -118,6 +118,7 @@ SharedLibsPlatformList =                        \
     i386-unknown-linux   x86_64-unknown-linux   \
     i386-unknown-freebsd x86_64-unknown-freebsd \
     i386-unknown-openbsd x86_64-unknown-openbsd \
+    i386-unknown-netbsd  x86_64-unknown-netbsd  \
     i386-unknown-mingw32                        \
     i386-apple-darwin    x86_64-apple-darwin    powerpc-apple-darwin
 
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c
index 8ef6c0d..e04b984 100644
--- a/rts/RtsUtils.c
+++ b/rts/RtsUtils.c
@@ -272,7 +272,7 @@ heapCheckFail( void )
  * genericRaise(), rather than raise(3).
  */
 int genericRaise(int sig) {
-#if defined(THREADED_RTS) && (defined(openbsd_HOST_OS) || 
defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS))
+#if defined(THREADED_RTS) && (defined(openbsd_HOST_OS) || 
defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || 
defined(netbsd_HOST_OS))
         return pthread_kill(pthread_self(), sig);
 #else
         return raise(sig);



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to