summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Silva <marcot@marcot.eti.br>2011-01-18 22:23:52 +0000
committerMarco Silva <marcot@marcot.eti.br>2011-01-18 22:23:52 +0000
commit13d064aec161f478a630c693433bfc091f5e140e (patch)
tree2c345d84c5c4c43f07148a9f8a6e81d6b92b553a
parent5ddec4452428b67788dd323d38563e8123253005 (diff)
downloadhaskell-13d064aec161f478a630c693433bfc091f5e140e.tar.gz
Include kfreebsdgnu in the list of Target Platforms.
-rw-r--r--driver/mangler/ghc-asm.lprl2
-rw-r--r--rts/Linker.c11
-rw-r--r--rts/posix/OSThreads.c2
3 files changed, 8 insertions, 7 deletions
diff --git a/driver/mangler/ghc-asm.lprl b/driver/mangler/ghc-asm.lprl
index c81a9ead0e..4bac756fda 100644
--- a/driver/mangler/ghc-asm.lprl
+++ b/driver/mangler/ghc-asm.lprl
@@ -216,7 +216,7 @@ sub init_TARGET_STUFF {
$T_HDR_vector = "\.text\n\t\.align 8\n";
#--------------------------------------------------------#
- } elsif ( $TargetPlatform =~ /^x86_64-.*-(linux|openbsd|freebsd|dragonfly|netbsd)$/m ) {
+ } elsif ( $TargetPlatform =~ /^x86_64-.*-(linux|openbsd|freebsd|dragonfly|netbsd|kfreebsdgnu)$/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/rts/Linker.c b/rts/Linker.c
index d8ec9f0cb4..fd5c158cce 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -13,8 +13,8 @@
/* Linux needs _GNU_SOURCE to get RTLD_DEFAULT from <dlfcn.h> and
MREMAP_MAYMOVE from <sys/mman.h>.
*/
-#ifdef __linux__
-#define _GNU_SOURCE
+#if defined(__linux__) || defined(__GLIBC__)
+#define _GNU_SOURCE 1
#endif
#include "Rts.h"
@@ -72,7 +72,8 @@
#if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
defined(openbsd_HOST_OS ) || \
- ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) )
+ ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) ) || \
+ defined(kfreebsdgnu_HOST_OS)
/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
* reallocating but we need to allocate jump islands just after each
* object images. Otherwise relative branches to jump islands can fail
@@ -88,7 +89,7 @@
#endif
-#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)
+#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
# define OBJFORMAT_ELF
# include <regex.h> // regex is already used by dlopen() so this is OK
// to use here without requiring an additional lib
@@ -1589,7 +1590,7 @@ mmap_again:
} else {
if ((W_)result > 0x80000000) {
// oops, we were given memory over 2Gb
-#if defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)
+#if defined(freebsd_HOST_OS) || defined(kfreebsdgnu_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/posix/OSThreads.c b/rts/posix/OSThreads.c
index 283155345c..29cb23eb6d 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -7,7 +7,7 @@
*
* --------------------------------------------------------------------------*/
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
/* We want GNU extensions in DEBUG mode for mutex error checking */
/* We also want the affinity API, which requires _GNU_SOURCE */
#define _GNU_SOURCE