summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/nativeGen/NCG.h6
-rw-r--r--configure.ac2
-rw-r--r--driver/mangler/ghc-asm.lprl6
-rw-r--r--mk/config.mk.in2
-rw-r--r--rts/Linker.c8
-rw-r--r--rts/RtsUtils.c2
6 files changed, 16 insertions, 10 deletions
diff --git a/compiler/nativeGen/NCG.h b/compiler/nativeGen/NCG.h
index b17f682e71..3a7bfcd5e8 100644
--- a/compiler/nativeGen/NCG.h
+++ b/compiler/nativeGen/NCG.h
@@ -38,6 +38,12 @@
# define IF_OS_freebsd(x,y) y
#endif
-- - - - - - - - - - - - - - - - - - - - - -
+#if dragonfly_TARGET_OS
+# define IF_OS_dragonfly(x,y) x
+#else
+# define IF_OS_dragonfly(x,y) y
+#endif
+-- - - - - - - - - - - - - - - - - - - - - -
#if netbsd_TARGET_OS
# define IF_OS_netbsd(x,y) x
#else
diff --git a/configure.ac b/configure.ac
index c11d663249..60371a9912 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,7 +296,7 @@ checkVendor() {
checkOS() {
case $1 in
- linux|freebsd|netbsd|openbsd|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
+ linux|freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
;;
*)
echo "Unknown OS '$1'"
diff --git a/driver/mangler/ghc-asm.lprl b/driver/mangler/ghc-asm.lprl
index 34f475817b..1ff78a4aa8 100644
--- a/driver/mangler/ghc-asm.lprl
+++ b/driver/mangler/ghc-asm.lprl
@@ -160,12 +160,12 @@ sub init_TARGET_STUFF {
$T_HDR_vector = "\.text\n\t\.align 4\n"; # NB: requires padding
#--------------------------------------------------------#
- } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|netbsd|openbsd|kfreebsdgnu)$/m ) {
+ } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|dragonfly|netbsd|openbsd|kfreebsdgnu)$/m ) {
$T_STABBY = 0; # 1 iff .stab things (usually if a.out format)
$T_US = ''; # _ if symbols have an underscore on the front
$T_PRE_APP = # regexp that says what comes before APP/NO_APP
- ($TargetPlatform =~ /-(linux|gnu|freebsd|netbsd|openbsd)$/m) ? '#' : '/' ;
+ ($TargetPlatform =~ /-(linux|gnu|freebsd|dragonfly|netbsd|openbsd)$/m) ? '#' : '/' ;
$T_CONST_LBL = '^\.LC(\d+):$'; # regexp for what such a lbl looks like
$T_POST_LBL = ':';
$T_X86_PRE_LLBL_PAT = '\.L';
@@ -216,7 +216,7 @@ sub init_TARGET_STUFF {
$T_HDR_vector = "\.text\n\t\.align 8\n";
#--------------------------------------------------------#
- } elsif ( $TargetPlatform =~ /^x86_64-.*-(linux|openbsd|freebsd|netbsd)$/m ) {
+ } elsif ( $TargetPlatform =~ /^x86_64-.*-(linux|openbsd|freebsd|dragonfly|netbsd)$/m ) {
$T_STABBY = 0; # 1 iff .stab things (usually if a.out format)
$T_US = ''; # _ if symbols have an underscore on the front
diff --git a/mk/config.mk.in b/mk/config.mk.in
index ee53a5a7b1..36dd2d3fd7 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -153,7 +153,7 @@ GhcWithSMP=$(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),
# Whether to include GHCi in the compiler. Depends on whether the RTS linker
# has support for this OS/ARCH combination.
-OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
+OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd dragonfly netbsd openbsd darwin)))
ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc sparc64)))
ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
diff --git a/rts/Linker.c b/rts/Linker.c
index 1576e49b4b..e3278b5ef4 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -63,12 +63,12 @@
#include <sys/wait.h>
#endif
-#if defined(ia64_HOST_ARCH) || defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
+#if defined(ia64_HOST_ARCH) || defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
#define USE_MMAP
#include <fcntl.h>
#include <sys/mman.h>
-#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
+#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -76,7 +76,7 @@
#endif
-#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
+#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
# define OBJFORMAT_ELF
#elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
# define OBJFORMAT_PEi386
@@ -1403,7 +1403,7 @@ mmap_again:
} else {
if ((W_)result > 0x80000000) {
// oops, we were given memory over 2Gb
-#if defined(freebsd_HOST_OS)
+#if defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)
// Some platforms require MAP_FIXED. This is normally
// a bad idea, because MAP_FIXED will overwrite
// existing mappings.
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c
index 1953e1e838..51c1250682 100644
--- a/rts/RtsUtils.c
+++ b/rts/RtsUtils.c
@@ -369,7 +369,7 @@ heapCheckFail( void )
* genericRaise(), rather than raise(3).
*/
int genericRaise(int sig) {
-#if defined(THREADED_RTS) && (defined(openbsd_HOST_OS) || defined(freebsd_HOST_OS))
+#if defined(THREADED_RTS) && (defined(openbsd_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS))
return pthread_kill(pthread_self(), sig);
#else
return raise(sig);