diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-03-29 17:29:58 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-29 18:06:21 -0400 |
commit | 924a65fc27bb2a3e24489f7baea7ad5fb8a556ac (patch) | |
tree | 32f37fb1bb460fc7917decb3da0abdb7616f72a4 /rts/linker/Elf.c | |
parent | 81f5b6ecbadec49af53189756dda5e0b199f9703 (diff) | |
download | haskell-924a65fc27bb2a3e24489f7baea7ad5fb8a556ac.tar.gz |
Various patches to support android cross compilation
- Better test for SHT_INIT_ARRAY than openbsd_HOST_OS
This is actually bens patch:
https://gist.github.com/bgamari/c846e6a5f2cd988716cd5e36c68d5bef
- linux-android defines.
- No need for -lpthread on OSAndroid
However, I’m confused why we do not use the AC NEED_PTHREAD_LIB
value here?
- Use mmap on android
- Support `none` vendor.
Reviewers: austin, hvr, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, erikd
Differential Revision: https://phabricator.haskell.org/D3356
Diffstat (limited to 'rts/linker/Elf.c')
-rw-r--r-- | rts/linker/Elf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c index 2ce4d3df2d..73e34d38a7 100644 --- a/rts/linker/Elf.c +++ b/rts/linker/Elf.c @@ -1,6 +1,10 @@ #include "Rts.h" -#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) || defined(gnu_HOST_OS) +#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) \ +|| defined(linux_android_HOST_OS) \ +|| defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) \ +|| defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) \ +|| defined(openbsd_HOST_OS) || defined(gnu_HOST_OS) #include "RtsUtils.h" #include "RtsSymbolInfo.h" @@ -613,13 +617,13 @@ static int getSectionKind_ELF( Elf_Shdr *hdr, int *is_bss ) /* .rodata-style section */ return SECTIONKIND_CODE_OR_RODATA; } -#ifndef openbsd_HOST_OS +#ifdef SHT_INIT_ARRAY if (hdr->sh_type == SHT_INIT_ARRAY && (hdr->sh_flags & SHF_ALLOC) && (hdr->sh_flags & SHF_WRITE)) { /* .init_array section */ return SECTIONKIND_INIT_ARRAY; } -#endif /* not OpenBSD */ +#endif /* not SHT_INIT_ARRAY */ if (hdr->sh_type == SHT_NOBITS && (hdr->sh_flags & SHF_ALLOC) && (hdr->sh_flags & SHF_WRITE)) { /* .bss-style section */ |