X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FLinker.c;h=fd5c158cce5a94b3d5cf08b03b3fd77bfd9780b7;hb=eb3a1aecac72d22c618b4050fb88eac9055b527a;hp=d8ec9f0cb41ba7a92278a0d3f90aec61e8e96951;hpb=db0c13a482893243cc829bbc253862e65f437cbe;p=ghc-hetmet.git diff --git a/rts/Linker.c b/rts/Linker.c index d8ec9f0..fd5c158 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -13,8 +13,8 @@ /* Linux needs _GNU_SOURCE to get RTLD_DEFAULT from and MREMAP_MAYMOVE from . */ -#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 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.