diff options
author | Fabian Groffen <grobian@gentoo.org> | 2016-07-10 19:41:23 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2016-07-10 19:41:39 +0200 |
commit | 2dcc5b74a0f2cd5912cb838da1d49291fd909843 (patch) | |
tree | 84f8dfc4ccc261f57a8975d6c52de79f3707b429 /sys-devel/binutils-apple/files | |
parent | eclass/cargo: improve variable names (diff) | |
download | gentoo-2dcc5b74a0f2cd5912cb838da1d49291fd909843.tar.gz gentoo-2dcc5b74a0f2cd5912cb838da1d49291fd909843.tar.bz2 gentoo-2dcc5b74a0f2cd5912cb838da1d49291fd909843.zip |
sys-devel/binutils-apple: cleanup old
Package-Manager: portage-2.2.28
Diffstat (limited to 'sys-devel/binutils-apple/files')
69 files changed, 0 insertions, 10995 deletions
diff --git a/sys-devel/binutils-apple/files/Makefile b/sys-devel/binutils-apple/files/Makefile deleted file mode 100644 index 9d8f92818a87..000000000000 --- a/sys-devel/binutils-apple/files/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -all: ld64 rebase - -build_test: machocheck ObjectDump - -ld64: debugline.o Options.o ld.o version.o - $(CXX) $(LDFLAGS) -o $@ $^ - -machocheck: machochecker.o - $(CXX) $(LDFLAGS) -o $@ $^ - -ObjectDump: ObjectDump.o debugline.o - $(CXX) $(LDFLAGS) -o $@ $^ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch deleted file mode 100644 index 8d9203e33953..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as-dir.patch +++ /dev/null @@ -1,69 +0,0 @@ -handles the libexecdir for as and other fixes - ---- cctools-698/as/driver.c -+++ cctools-698/as/driver.c -@@ -27,6 +27,9 @@ - char **envp) - { - const char *LIB = -+#ifdef ASLIBEXECDIR -+ ASLIBEXECDIR; -+#else - #if defined(__OPENSTEP__) || defined(__HERA__) || \ - defined(__GONZO_BUNSEN_BEAKER__) || defined(__KODIAK__) - "/usr/libexec/"; -@@ -40,6 +42,7 @@ - #else - "/usr/local/libexec/gcc/darwin/"; - #endif -+#endif - const char *AS = "/as"; - - int i; -@@ -170,7 +170,11 @@ - } - - } -+#ifndef ASLIBEXECDIR - as = makestr(prefix, LIB, arch_name, AS, NULL); -+#else -+ as = makestr(LIB, arch_name, AS, NULL); -+#endif - - /* - * If this assembler exist try to run it else print an error message. -@@ -182,6 +182,9 @@ - else - exit(1); - } -+#ifdef ASLIBEXECDIR -+ as_local = ""; -+#else - as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL); - if(access(as_local, F_OK) == 0){ - argv[0] = as_local; -@@ -193,6 +198,8 @@ - exit(1); - } - else{ -+#endif -+ { - printf("%s: assembler (%s or %s) for architecture %s not " - "installed\n", progname, as, as_local, arch_name); - arch_flags = get_arch_flags(); -@@ -183,6 +190,7 @@ - printf("%s for architecture %s\n", as, arch_flags[i].name); - count++; - } -+#ifndef ASLIBEXECDIR - else{ - as_local = makestr(LOCALLIB, arch_flags[i].name, AS, NULL); - if(access(as_local, F_OK) == 0){ -@@ -193,6 +201,7 @@ - count++; - } - } -+#endif - } - if(count == 0) - printf("%s: no assemblers installed\n", progname); diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch deleted file mode 100644 index c0cff44550db..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-as.patch +++ /dev/null @@ -1,98 +0,0 @@ -make building for obsolete architectures optional. - ---- cctools-698/as/Makefile -+++ cctools-698/as/Makefile -@@ -1,3 +1,4 @@ -+BUILD_OBSOLETE_ARCH = yes - RC_OS = macos - export USE_APPLE_PB_SUPPORT = all - OFLAG = -Os -@@ -31,26 +32,34 @@ - SYMROOT = . - OBJROOT = . - SYM_DIRS = $(SYMROOT)/driver_dir \ -- $(SYMROOT)/a68_dir \ -- $(SYMROOT)/a88_dir \ - $(SYMROOT)/a386_dir \ - $(SYMROOT)/ax86_64_dir \ - $(SYMROOT)/appc_dir \ -- $(SYMROOT)/appc64_dir \ -+ $(SYMROOT)/appc64_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+SYM_DIRS += \ -+ $(SYMROOT)/a68_dir \ -+ $(SYMROOT)/a88_dir \ - $(SYMROOT)/a860_dir \ - $(SYMROOT)/ahppa_dir \ - $(SYMROOT)/asparc_dir -+endif - - OFILE_DIRS = $(OBJROOT)/driver_dir \ -- $(OBJROOT)/a68_dir \ -- $(OBJROOT)/a88_dir \ - $(OBJROOT)/a386_dir \ - $(OBJROOT)/ax86_64_dir \ - $(OBJROOT)/appc_dir \ -- $(OBJROOT)/appc64_dir \ -+ $(OBJROOT)/appc64_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+OFILE_DIRS += \ -+ $(OBJROOT)/a68_dir \ -+ $(OBJROOT)/a88_dir \ - $(OBJROOT)/a860_dir \ - $(OBJROOT)/ahppa_dir \ - $(OBJROOT)/asparc_dir -+endif - - BINDIR = /bin - USRBINDIR = /usr/bin -@@ -109,9 +118,13 @@ - OBJS_hppa = $(CFILES_hppa:.c=.o) - OBJS_sparc = $(CFILES_sparc:.c=.o) - --all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \ -- ax86_64_build a860_build appc_build appc64_build ahppa_build \ -- $(A_BUILD) asparc_build -+all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \ -+ ax86_64_build appc_build appc64_build \ -+ $(A_BUILD) -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+all: a68_build a88_build a860_build ahppa_build asparc_build -+endif - - all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test - -@@ -414,12 +427,14 @@ - $(MKDIRS) $(DSTROOT)$(LIBDIR)/ppc64 - install -c -s -m 555 $(SYMROOT)/appc64_dir/as \ - $(DSTROOT)$(LIBDIR)/ppc64/as -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k - install -c -s -m 555 $(SYMROOT)/a68_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m68k/as - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc - install -c -s -m 555 $(SYMROOT)/asparc_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/sparc/as -+endif - - nextstep_install: common_install - $(MKDIRS) $(DSTROOT)$(BINDIR) -@@ -439,6 +454,7 @@ - $(DSTROOT)$(LOCLIBDIR)/ppc/as - - common_install: -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k - install -c -s -m 555 $(SYMROOT)/a88_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m88k/as -@@ -448,6 +464,7 @@ - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860 - install -s -m 555 $(SYMROOT)/a860_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/i860/as -+endif - - $(OFILE_DIRS) $(SYM_DIRS): - $(MKDIRS) $@ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch deleted file mode 100644 index fc86ddea118a..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-libtool-ranlib.patch +++ /dev/null @@ -1,17 +0,0 @@ -match "ranlib" at the back of the string, such that <CHOST>-ranlib also -works correctly - ---- cctools-698/misc/libtool.c -+++ cctools-698/misc/libtool.c -@@ -336,8 +336,9 @@ - p++; - else - p = argv[0]; -- if(strncmp(p, "ranlib", sizeof("ranlib") - 1) == 0) -- cmd_flags.ranlib = TRUE; -+ if ((i = strlen(p)) >= sizeof("ranlib") - 1 && -+ strcmp(p + (i - (sizeof("ranlib") - 1)), "ranlib") == 0) -+ cmd_flags.ranlib = TRUE; - - /* The default is to used long names */ - cmd_flags.use_long_names = TRUE; diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch deleted file mode 100644 index 3b14e3dd4e69..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-nmedit.patch +++ /dev/null @@ -1,15 +0,0 @@ -don't create a symlink to nmedit from the dir nmedit is in - ---- cctools-698/misc/Makefile -+++ cctools-698/misc/Makefile -@@ -427,8 +427,10 @@ - install -c -s -m 555 $(SYMROOT)/redo_prebinding.NEW \ - $(DSTROOT)$(USRBINDIR)/redo_prebinding - install -c -s -m 555 $(SYMROOT)/nmedit.NEW $(DSTROOT)$(USRBINDIR)/nmedit -+ifneq "$(USRBINDIR)" "$(LOCBINDIR)" - (cd $(DSTROOT)$(LOCBINDIR); rm -f nmedit; \ - ln -s $(USRBINDIR)/nmedit nmedit) -+endif - install -c -s -m 555 $(SYMROOT)/install_name_tool.NEW \ - $(DSTROOT)$(USRBINDIR)/install_name_tool - install -c -s -m 555 $(SYMROOT)/codesign_allocate.NEW \ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch deleted file mode 100644 index 978f1aba9aee..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-efi-man.patch +++ /dev/null @@ -1,38 +0,0 @@ -don't install efi's manpages since we don't install efi - ---- cctools-698/man/Makefile -+++ cctools-698/man/Makefile -@@ -27,14 +27,21 @@ - MANL3 = libsyminfo.3 redo_prebinding.3 - - INSTALL_FILES = Makefile $(COMMON_MAN1) $(OTHER_MAN1) $(MAN3) $(MAN5) $(MANL) \ -- $(MANL3) $(DYLD_MAN1) $(DYLD_MAN3) $(DYLD_MANL3) $(EFI1) notes -+ $(MANL3) $(DYLD_MAN1) $(DYLD_MAN3) $(DYLD_MANL3) notes -+ -+ifeq "$(EFITOOLS)" "efitools" -+ INSTALL_FILES += $(EFI1) -+endif - - MANDIR = /usr/share/man - LOCMANDIR = /usr/local/man - EFIMANDIR = /usr/local/efi/share/man - DSTDIRS = $(DSTROOT)$(MANDIR)/man1 $(DSTROOT)$(MANDIR)/man3 \ - $(DSTROOT)$(MANDIR)/man5 $(DSTROOT)$(LOCMANDIR)/man1 \ -- $(DSTROOT)$(LOCMANDIR)/man3 $(DSTROOT)$(EFIMANDIR)/man1 -+ $(DSTROOT)$(LOCMANDIR)/man3 -+ifeq "$(EFITOOLS)" "efitools" -+ DSTDIR += $(DSTROOT)$(EFIMANDIR)/man1 -+endif - - install: $(DSTDIRS) $(COMMON_MAN1) $(OTHER_MAN1) $(MAN3) $(MAN5) $(MANL) \ - $(RC_OS) $(MANL3) -@@ -51,7 +58,9 @@ - install -c -m 444 $(MAN5) $(DSTROOT)$(MANDIR)/man5 - install -c -m 444 $(MANL) $(DSTROOT)$(LOCMANDIR)/man1 - install -c -m 444 $(MANL3) $(DSTROOT)$(LOCMANDIR)/man3 -+ifeq "$(EFITOOLS)" "efitools" - install -c -m 444 $(EFI1) $(DSTROOT)$(EFIMANDIR)/man1 -+endif - if [ $(OLD_DYLD_STUFF) ]; \ - then \ - install -c -m 444 $(DYLD_MANL3) $(DSTROOT)$(LOCMANDIR)/man3;\ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch deleted file mode 100644 index 098a95fb0de5..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-headers.patch +++ /dev/null @@ -1,15 +0,0 @@ -get rid of libraries, includes, and obsolete manpages - ---- cctools-698/Makefile -+++ cctools-698/Makefile -@@ -170,7 +170,9 @@ - DSTROOT=$$DSTROOT install_tools lib_ofiles_install; \ - fi - --install_tools: installhdrs -+install_tools: installhdrs install_all_but_headers -+ -+install_all_but_headers: - @if [ $(SRCROOT) ]; \ - then \ - CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch deleted file mode 100644 index 5ed823752357..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-no-oss-dir.patch +++ /dev/null @@ -1,17 +0,0 @@ -don't create an OpenSource dir - ---- cctools-698/as/Makefile -+++ cctools-698/as/Makefile -@@ -408,12 +408,6 @@ - $(MKDIRS) $(DSTROOT)$(USRBINDIR) - install -c -s -m 555 $(SYMROOT)/driver_dir/driver \ - $(DSTROOT)$(USRBINDIR)/as -- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceVersions/ -- install -c -s -m 444 $(SRCROOT)/cctools.plist \ -- $(DSTROOT)/usr/local/OpenSourceVersions/cctools.plist -- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceLicenses/ -- install -c -s -m 444 $(SRCROOT)/COPYING \ -- $(DSTROOT)/usr/local/OpenSourceLicenses/cctools.txt - $(MKDIRS) $(DSTROOT)$(LIBDIR)/ppc - install -c -s -m 555 $(SYMROOT)/appc_dir/as \ - $(DSTROOT)$(LIBDIR)/ppc/as diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch deleted file mode 100644 index 94865fb126dd..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-ranlib.patch +++ /dev/null @@ -1,53 +0,0 @@ -run ranlib before installation so we needn't touch permissions - ---- cctools-698/libmacho/Makefile -+++ cctools-698/libmacho/Makefile -@@ -316,29 +316,29 @@ - $(MKDIRS) $(DSTROOT)$(SYSTEMDIR) - if [ $(SRCROOT) = . ]; \ - then \ -+ ranlib dtmp_obj/libmacho.a; \ - install -c -m 444 dtmp_obj/libmacho.a \ - $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \ -- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \ - (cd $(DSTROOT)$(SYSTEMDIR) ; \ - rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \ -+ ranlib ptmp_obj/libmacho_pg.a; \ - install -c -m 444 ptmp_obj/libmacho_pg.a \ - $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \ -- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \ -+ ranlib otmp_obj/libmacho_static.a; \ - install -c -m 444 otmp_obj/libmacho_static.a \ - $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \ -- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \ - else \ -+ ranlib $(SYMROOT)/libmacho.a; \ - install -c -m 444 $(SYMROOT)/libmacho.a \ - $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \ -- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho.a; \ - (cd $(DSTROOT)$(SYSTEMDIR) ; \ - rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \ -+ ranlib $(SYMROOT)/libmacho_pg.a; \ - install -c -m 444 $(SYMROOT)/libmacho_pg.a \ - $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \ -- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_profile.a; \ -+ ranlib $(SYMROOT)/libmacho_static.a; \ - install -c -m 444 $(SYMROOT)/libmacho_static.a \ - $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \ -- ranlib $(DSTROOT)$(SYSTEMDIR)/libmacho_static.a; \ - fi - - teflon_lib_ofiles_install nextstep_lib_ofiles_install: ---- cctools-698/cbtlibs/Makefile -+++ cctools-698/cbtlibs/Makefile -@@ -80,9 +80,9 @@ - - lib_ofiles_install: lib_ofiles - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR) -+ ranlib $(SYMROOT)/libsyminfo.a - install -p -c -m 444 $(SYMROOT)/libsyminfo.a \ - $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a -- ranlib $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a - - -include $(OFILE_DIR)/Makedep - diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch deleted file mode 100644 index b3913262db26..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.1-testsuite.patch +++ /dev/null @@ -1,102 +0,0 @@ -fix the test suite so it is even usable - ---- ld64-85.2.2/unit-tests/test-cases/commons-alignment/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/commons-alignment/Makefile -@@ -29,9 +29,9 @@ - - all: - ${CC} ${CCFLAGS} foo.s -c -o foo.o -- nm -m foo.o | grep '(alignment 2^6)' | ${FAIL_IF_EMPTY} -+ nm -m foo.o | fgrep '(alignment 2^6)' | ${FAIL_IF_EMPTY} - ${LD} foo.o -r -o foo2.o -- nm -m foo2.o | grep '(alignment 2^6)' | ${PASS_IFF_STDIN} -+ nm -m foo2.o | fgrep '(alignment 2^6)' | ${PASS_IFF_STDIN} - - clean: - rm -rf foo.o foo2.o ---- ld64-85.2.2/unit-tests/test-cases/order_file/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/order_file/Makefile -@@ -33,7 +33,7 @@ - run: all - - all: -- as -arch ${ARCH} -L extra.s -o extra.o -+ as -L extra.s -o extra.o - ${CC} ${CCFLAGS} main.c extra.o -o main1 -Wl,-order_file -Wl,main1.order - ${FAIL_IF_BAD_MACHO} main1 - nm -n -g -j main1 | grep "_main" > main1.nm -@@ -44,7 +44,7 @@ - nm -n -j main2 | egrep '^_[a-z]+[0-9]$$' > main2.nm - ${PASS_IFF} diff main2.nm main2.expected - -- ${CC} -arch ${ARCH} -c main.c -o main.o -+ ${CC} -c main.c -o main.o - ${CC} ${CCFLAGS} main.o extra.o -o main3 -Wl,-order_file -Wl,main3.order - ${FAIL_IF_BAD_MACHO} main3 - nm -n -g -j main3 | grep "_main" > main3.nm ---- ld64-85.2.2/unit-tests/test-cases/16-byte-alignment/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/16-byte-alignment/Makefile -@@ -30,13 +30,13 @@ - run: all - - all: -- ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -arch ${ARCH} -c -O2 tl_test2.c -o tl_test2-${ARCH}.o -+ ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -c -O2 tl_test2.c -o tl_test2-${ARCH}.o - - # verify that the alignment is correct in the .o - ObjectDump -only _ai -align -no_content tl_test2-${ARCH}.o|${FAIL_IF_ERROR} grep '\<0 mod 16\>' >/dev/null - - # now verify the executable -- ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -arch ${ARCH} -O2 tl_test2-${ARCH}.o -o tl_test2-${ARCH} -+ ${FAIL_IF_ERROR} ${CC} ${CCFLAGS} -O2 tl_test2-${ARCH}.o -o tl_test2-${ARCH} - ${FAIL_IF_ERROR} sh -c "nm tl_test2-${ARCH}|grep '0 D _ai\>' >/dev/null" - ${PASS_IFF_GOOD_MACHO} tl_test2-${ARCH} - ---- ld64-85.2.2/unit-tests/test-cases/eh-strip-test/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/eh-strip-test/Makefile -@@ -27,7 +27,7 @@ - - - all: -- ${FAIL_IF_ERROR} $(CXX) main.cxx -arch ${ARCH} -o main -+ ${FAIL_IF_ERROR} $(CXX) main.cxx -o main - ${FAIL_IF_ERROR} nm -j main | grep '\.eh$$'| ${FAIL_IF_STDIN} - ${PASS_IFF_GOOD_MACHO} main - clean: ---- ld64-85.2.2/unit-tests/test-cases/strip-test2/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/strip-test2/Makefile -@@ -50,10 +50,10 @@ - - - all: -- $(CXX) main.cxx -arch ${ARCH} -o main -+ $(CXX) main.cxx -o main - ${FAIL_IF_BAD_MACHO} main - ${FAIL_IF_ERROR} nm -j main >main-no-strip.nm -- $(CXX) main.cxx -arch ${ARCH} -o main -+ $(CXX) main.cxx -o main - ${FAIL_IF_BAD_MACHO} main - - # Make sure there are no symbols in the stripped file that aren't ---- ld64-85.2.2/unit-tests/test-cases/literals-coalesce/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/literals-coalesce/Makefile -@@ -32,7 +32,7 @@ - - all: - ${CC} ${ASMFLAGS} literals.s -c -o literals-${ARCH}.o -- ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-${ARCH}.o | grep 'name:'| uniq -c | grep -v '^ [1|2]' | ${FAIL_IF_STDIN} -+ ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-${ARCH}.o | grep 'name:'| uniq -c | grep -v '^ *[1|2]' | ${FAIL_IF_STDIN} - ${LD} -arch ${ARCH} -r literals-${ARCH}.o -o literals-r-${ARCH}.o - ${FAIL_IF_ERROR} ${OBJECTDUMP} literals-r-${ARCH}.o | grep 'name:' | uniq -d | ${PASS_IFF_EMPTY} - ---- ld64-85.2.2/unit-tests/test-cases/stabs-coalesce/Makefile -+++ ld64-85.2.2/unit-tests/test-cases/stabs-coalesce/Makefile -@@ -38,7 +38,7 @@ - ${FAIL_IF_BAD_MACHO} stabs-hello-${ARCH} - nm -ap stabs-hello-${ARCH} | grep FUN | grep _Z3fooi | wc -l > stabs-hello-foo-count - echo " 1" > one -- ${PASS_IFF} diff stabs-hello-foo-count one -+ ${PASS_IFF} diff -w stabs-hello-foo-count one - - hello.o : hello.cxx - ${CXX} ${CCXXFLAGS} -gstabs+ -gused hello.cxx -c -o $@ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch b/sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch deleted file mode 100644 index 554fed1cbe39..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.1.2-as-Makefile.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- as/Makefile -+++ as/Makefile -@@ -343,7 +343,7 @@ - makeUser.o $(LIBSTUFF_DIR) $(LIBSTUFF) - $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/as $(SYMROOT)/as.private.o - --makeUser.c messages.c: make.h -+makeUser.c ../messages.c: make.h - - make.h makeUser.c: make.defs - $(MIG) $(MIG_FLAGS) $(SRCROOT)/make.defs diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch b/sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch deleted file mode 100644 index d89a0c19f2c6..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.2-armv7-defines.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- cctools/include/mach/machine.h -+++ cctools/include/mach/machine.h -@@ -306,6 +306,7 @@ - #define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6) - #define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7) - #define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8) -+#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) - - /* - * MC88000 subtypes diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch b/sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch deleted file mode 100644 index f032e1b5571d..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.2.2-as.patch +++ /dev/null @@ -1,101 +0,0 @@ -make building for obsolete architectures optional. - ---- as/Makefile -+++ as/Makefile -@@ -1,3 +1,4 @@ -+BUILD_OBSOLETE_ARCH = yes - RC_OS = macos - export USE_APPLE_PB_SUPPORT = all - OFLAG = -@@ -32,28 +33,36 @@ - SYMROOT = . - OBJROOT = . - SYM_DIRS = $(SYMROOT)/driver_dir \ -- $(SYMROOT)/a68_dir \ -- $(SYMROOT)/a88_dir \ - $(SYMROOT)/a386_dir \ - $(SYMROOT)/ax86_64_dir \ - $(SYMROOT)/appc_dir \ - $(SYMROOT)/appc64_dir \ -+ $(SYMROOT)/aarm_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+SYM_DIRS += \ -+ $(SYMROOT)/a68_dir \ -+ $(SYMROOT)/a88_dir \ - $(SYMROOT)/a860_dir \ - $(SYMROOT)/ahppa_dir \ -- $(SYMROOT)/asparc_dir \ -- $(SYMROOT)/aarm_dir -+ $(SYMROOT)/asparc_dir -+endif - - OFILE_DIRS = $(OBJROOT)/driver_dir \ -- $(OBJROOT)/a68_dir \ -- $(OBJROOT)/a88_dir \ - $(OBJROOT)/a386_dir \ - $(OBJROOT)/ax86_64_dir \ - $(OBJROOT)/appc_dir \ - $(OBJROOT)/appc64_dir \ -+ $(OBJROOT)/aarm_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+OFILE_DIRS += \ -+ $(OBJROOT)/a68_dir \ -+ $(OBJROOT)/a88_dir \ - $(OBJROOT)/a860_dir \ - $(OBJROOT)/ahppa_dir \ -- $(OBJROOT)/asparc_dir \ -- $(OBJROOT)/aarm_dir -+ $(OBJROOT)/asparc_dir -+endif - - BINDIR = /bin - USRBINDIR = /usr/bin -@@ -115,9 +124,12 @@ - OBJS_sparc = $(CFILES_sparc:.c=.o) - OBJS_arm = $(CFILES_arm:.c=.o) - --all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \ -- ax86_64_build a860_build appc_build appc64_build ahppa_build \ -- aarm_build asparc_build -+all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \ -+ ax86_64_build appc_build appc64_build aarm_build -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+all: a68_build a88_build a860_build ahppa_build asparc_build -+endif - - all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test - -@@ -429,12 +441,14 @@ - $(MKDIRS) $(DSTROOT)$(LIBDIR)/ppc64 - install -c -s -m 555 $(SYMROOT)/appc64_dir/as \ - $(DSTROOT)$(LIBDIR)/ppc64/as -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k - install -c -s -m 555 $(SYMROOT)/a68_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m68k/as - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc - install -c -s -m 555 $(SYMROOT)/asparc_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/sparc/as -+endif - $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm - install -c -s -m 555 $(SYMROOT)/aarm_dir/as \ - $(DSTROOT)$(LIBDIR)/arm/as -@@ -457,6 +471,7 @@ - $(DSTROOT)$(LOCLIBDIR)/ppc/as - - common_install: -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k - install -s -m 555 $(SYMROOT)/a88_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m88k/as -@@ -466,6 +481,7 @@ - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860 - install -s -m 555 $(SYMROOT)/a860_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/i860/as -+endif - - $(OFILE_DIRS) $(SYM_DIRS): - $(MKDIRS) $@ diff --git a/sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch deleted file mode 100644 index e5292746eadf..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-3.2.3-ranlib.patch +++ /dev/null @@ -1,59 +0,0 @@ -run ranlib before installation so we needn't touch permissions - ---- cctools-782/cbtlibs/Makefile 2009-12-16 20:34:18.000000000 +0100 -+++ cctools-782/cbtlibs/Makefile.new 2010-07-30 20:08:22.000000000 +0200 -@@ -84,9 +84,9 @@ libsyminfo.a: libsyminfo.o - - lib_ofiles_install: lib_ofiles - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR) -+ ranlib $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a - install -p -c -m 444 $(SYMROOT)/libsyminfo.a \ - $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a -- ranlib $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a - - -include $(OFILE_DIR)/Makedep - ---- cctools-782/libmacho/Makefile 2010-03-30 00:57:21.000000000 +0200 -+++ cctools-782/libmacho/Makefile.new 2010-07-30 20:07:57.000000000 +0200 -@@ -357,17 +357,17 @@ macos_lib_ofiles_install: all - $(MKDIRS) $(DSTROOT)$(ARCHIVEDIR) $(DSTROOT)$(DYLIBDIR) - if [ $(SRCROOT) = . ]; \ - then \ -+ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \ - install -c -m 444 dtmp_obj/libmacho.a \ - $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \ -- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \ - (cd $(DSTROOT)$(ARCHIVEDIR) ; \ - rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \ -+ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \ - install -c -m 444 ptmp_obj/libmacho_pg.a \ - $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \ -- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \ -+ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \ - install -c -m 444 otmp_obj/libmacho_static.a \ - $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \ -- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \ - install -c -m 555 dtmp_obj/libmacho.dylib \ - $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \ - strip -S $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \ -@@ -378,17 +378,17 @@ macos_lib_ofiles_install: all - $(DSTROOT)$(DYLIBDIR)/libmacho_debug.dylib; \ - strip -S $(DSTROOT)$(DYLIBDIR)/libmacho_debug.dylib; \ - else \ -+ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \ - install -c -m 444 $(SYMROOT)/libmacho.a \ - $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \ -- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho.a; \ - (cd $(DSTROOT)$(ARCHIVEDIR) ; \ - rm -f libmacho_debug.a ; ln -s libmacho.a libmacho_debug.a); \ -+ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \ - install -c -m 444 $(SYMROOT)/libmacho_pg.a \ - $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \ -- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_profile.a; \ -+ ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \ - install -c -m 444 $(SYMROOT)/libmacho_static.a \ - $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \ -- ranlib $(DSTROOT)$(ARCHIVEDIR)/libmacho_static.a; \ - install -c -m 555 $(SYMROOT)/libmacho.dylib \ - $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \ - strip -S $(DSTROOT)$(DYLIBDIR)/libmacho.dylib; \ diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch deleted file mode 100644 index 0a6664ce1633..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- as/driver.c -+++ as/driver.c -@@ -28,6 +28,9 @@ - char **envp) - { - const char *LIB = -+#ifdef ASLIBEXECDIR -+ ASLIBEXECDIR; -+#else - #if defined(__OPENSTEP__) || defined(__HERA__) || \ - defined(__GONZO_BUNSEN_BEAKER__) || defined(__KODIAK__) - "../libexec/"; -@@ -41,6 +44,7 @@ - #else - "../local/libexec/gcc/darwin/"; - #endif -+#endif - const char *AS = "/as"; - const char *LLVM_MC = "llvm-mc"; - -@@ -240,7 +244,11 @@ - - } - -+#ifndef ASLIBEXECDIR - as = makestr(prefix, LIB, arch_name, AS, NULL); -+#else -+ as = makestr(LIB, arch_name, AS, NULL); -+#endif - - /* - * If this assembler exist try to run it else print an error message. -@@ -252,6 +260,10 @@ - else - exit(1); - } -+#ifdef ASLIBEXECDIR -+ as_local = ""; -+ { -+#else - as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL); - if(access(as_local, F_OK) == 0){ - argv[0] = as_local; -@@ -261,6 +273,7 @@ - exit(1); - } - else{ -+#endif - printf("%s: assembler (%s or %s) for architecture %s not " - "installed\n", progname, as, as_local, arch_name); - arch_flags = get_arch_flags(); -@@ -273,6 +286,7 @@ - printf("%s for architecture %s\n", as, arch_flags[i].name); - count++; - } -+#ifndef ASLIBEXECDIR - else{ - as_local = makestr(prefix, LOCALLIB, arch_flags[i].name, - AS, NULL); -@@ -284,6 +298,7 @@ - count++; - } - } -+#endif - } - if(count == 0) - printf("%s: no assemblers installed\n", progname); diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch b/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch deleted file mode 100644 index 8df58775d650..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- as/Makefile -+++ as/Makefile -@@ -1,3 +1,4 @@ -+BUILD_OBSOLETE_ARCH = yes - RC_OS = macos - export USE_APPLE_PB_SUPPORT = all - OFLAG = -Os -@@ -32,28 +33,36 @@ - SYMROOT = . - OBJROOT = . - SYM_DIRS = $(SYMROOT)/driver_dir \ -- $(SYMROOT)/a68_dir \ -- $(SYMROOT)/a88_dir \ - $(SYMROOT)/a386_dir \ - $(SYMROOT)/ax86_64_dir \ - $(SYMROOT)/appc_dir \ - $(SYMROOT)/appc64_dir \ -+ $(SYMROOT)/aarm_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+SYM_DIRS += \ -+ $(SYMROOT)/a68_dir \ -+ $(SYMROOT)/a88_dir \ - $(SYMROOT)/a860_dir \ - $(SYMROOT)/ahppa_dir \ -- $(SYMROOT)/asparc_dir \ -- $(SYMROOT)/aarm_dir -+ $(SYMROOT)/asparc_dir -+endif - - OFILE_DIRS = $(OBJROOT)/driver_dir \ -- $(OBJROOT)/a68_dir \ -- $(OBJROOT)/a88_dir \ - $(OBJROOT)/a386_dir \ - $(OBJROOT)/ax86_64_dir \ - $(OBJROOT)/appc_dir \ - $(OBJROOT)/appc64_dir \ -+ $(OBJROOT)/aarm_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+OFILE_DIRS += \ -+ $(OBJROOT)/a68_dir \ -+ $(OBJROOT)/a88_dir \ - $(OBJROOT)/a860_dir \ - $(OBJROOT)/ahppa_dir \ -- $(OBJROOT)/asparc_dir \ -- $(OBJROOT)/aarm_dir -+ $(OBJROOT)/asparc_dir -+endif - - BINDIR = /bin - USRBINDIR = /usr/bin -@@ -115,9 +124,12 @@ - OBJS_sparc = $(CFILES_sparc:.c=.o) - OBJS_arm = $(CFILES_arm:.c=.o) - --all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \ -- ax86_64_build a860_build appc_build appc64_build ahppa_build \ -- aarm_build asparc_build -+all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \ -+ ax86_64_build appc_build appc64_build aarm_build -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+all: a68_build a88_build a860_build ahppa_build asparc_build -+endif - - all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test - -@@ -452,12 +464,14 @@ - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc64 - install -c -s -m 555 $(SYMROOT)/appc64_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/ppc64/as -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k - install -c -s -m 555 $(SYMROOT)/a68_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m68k/as - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc - install -c -s -m 555 $(SYMROOT)/asparc_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/sparc/as -+endif - $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm - install -c -s -m 555 $(SYMROOT)/aarm_dir/as \ - $(DSTROOT)$(LIBDIR)/arm/as -@@ -480,6 +494,7 @@ - $(DSTROOT)$(LOCLIBDIR)/ppc/as - - common_install: -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k - install -c -s -m 555 $(SYMROOT)/a88_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m88k/as -@@ -489,6 +504,7 @@ - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860 - install -s -m 555 $(SYMROOT)/a860_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/i860/as -+endif - - $(OFILE_DIRS) $(SYM_DIRS): - $(MKDIRS) $@ diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch deleted file mode 100644 index fcce015e1980..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- as/Makefile -+++ as/Makefile -@@ -452,12 +452,6 @@ - $(MKDIRS) $(DSTROOT)$(USRBINDIR) - install -c -s -m 555 $(SYMROOT)/driver_dir/driver \ - $(DSTROOT)$(USRBINDIR)/as -- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceVersions/ -- install -c -s -m 444 $(SRCROOT)/cctools.plist \ -- $(DSTROOT)/usr/local/OpenSourceVersions/cctools.plist -- $(MKDIRS) $(DSTROOT)/usr/local/OpenSourceLicenses/ -- install -c -s -m 444 $(SRCROOT)/COPYING \ -- $(DSTROOT)/usr/local/OpenSourceLicenses/cctools.txt - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc - install -c -s -m 555 $(SYMROOT)/appc_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/ppc/as diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch deleted file mode 100644 index b3047f6215fd..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.2-as-dir.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- as/driver.c -+++ as/driver.c -@@ -230,7 +230,11 @@ - /* - * If this assembler exist try to run it else print an error message. - */ -+#ifndef ASLIBEXECDIR - as = makestr(prefix, LIB, arch_name, AS, NULL); -+#else -+ as = makestr(ASLIBEXECDIR, arch_name, AS, NULL); -+#endif - if(access(as, F_OK) == 0){ - argv[0] = as; - if(execute(argv, verbose)) -@@ -238,6 +242,9 @@ - else - exit(1); - } -+#ifdef ASLIBEXECDIR -+ as_local = ""; -+#else - as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL); - if(access(as_local, F_OK) == 0){ - argv[0] = as_local; -@@ -246,10 +253,12 @@ - else - exit(1); - } -+#endif - printf("%s: assembler (%s or %s) for architecture %s not installed\n", - progname, as, as_local, arch_name); - arch_flags = get_arch_flags(); - count = 0; -+#ifndef ASLIBEXECDIR - for(i = 0; arch_flags[i].name != NULL; i++){ - as = makestr(prefix, LIB, arch_flags[i].name, AS, NULL); - if(access(as, F_OK) == 0){ -@@ -270,6 +279,7 @@ - } - } - } -+#endif - if(count == 0) - printf("%s: no assemblers installed\n", progname); - exit(1); diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch b/sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch deleted file mode 100644 index 76419ad90780..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.2-globals-extern.patch +++ /dev/null @@ -1,29 +0,0 @@ -Externally referenced globals should be marked extern to avoid stuff like this happening: - -ld: warning: tentative definition of '_subsections_via_symbols' with size 16 from 'app.o' is being replaced by real definition of smaller size 4 from 'as.o' -ld: warning: tentative definition of '_subsections_via_symbols' with size 16 from 'atof-ieee.o' is being replaced by real definition of smaller size 4 from 'as.o' -... - ---- cctools-809/as/as.h.orig 2015-01-28 23:52:40.000000000 +0100 -+++ cctools-809/as/as.h 2015-01-28 23:52:52.000000000 +0100 -@@ -179,7 +179,7 @@ - extern char *specific_archflag; - - /* TRUE if the .subsections_via_symbols directive was seen */ --int subsections_via_symbols; -+extern int subsections_via_symbols; - - /* -I path options for .includes */ - struct directory_stack { ---- cctools-809/as/arm.c.orig 2015-01-28 23:57:23.000000000 +0100 -+++ cctools-809/as/arm.c 2015-01-28 23:57:35.000000000 +0100 -@@ -151,8 +151,7 @@ - # define N_(String) (String) - - /* STUFF FROM gas/as.h */ --#define COMMON --COMMON subsegT now_subseg; -+extern subsegT now_subseg; - - /* STUFF FROM gas/config/tc-arm.h */ - #define ARM_FLAG_THUMB (1 << 0) /* The symbol is a Thumb symbol rather than an Arm symbol. */ diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch b/sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch deleted file mode 100644 index 791a922dd425..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.2-lto.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- misc/lipo.c -+++ misc/lipo.c -@@ -1191,6 +1191,7 @@ - thin->fat_arch.align = 0; - } - else{ -+#ifdef LTO_SUPPORT - if(is_llvm_bitcode_from_memory(addr, size, &input->arch_flag, - NULL) != 0){ - /* create a thin file struct for it */ -@@ -1204,6 +1205,7 @@ - thin->fat_arch.align = 0; - } - else -+#endif - fatal("can't figure out the architecture type of: %s", - input->name); - } -@@ -1444,6 +1446,7 @@ - if(strncmp(ar_name, SYMDEF, sizeof(SYMDEF) - 1) != 0){ - ar_addr = addr + offset + ar_name_size; - ar_size = strtoul(ar_hdr->ar_size, NULL, 10); -+#ifdef LTO_SUPPORT - if(is_llvm_bitcode_from_memory(ar_addr, ar_size, - &arch_flag, NULL) != 0){ - if(*cputype == 0){ -@@ -1466,6 +1464,7 @@ - (*cpusubtype) & ~CPU_SUBTYPE_MASK); - } - } -+#endif - } - } - } diff --git a/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch b/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch deleted file mode 100644 index 0769016c5682..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-4.5-as.patch +++ /dev/null @@ -1,100 +0,0 @@ -Allow to disable build of as backends for obsolete architectures. - -diff --git a/as/Makefile b/as/Makefile -index a4b016e..9e8bcc3 100644 ---- a/as/Makefile -+++ b/as/Makefile -@@ -1,3 +1,4 @@ -+BUILD_OBSOLETE_ARCH = yes - export USE_APPLE_PB_SUPPORT = all - - ifneq "" "$(SDKROOT)" -@@ -20,28 +21,36 @@ SRCROOT = . - SYMROOT = . - OBJROOT = . - SYM_DIRS = $(SYMROOT)/driver_dir \ -- $(SYMROOT)/a68_dir \ -- $(SYMROOT)/a88_dir \ - $(SYMROOT)/a386_dir \ - $(SYMROOT)/ax86_64_dir \ - $(SYMROOT)/appc_dir \ - $(SYMROOT)/appc64_dir \ -+ $(SYMROOT)/aarm_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+SYM_DIRS += \ -+ $(SYMROOT)/a68_dir \ -+ $(SYMROOT)/a88_dir \ - $(SYMROOT)/a860_dir \ - $(SYMROOT)/ahppa_dir \ -- $(SYMROOT)/asparc_dir \ -- $(SYMROOT)/aarm_dir -+ $(SYMROOT)/asparc_dir -+endif - - OFILE_DIRS = $(OBJROOT)/driver_dir \ -- $(OBJROOT)/a68_dir \ -- $(OBJROOT)/a88_dir \ - $(OBJROOT)/a386_dir \ - $(OBJROOT)/ax86_64_dir \ - $(OBJROOT)/appc_dir \ - $(OBJROOT)/appc64_dir \ -+ $(OBJROOT)/aarm_dir -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+OFILE_DIRS += \ -+ $(OBJROOT)/a68_dir \ -+ $(OBJROOT)/a88_dir \ - $(OBJROOT)/a860_dir \ - $(OBJROOT)/ahppa_dir \ -- $(OBJROOT)/asparc_dir \ -- $(OBJROOT)/aarm_dir -+ $(OBJROOT)/asparc_dir -+endif - - BINDIR = /bin - USRBINDIR = /usr/bin -@@ -88,9 +97,13 @@ OBJS_hppa = $(CFILES_hppa:.c=.o) - OBJS_sparc = $(CFILES_sparc:.c=.o) - OBJS_arm = $(CFILES_arm:.c=.o) - --all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a68_build a88_build a386_build \ -- ax86_64_build a860_build appc_build appc64_build ahppa_build \ -- aarm_build asparc_build -+all: $(OFILE_DIRS) $(SYM_DIRS) driver_build a386_build \ -+ ax86_64_build appc_build appc64_build aarm_build -+ -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" -+all: a68_build a88_build a860_build ahppa_build asparc_build -+endif -+ - - all_test: a68_test a88_test a860_test a386_test appc_test ahppa_test - -@@ -406,15 +419,18 @@ install: all - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/ppc64 - install -c -s -m 555 $(SYMROOT)/appc64_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/ppc64/as -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m68k - install -c -s -m 555 $(SYMROOT)/a68_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m68k/as - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/sparc - install -c -s -m 555 $(SYMROOT)/asparc_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/sparc/as -+endif - $(MKDIRS) $(DSTROOT)$(LIBDIR)/arm - install -c -s -m 555 $(SYMROOT)/aarm_dir/as \ - $(DSTROOT)$(LIBDIR)/arm/as -+ifeq "yes" "$(BUILD_OBSOLETE_ARCH)" - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/m88k - install -c -s -m 555 $(SYMROOT)/a88_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/m88k/as -@@ -424,6 +440,7 @@ install: all - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR)/i860 - install -s -m 555 $(SYMROOT)/a860_dir/as \ - $(DSTROOT)$(LOCLIBDIR)/i860/as -+endif - - $(OFILE_DIRS) $(SYM_DIRS): - $(MKDIRS) $@ diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch deleted file mode 100644 index 1c7c6360a6a8..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-as-dir.patch +++ /dev/null @@ -1,47 +0,0 @@ -Allow to set directory for as backends from the outside. - ---- cctools-855/as/driver.c.orig 2014-04-05 00:42:22.000000000 +0200 -+++ cctools-855/as/driver.c 2014-11-13 13:07:09.000000000 +0100 -@@ -365,7 +365,11 @@ - /* - * If this assembler exist try to run it else print an error message. - */ -+#ifndef ASLIBEXECDIR - as = makestr(prefix, LIB, arch_name, AS, NULL); -+#else -+ as = makestr(ASLIBEXECDIR, arch_name, AS, NULL); -+#endif - new_argv = allocate((argc + 1) * sizeof(char *)); - new_argv[0] = as; - j = 1; -@@ -387,6 +391,9 @@ - else - exit(1); - } -+#ifdef ASLIBEXECDIR -+ as_local = ""; -+#else - as_local = makestr(prefix, LOCALLIB, arch_name, AS, NULL); - new_argv[0] = as_local; - if(access(as_local, F_OK) == 0){ -@@ -396,10 +403,12 @@ - else - exit(1); - } -+#endif - printf("%s: assembler (%s or %s) for architecture %s not installed\n", - progname, as, as_local, arch_name); - arch_flags = get_arch_flags(); - count = 0; -+#ifndef ASLIBEXECDIR - for(i = 0; arch_flags[i].name != NULL; i++){ - as = makestr(prefix, LIB, arch_flags[i].name, AS, NULL); - if(access(as, F_OK) == 0){ -@@ -420,6 +429,7 @@ - } - } - } -+#endif - if(count == 0) - printf("%s: no assemblers installed\n", progname); - exit(1); diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch deleted file mode 100644 index 066ce57a6f59..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-constant-types.patch +++ /dev/null @@ -1,26 +0,0 @@ -Avoid error with gcc on 32bit platforms: -ld/LinkEdit.hpp:1329: error: integer constant is too large for 'long' type - ---- cctools-855/include/llvm-c/Disassembler.h.orig 2015-01-14 18:36:22.000000000 +0100 -+++ cctools-855/include/llvm-c/Disassembler.h 2015-01-14 18:36:39.000000000 +0100 -@@ -133,15 +133,15 @@ - #define LLVMDisassembler_ReferenceType_In_PCrel_Load 2 - - /* The input reference is from an ARM64::ADRP instruction. */ --#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001 -+#define LLVMDisassembler_ReferenceType_In_ARM64_ADRP 0x100000001ULL - /* The input reference is from an ARM64::ADDXri instruction. */ --#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002 -+#define LLVMDisassembler_ReferenceType_In_ARM64_ADDXri 0x100000002ULL - /* The input reference is from an ARM64::LDRXui instruction. */ --#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003 -+#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXui 0x100000003ULL - /* The input reference is from an ARM64::LDRXl instruction. */ --#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004 -+#define LLVMDisassembler_ReferenceType_In_ARM64_LDRXl 0x100000004ULL - /* The input reference is from an ARM64::ADR instruction. */ --#define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005 -+#define LLVMDisassembler_ReferenceType_In_ARM64_ADR 0x100000005ULL - - /* The output reference is to as symbol stub. */ - #define LLVMDisassembler_ReferenceType_Out_SymbolStub 1 diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch deleted file mode 100644 index 2e0a109223f9..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-extraneous-includes.patch +++ /dev/null @@ -1,31 +0,0 @@ -Remove extraneous includes that contain clang language extensions on Mac OS X -10.10 (xpc/base.h - __has_extension). - ---- ./cctools-855/as/messages.c.orig 2015-01-12 18:49:02.000000000 +0100 -+++ ./cctools-855/as/messages.c 2015-01-12 18:49:06.000000000 +0100 -@@ -23,11 +23,6 @@ - #include <string.h> - #include <mach/mach.h> - #include <mach/mach_init.h> --#if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__) --#include <servers/netname.h> --#else --#include <servers/bootstrap.h> --#endif - #include "as.h" - #include "input-scrub.h" - #include "messages.h" ---- ./cctools-855/misc/libtool.c.orig 2015-01-12 18:48:29.000000000 +0100 -+++ ./cctools-855/misc/libtool.c 2015-01-12 18:48:40.000000000 +0100 -@@ -53,11 +53,6 @@ - #endif /* LTO_SUPPORT */ - - #include <mach/mach_init.h> --#if defined(__OPENSTEP__) || defined(__GONZO_BUNSEN_BEAKER__) --#include <servers/netname.h> --#else --#include <servers/bootstrap.h> --#endif - - /* - * This is used internally to build the table of contents. diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch deleted file mode 100644 index 62490ef8ce46..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-nolto.patch +++ /dev/null @@ -1,43 +0,0 @@ -Allow to fully disable LTO. - -diff --git a/libstuff/lto.c b/libstuff/lto.c -index 6f5758d..5ba7996 100644 ---- a/libstuff/lto.c -+++ b/libstuff/lto.c -@@ -381,4 +381,18 @@ void *mod) - lto_dispose(mod); - } - -+#else -+ -+#include <stdlib.h> -+#include "stuff/ofile.h" -+ -+__private_extern__ -+int -+is_llvm_bitcode( -+ struct ofile *ofile, -+ char *addr, -+ size_t size) -+{ -+ return 0; -+} - #endif /* LTO_SUPPORT */ -diff --git a/misc/libtool.c b/misc/libtool.c -index f9c7557..ff829cc 100644 ---- a/misc/libtool.c -+++ b/misc/libtool.c -@@ -1370,8 +1370,11 @@ void) - } - } - } -- else if(ofiles[i].arch_type == OFILE_Mach_O || -- ofiles[i].arch_type == OFILE_LLVM_BITCODE){ -+ else if(ofiles[i].arch_type == OFILE_Mach_O -+#ifdef LTO_SUPPORT -+ || ofiles[i].arch_type == OFILE_LLVM_BITCODE -+#endif -+ ){ - if(cmd_flags.ranlib == TRUE){ - error("for architecture: %s file: %s is not an " - "archive (no processing done on this file)", diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch deleted file mode 100644 index ca02e643a45e..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-otool-stdc.patch +++ /dev/null @@ -1,23 +0,0 @@ -Do not use C++/C11(?) style local variable declaration. - ---- cctools-855/otool/dyld_bind_info.c.orig 2015-01-12 18:55:04.000000000 +0100 -+++ cctools-855/otool/dyld_bind_info.c 2015-01-12 18:56:35.000000000 +0100 -@@ -353,7 +353,9 @@ - skip = read_uleb128(&p, end); - sectName = sectionName(segIndex, segStartAddr + segOffset, - segs, nsegs, segs64, nsegs64); -- for (uint32_t i=0; i < count; ++i) { -+ { -+ uint32_t i; -+ for (i=0; i < count; ++i) { - if(pass == 2){ - (*dbi)[n].segname = segName; - (*dbi)[n].sectname = sectName; -@@ -367,6 +369,7 @@ - n++; - segOffset += skip + sizeof_pointer; - } -+ } - break; - default: - return; /* throwf("bad bind opcode %d", *p); */ diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch deleted file mode 100644 index 1930dfc82d27..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-ranlib.patch +++ /dev/null @@ -1,15 +0,0 @@ -Run ranlib before installation of the libary. - ---- ./cctools-855/cbtlibs/Makefile.ranlib 2014-04-05 00:42:22.000000000 +0200 -+++ ./cctools-855/cbtlibs/Makefile 2014-08-29 14:49:41.000000000 +0200 -@@ -61,9 +61,9 @@ - - lib_ofiles_install: lib_ofiles - $(MKDIRS) $(DSTROOT)$(LOCLIBDIR) -+ $(RANLIB) $(SYMROOT)/libsyminfo.a - install -p -c -m 444 $(SYMROOT)/libsyminfo.a \ - $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a -- $(RANLIB) $(DSTROOT)$(LOCLIBDIR)/libsyminfo.a - - $(OFILE_DIR) $(SYMROOT): - $(MKDIRS) $@ diff --git a/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch b/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch deleted file mode 100644 index 887e15628b31..000000000000 --- a/sys-devel/binutils-apple/files/binutils-apple-5.1-strnlen.patch +++ /dev/null @@ -1,45 +0,0 @@ -Provide strnlen on platforms where it's missing. - ---- cctools-855/otool/ofile_print.c.orig 2015-01-14 18:33:14.000000000 +0100 -+++ cctools-855/otool/ofile_print.c 2015-01-14 18:34:03.000000000 +0100 -@@ -3647,6 +3647,40 @@ - printf(" pad %u\n", ec->pad); - } - -+/* borrowed from gnulib */ -+#include <AvailabilityMacros.h> -+ -+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 -+/* Find the length of STRING, but scan at most MAXLEN characters. -+ * Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc. -+ * Written by Simon Josefsson. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see <http://www.gnu.org/licenses/>. */ -+ -+#include <string.h> -+ -+/* Find the length of STRING, but scan at most MAXLEN characters. -+ * If no '\0' terminator is found in that many characters, return MAXLEN. */ -+ -+size_t -+strnlen (const char *string, size_t maxlen) -+{ -+ const char *end = memchr (string, '\0', maxlen); -+ return end ? (size_t) (end - string) : maxlen; -+} -+#endif -+ - /* - * print an LC_LINKER_OPTION command. The linker_option_command structure - * specified must be aligned correctly and in the host byte sex. The lc is diff --git a/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch b/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch deleted file mode 100644 index d9bd9a8425b9..000000000000 --- a/sys-devel/binutils-apple/files/cctools-839-intel-retf.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/as/i386-opcode.h b/as/i386-opcode.h -index 4ba397f..862449a 100644 ---- a/as/i386-opcode.h -+++ b/as/i386-opcode.h -@@ -415,6 +415,9 @@ static const template i386_optab[] = - {"ret", 1, 0xc2, X, Cpu64, wq_Suf|DefaultSize|NoRex64,{ Imm16, 0, 0} }, - {"lret", 0, 0xcb, X, 0, wlq_Suf|DefaultSize, { 0, 0, 0} }, - {"lret", 1, 0xca, X, 0, wlq_Suf|DefaultSize, { Imm16, 0, 0} }, -+// intel syntax -+{"retf", 0, 0xcb, X, 0, wlq_Suf|DefaultSize, { 0, 0, 0} }, -+{"retf", 1, 0xca, X, 0, wlq_Suf|DefaultSize, { Imm16, 0, 0} }, - {"enter", 2, 0xc8, X, Cpu186|CpuNo64, wl_Suf|DefaultSize, { Imm16, Imm8, 0} }, - {"enter", 2, 0xc8, X, Cpu64, wq_Suf|DefaultSize|NoRex64, { Imm16, Imm8, 0} }, - {"leave", 0, 0xc9, X, Cpu186|CpuNo64, wl_Suf|DefaultSize, { 0, 0, 0} }, diff --git a/sys-devel/binutils-apple/files/ld64-123.2-Makefile b/sys-devel/binutils-apple/files/ld64-123.2-Makefile deleted file mode 100644 index 47af12d4b2ec..000000000000 --- a/sys-devel/binutils-apple/files/ld64-123.2-Makefile +++ /dev/null @@ -1,47 +0,0 @@ -CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. - -# dropped machocheck due to compilation failures -all: rebase unwinddump dyldinfo ld64 ObjectDump - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \ - ld/parsers/opaque_section_file.o \ - ld/parsers/macho_dylib_file.o \ - ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order_file.o \ - ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \ - ld/passes/compact_unwind.o ld/passes/huge.o \ - ld/passes/dtrace_dof.o ld/passes/objc.o \ - ld/passes/stubs/stubs.o \ - ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \ - ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o - -ifeq ($(LTO),1) -CPPFLAGS += "-DLTO" -LTO_OBJ = ld/parsers/lto_file.o -LIBLTO = -lLTO -else -CPPFLAGS += "-ULTO" -LTO_OBJ = -LIBLTO = -endif - -ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch b/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch deleted file mode 100644 index c8a303e1c9d6..000000000000 --- a/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch +++ /dev/null @@ -1,17 +0,0 @@ -On Tiger (Darwin 8) the whole system (/usr/bin/crt0.o for example) is -long-branch compiled, so *any* linkage operation causes this warning to -be raised. Don't do it. - - ---- ld/parsers/macho_relocatable_file.cpp -+++ ld/parsers/macho_relocatable_file.cpp -@@ -5532,9 +5532,6 @@ - // this is from -mlong-branch codegen. We ignore the jump island and make reference to the real target - if ( nextReloc->r_type() != PPC_RELOC_PAIR ) - throw "PPC_RELOC_JBSR missing following pair"; -- if ( !parser._hasLongBranchStubs ) -- warning("object file compiled with -mlong-branch which is no longer needed. " -- "To remove this warning, recompile without -mlong-branch: %s", parser._path); - parser._hasLongBranchStubs = true; - result = true; - if ( reloc->r_extern() ) { diff --git a/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch b/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch deleted file mode 100644 index f1126503b424..000000000000 --- a/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch +++ /dev/null @@ -1,15 +0,0 @@ -execinfo.h isn't available <10.5, so make sure it is only included when -actually necessary - ---- ld/ld.cpp -+++ ld/ld.cpp -@@ -37,7 +37,9 @@ - #include <errno.h> - #include <limits.h> - #include <unistd.h> -+#ifndef NDEBUG - #include <execinfo.h> -+#endif - #include <mach/mach_time.h> - #include <mach/vm_statistics.h> - #include <mach/mach_init.h> diff --git a/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch b/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch deleted file mode 100644 index 17bac81ca291..000000000000 --- a/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch +++ /dev/null @@ -1,218 +0,0 @@ -diff -ur ld.orig/InputFiles.cpp ld/InputFiles.cpp ---- ld.orig/InputFiles.cpp 2010-10-05 01:57:50.000000000 +0200 -+++ ld/InputFiles.cpp 2011-09-03 20:33:40.000000000 +0200 -@@ -58,7 +58,9 @@ - #include "macho_relocatable_file.h" - #include "macho_dylib_file.h" - #include "archive_file.h" -+#ifdef LTO - #include "lto_file.h" -+#endif - #include "opaque_section_file.h" - - -@@ -175,9 +177,11 @@ - if ( result != NULL ) - return result; - -+#ifdef LTO - result = lto::archName(p, len); - if ( result != NULL ) - return result; -+#endif - - if ( strncmp((const char*)p, "!<arch>\n", 8) == 0 ) - return "archive"; -@@ -264,10 +268,12 @@ - if ( objResult != NULL ) - return this->addObject(objResult, info, len); - -+#if LTO - // see if it is an llvm object file - objResult = lto::parse(p, len, info.path, info.modTime, _nextInputOrdinal, _options.architecture(), _options.subArchitecture(), _options.logAllFiles()); - if ( objResult != NULL ) - return this->addObject(objResult, info, len); -+#endif - - // see if it is a dynamic library - ld::dylib::File* dylibResult = mach_o::dylib::parse(p, len, info.path, info.modTime, _options, _nextInputOrdinal, info.options.fBundleLoader); -@@ -286,6 +292,7 @@ - if ( archiveResult != NULL ) - return this->addArchive(archiveResult, info, len); - -+#ifdef LTO - // does not seem to be any valid linker input file, check LTO misconfiguration problems - if ( lto::archName((uint8_t*)p, len) != NULL ) { - if ( lto::libLTOisLoaded() ) { -@@ -310,6 +317,7 @@ - throwf("could not process llvm bitcode object file, because %s could not be loaded", libLTO); - } - } -+#endif - - // error handling - if ( ((fat_header*)p)->magic == OSSwapBigToHostInt32(FAT_MAGIC) ) { -diff -ur ld.orig/Options.cpp ld/Options.cpp ---- ld.orig/Options.cpp 2011-03-08 03:06:35.000000000 +0100 -+++ ld/Options.cpp 2011-09-03 21:06:28.000000000 +0200 -@@ -36,10 +36,12 @@ - #include "Architectures.hpp" - #include "MachOFileAbstraction.hpp" - -+#ifdef LTO - // upward dependency on lto::version() - namespace lto { - extern const char* version(); - } -+#endif - - // magic to place command line in crash reports - const int crashreporterBufferSize = 2000; -@@ -2786,9 +2788,11 @@ - fprintf(stderr, "%s", ldVersionString); - // if only -v specified, exit cleanly - if ( argc == 2 ) { -+#ifdef LTO - const char* ltoVers = lto::version(); - if ( ltoVers != NULL ) - fprintf(stderr, "%s\n", ltoVers); -+#endif - exit(0); - } - } -diff -ur ld.orig/Resolver.cpp ld/Resolver.cpp ---- ld.orig/Resolver.cpp 2010-12-10 23:39:41.000000000 +0100 -+++ ld/Resolver.cpp 2011-09-03 20:38:24.000000000 +0200 -@@ -58,7 +58,9 @@ - #include "InputFiles.h" - #include "SymbolTable.h" - #include "Resolver.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - - - namespace ld { -@@ -1275,6 +1277,7 @@ - - void Resolver::linkTimeOptimize() - { -+#ifdef LTO - // only do work here if some llvm obj files where loaded - if ( ! _haveLLVMObjs ) - return; -@@ -1375,6 +1378,9 @@ - // check new code does not override some dylib - this->checkDylibSymbolCollisions(); - } -+#else -+ return; -+#endif - } - - -diff -ur ld.orig/ld.cpp ld/ld.cpp ---- ld.orig/ld.cpp 2011-09-03 20:24:07.000000000 +0200 -+++ ld/ld.cpp 2011-09-03 20:40:06.000000000 +0200 -@@ -85,7 +85,9 @@ - #include "parsers/archive_file.h" - #include "parsers/macho_relocatable_file.h" - #include "parsers/macho_dylib_file.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - #include "parsers/opaque_section_file.h" - - -diff -ur ld.orig/parsers/archive_file.cpp ld/parsers/archive_file.cpp ---- ld.orig/parsers/archive_file.cpp 2010-09-29 02:26:13.000000000 +0200 -+++ ld/parsers/archive_file.cpp 2011-09-03 21:01:55.000000000 +0200 -@@ -38,7 +38,9 @@ - #include "Architectures.hpp" - - #include "macho_relocatable_file.h" -+#ifdef LTO - #include "lto_file.h" -+#endif - #include "archive_file.h" - - -@@ -87,8 +89,10 @@ - private: - static bool validMachOFile(const uint8_t* fileContent, uint64_t fileLength, - const mach_o::relocatable::ParserOptions& opts); -+#ifdef LTO - static bool validLTOFile(const uint8_t* fileContent, uint64_t fileLength, - const mach_o::relocatable::ParserOptions& opts); -+#endif - static cpu_type_t architecture(); - - -@@ -232,12 +236,13 @@ - return mach_o::relocatable::isObjectFile(fileContent, fileLength, opts); - } - -+#ifdef LTO - template <typename A> - bool File<A>::validLTOFile(const uint8_t* fileContent, uint64_t fileLength, const mach_o::relocatable::ParserOptions& opts) - { - return lto::isObjectFile(fileContent, fileLength, opts.architecture, opts.subType); - } -- -+#endif - - - template <typename A> -@@ -256,7 +261,11 @@ - if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) ) - continue; - // archive is valid if first .o file is valid -- return (validMachOFile(p->content(), p->contentSize(), opts) || validLTOFile(p->content(), p->contentSize(), opts)); -+ return (validMachOFile(p->content(), p->contentSize(), opts) -+#ifdef LTO -+ || validLTOFile(p->content(), p->contentSize(), opts) -+#endif -+ ); - } - // empty archive - return true; -@@ -342,12 +351,14 @@ - this->ordinal() + memberIndex, _objOpts); - if ( result != NULL ) - return result; -+#ifdef LTO - // see if member is llvm bitcode file - result = lto::parse(member->content(), member->contentSize(), - mPath, member->modificationTime(), this->ordinal() + memberIndex, - _objOpts.architecture, _objOpts.subType, _logAllFiles); - if ( result != NULL ) - return result; -+#endif - - throwf("archive member '%s' with length %d is not mach-o or llvm bitcode", memberName, member->contentSize()); - } ---- other/ObjectDump.cpp.orig 2011-09-03 21:15:10.000000000 +0200 -+++ other/ObjectDump.cpp 2011-09-03 21:14:37.000000000 +0200 -@@ -33,7 +33,9 @@ - - #include "MachOFileAbstraction.hpp" - #include "parsers/macho_relocatable_file.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - - static bool sDumpContent= true; - static bool sDumpStabs = false; -@@ -1121,10 +1123,12 @@ - if ( objResult != NULL ) - return objResult; - -+#ifdef LTO - // see if it is an llvm object file - objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, 0, sPreferredArch, sPreferredSubArch, false); - if ( objResult != NULL ) - return objResult; -+#endif - - throwf("not a mach-o object file: %s", path); - #else diff --git a/sys-devel/binutils-apple/files/ld64-127.2-Makefile b/sys-devel/binutils-apple/files/ld64-127.2-Makefile deleted file mode 100644 index 74aef560a23e..000000000000 --- a/sys-devel/binutils-apple/files/ld64-127.2-Makefile +++ /dev/null @@ -1,50 +0,0 @@ -CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. - -# some files generate warnings about applying offsetof to a non-POD type. -# Upstream seems aware of that and ignores by setting -# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project. -CXXFLAGS += -Wno-invalid-offsetof - -all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \ - ld/parsers/opaque_section_file.o \ - ld/parsers/macho_dylib_file.o \ - ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order_file.o \ - ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \ - ld/passes/compact_unwind.o ld/passes/huge.o \ - ld/passes/dtrace_dof.o ld/passes/objc.o \ - ld/passes/stubs/stubs.o \ - ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \ - ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o - -ifeq ($(LTO),1) -CPPFLAGS += -DLTO -LTO_OBJ = ld/parsers/lto_file.o -LIBLTO = -lLTO -else -LTO_OBJ = -LIBLTO = -endif - -ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch b/sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch deleted file mode 100644 index 34d508063df1..000000000000 --- a/sys-devel/binutils-apple/files/ld64-127.2-extraneous-headers.patch +++ /dev/null @@ -1,12 +0,0 @@ -Remove unused header that doesn't exist on older OS Xes. - ---- ld64-127.2/src/ld/parsers/libunwind/AddressSpace.hpp.orig 2015-01-27 23:24:49.000000000 +0100 -+++ ld64-127.2/src/ld/parsers/libunwind/AddressSpace.hpp 2015-01-27 23:26:21.000000000 +0100 -@@ -37,7 +37,6 @@ - #include <mach-o/getsect.h> - #include <mach-o/dyld_priv.h> - #include <mach/i386/thread_status.h> --#include <Availability.h> - - #include "FileAbstraction.hpp" - #include "libunwind.h" diff --git a/sys-devel/binutils-apple/files/ld64-127.2-lto.patch b/sys-devel/binutils-apple/files/ld64-127.2-lto.patch deleted file mode 100644 index b9a3f14042c5..000000000000 --- a/sys-devel/binutils-apple/files/ld64-127.2-lto.patch +++ /dev/null @@ -1,214 +0,0 @@ ---- src/ld/InputFiles.cpp -+++ src/ld/InputFiles.cpp -@@ -58,7 +58,9 @@ - #include "macho_relocatable_file.h" - #include "macho_dylib_file.h" - #include "archive_file.h" -+#ifdef LTO - #include "lto_file.h" -+#endif - #include "opaque_section_file.h" - - -@@ -175,9 +177,11 @@ - if ( result != NULL ) - return result; - -+#ifdef LTO - result = lto::archName(p, len); - if ( result != NULL ) - return result; -+#endif - - if ( strncmp((const char*)p, "!<arch>\n", 8) == 0 ) - return "archive"; -@@ -264,10 +268,12 @@ - if ( objResult != NULL ) - return this->addObject(objResult, info, len); - -+#if LTO - // see if it is an llvm object file - objResult = lto::parse(p, len, info.path, info.modTime, _nextInputOrdinal, _options.architecture(), _options.subArchitecture(), _options.logAllFiles()); - if ( objResult != NULL ) - return this->addObject(objResult, info, len); -+#endif - - // see if it is a dynamic library - ld::dylib::File* dylibResult = mach_o::dylib::parse(p, len, info.path, info.modTime, _options, _nextInputOrdinal, info.options.fBundleLoader, indirectDylib); -@@ -291,6 +297,7 @@ - return this->addArchive(archiveResult, info, len); - } - -+#ifdef LTO - // does not seem to be any valid linker input file, check LTO misconfiguration problems - if ( lto::archName((uint8_t*)p, len) != NULL ) { - if ( lto::libLTOisLoaded() ) { -@@ -315,6 +322,7 @@ - throwf("could not process llvm bitcode object file, because %s could not be loaded", libLTO); - } - } -+#endif - - // error handling - if ( ((fat_header*)p)->magic == OSSwapBigToHostInt32(FAT_MAGIC) ) { ---- src/ld/Options.cpp -+++ src/ld/Options.cpp -@@ -36,10 +36,12 @@ - #include "Architectures.hpp" - #include "MachOFileAbstraction.hpp" - -+#ifdef LTO - // upward dependency on lto::version() - namespace lto { - extern const char* version(); - } -+#endif - - // magic to place command line in crash reports - const int crashreporterBufferSize = 2000; -@@ -2766,9 +2768,11 @@ - fprintf(stderr, "%s", ldVersionString); - // if only -v specified, exit cleanly - if ( argc == 2 ) { -+#ifdef LTO - const char* ltoVers = lto::version(); - if ( ltoVers != NULL ) - fprintf(stderr, "%s\n", ltoVers); -+#endif - exit(0); - } - } ---- src/ld/Resolver.cpp -+++ src/ld/Resolver.cpp -@@ -58,7 +58,9 @@ - #include "InputFiles.h" - #include "SymbolTable.h" - #include "Resolver.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - - - namespace ld { -@@ -1315,6 +1317,7 @@ - - void Resolver::linkTimeOptimize() - { -+#ifdef LTO - // only do work here if some llvm obj files where loaded - if ( ! _haveLLVMObjs ) - return; -@@ -1415,6 +1418,9 @@ - // check new code does not override some dylib - this->checkDylibSymbolCollisions(); - } -+#else -+ return; -+#endif - } - - ---- src/ld/ld.cpp -+++ src/ld/ld.cpp -@@ -83,7 +83,9 @@ - #include "parsers/archive_file.h" - #include "parsers/macho_relocatable_file.h" - #include "parsers/macho_dylib_file.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - #include "parsers/opaque_section_file.h" - - ---- src/ld/parsers/archive_file.cpp -+++ src/ld/parsers/archive_file.cpp -@@ -39,7 +39,9 @@ - #include "Architectures.hpp" - - #include "macho_relocatable_file.h" -+#ifdef LTO - #include "lto_file.h" -+#endif - #include "archive_file.h" - - -@@ -91,8 +93,10 @@ - private: - static bool validMachOFile(const uint8_t* fileContent, uint64_t fileLength, - const mach_o::relocatable::ParserOptions& opts); -+#ifdef LTO - static bool validLTOFile(const uint8_t* fileContent, uint64_t fileLength, - const mach_o::relocatable::ParserOptions& opts); -+#endif - static cpu_type_t architecture(); - - class Entry : ar_hdr -@@ -239,12 +243,13 @@ - return mach_o::relocatable::isObjectFile(fileContent, fileLength, opts); - } - -+#ifdef LTO - template <typename A> - bool File<A>::validLTOFile(const uint8_t* fileContent, uint64_t fileLength, const mach_o::relocatable::ParserOptions& opts) - { - return lto::isObjectFile(fileContent, fileLength, opts.architecture, opts.subType); - } -- -+#endif - - - template <typename A> -@@ -263,7 +268,11 @@ - if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) ) - continue; - // archive is valid if first .o file is valid -- return (validMachOFile(p->content(), p->contentSize(), opts) || validLTOFile(p->content(), p->contentSize(), opts)); -+ return (validMachOFile(p->content(), p->contentSize(), opts) -+#ifdef LTO -+ || validLTOFile(p->content(), p->contentSize(), opts) -+#endif -+ ); - } - // empty archive - return true; -@@ -363,6 +372,7 @@ - _instantiatedEntries[member] = state; - return _instantiatedEntries[member]; - } -+#ifdef LTO - // see if member is llvm bitcode file - result = lto::parse(member->content(), member->contentSize(), - mPath, member->modificationTime(), this->ordinal() + memberIndex, -@@ -372,6 +382,7 @@ - _instantiatedEntries[member] = state; - return _instantiatedEntries[member]; - } -+#endif - - throwf("archive member '%s' with length %d is not mach-o or llvm bitcode", memberName, member->contentSize()); - } ---- src/other/ObjectDump.cpp -+++ src/other/ObjectDump.cpp -@@ -33,7 +33,9 @@ - - #include "MachOFileAbstraction.hpp" - #include "parsers/macho_relocatable_file.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - - static bool sDumpContent= true; - static bool sDumpStabs = false; -@@ -1150,10 +1152,12 @@ - if ( objResult != NULL ) - return objResult; - -+#ifdef LTO - // see if it is an llvm object file - objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, 0, sPreferredArch, sPreferredSubArch, false); - if ( objResult != NULL ) - return objResult; -+#endif - - throwf("not a mach-o object file: %s", path); - #else diff --git a/sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch b/sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch deleted file mode 100644 index c9f850823939..000000000000 --- a/sys-devel/binutils-apple/files/ld64-127.2-ppc-range-warning.patch +++ /dev/null @@ -1,16 +0,0 @@ -Insipred by the comment here: -http://bugs.freepascal.org/view.php?id=20879 -It looks like the PPC case is missing, hence add this. Without, we get -linker errors for compiling packages like Python and TexLive. - ---- src/ld/OutputFile.cpp -+++ src/ld/OutputFile.cpp -@@ -807,7 +807,7 @@ - // is encoded in mach-o the same as: - // .long _foo + 0x40000000 - // so if _foo lays out to 0xC0000100, the first is ok, but the second is not. -- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) { -+ if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) || (_options.architecture() == CPU_TYPE_POWERPC) ) { - // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload - if ( _options.outputKind() != Options::kPreload ) { - warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", diff --git a/sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch b/sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch deleted file mode 100644 index e894bee0c8d0..000000000000 --- a/sys-devel/binutils-apple/files/ld64-127.2-thread_state.patch +++ /dev/null @@ -1,13 +0,0 @@ -Include thread_status.h so that __darwin_i386_thread_state_t is known and will -not generate warnings that it's declared inside parameter list. - ---- ld64-127.2/src/ld/HeaderAndLoadCommands.hpp.orig 2015-01-28 00:32:55.000000000 +0100 -+++ ld64-127.2/src/ld/HeaderAndLoadCommands.hpp 2015-01-28 00:27:51.000000000 +0100 -@@ -29,6 +29,7 @@ - #include <limits.h> - #include <unistd.h> - #include <mach-o/loader.h> -+#include <mach/i386/thread_status.h> - - #include <vector> - diff --git a/sys-devel/binutils-apple/files/ld64-128.2-1010.patch b/sys-devel/binutils-apple/files/ld64-128.2-1010.patch deleted file mode 100644 index dee69e7c858b..000000000000 --- a/sys-devel/binutils-apple/files/ld64-128.2-1010.patch +++ /dev/null @@ -1,20 +0,0 @@ -Backport (just a diff really) of OS X 10.10 handling from 241.9. - ---- ld64-128.2/src/ld/Options.cpp 2015-01-30 17:16:48.000000000 +0100 -+++ ld64-241.9/src/ld/Options.cpp 2015-01-30 17:11:57.000000000 +0100 -@@ -1241,7 +1348,14 @@ - throw "-macosx_version_min argument missing"; - - if ( (strncmp(version, "10.", 3) == 0) && isdigit(version[3]) ) { -- unsigned int minorVersion = version[3] - '0'; -+ unsigned int minorVersion = 0; -+ for (int i=3; isdigit(version[i]); ++i) { -+ minorVersion = minorVersion*10 + (version[i] - '0'); -+ } -+ if ( minorVersion > 255 ) { -+ warning("Mac OS X minor version > 255 in '%s'", version); -+ minorVersion = 255; -+ } - fMacVersionMin = (ld::MacVersionMin)(0x000A0000 | (minorVersion << 8)); - } - else { diff --git a/sys-devel/binutils-apple/files/ld64-128.2-Makefile b/sys-devel/binutils-apple/files/ld64-128.2-Makefile deleted file mode 100644 index b02c82459449..000000000000 --- a/sys-devel/binutils-apple/files/ld64-128.2-Makefile +++ /dev/null @@ -1,47 +0,0 @@ -CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. - -# dropped machocheck due to compilation failures -all: rebase unwinddump dyldinfo ld64 ObjectDump - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \ - ld/parsers/opaque_section_file.o \ - ld/parsers/macho_dylib_file.o \ - ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \ - ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \ - ld/passes/compact_unwind.o ld/passes/huge.o \ - ld/passes/dtrace_dof.o ld/passes/objc.o \ - ld/passes/stubs/stubs.o \ - ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \ - ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o - -ifeq ($(LTO),1) -CPPFLAGS += "-DLTO" -LTO_OBJ = ld/parsers/lto_file.o -LIBLTO = -lLTO -else -CPPFLAGS += "-ULTO" -LTO_OBJ = -LIBLTO = -endif - -ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-128.2-Makefile-2 b/sys-devel/binutils-apple/files/ld64-128.2-Makefile-2 deleted file mode 100644 index 1d48ae9eaaf4..000000000000 --- a/sys-devel/binutils-apple/files/ld64-128.2-Makefile-2 +++ /dev/null @@ -1,50 +0,0 @@ -CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. - -# some files generate warnings about applying offsetof to a non-POD type. -# Upstream seems aware of that and ignores by setting -# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project. -CXXFLAGS += -Wno-invalid-offsetof - -all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \ - ld/parsers/opaque_section_file.o \ - ld/parsers/macho_dylib_file.o \ - ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \ - ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \ - ld/passes/compact_unwind.o ld/passes/huge.o \ - ld/passes/dtrace_dof.o ld/passes/objc.o \ - ld/passes/stubs/stubs.o \ - ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \ - ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o - -ifeq ($(LTO),1) -CPPFLAGS += -DLTO -LTO_OBJ = ld/parsers/lto_file.o -LIBLTO = -lLTO -else -LTO_OBJ = -LIBLTO = -endif - -ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch b/sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch deleted file mode 100644 index 8bbcb46cf9c5..000000000000 --- a/sys-devel/binutils-apple/files/ld64-128.2-stdlib.patch +++ /dev/null @@ -1,14 +0,0 @@ -Patch by Linlin Yan <yanlinlin82@gmail.com> - -https://bugs.gentoo.org/show_bug.cgi?id=490932 - ---- ld64-128.2/src/other/rebase.cpp -+++ ld64-128.2/src/other/rebase.cpp -@@ -29,6 +29,7 @@ - #include <limits.h> - #include <stdarg.h> - #include <stdio.h> -+#include <stdlib.h> - #include <fcntl.h> - #include <errno.h> - #include <unistd.h> diff --git a/sys-devel/binutils-apple/files/ld64-136-Makefile b/sys-devel/binutils-apple/files/ld64-136-Makefile deleted file mode 100644 index 948c705503ae..000000000000 --- a/sys-devel/binutils-apple/files/ld64-136-Makefile +++ /dev/null @@ -1,48 +0,0 @@ -CPPFLAGS += "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. - -# dropped machocheck due to compilation failures -all: rebase unwinddump dyldinfo ld64 ObjectDump - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \ - ld/parsers/opaque_section_file.o \ - ld/parsers/macho_dylib_file.o \ - ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \ - ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \ - ld/passes/compact_unwind.o ld/passes/huge.o \ - ld/passes/dtrace_dof.o ld/passes/objc.o \ - ld/passes/stubs/stubs.o \ - ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \ - ld/Snapshot.o \ - ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o - -ifeq ($(LTO),1) -CPPFLAGS += "-DLTO" -LTO_OBJ = ld/parsers/lto_file.o -LIBLTO = -lLTO -else -CPPFLAGS += "-ULTO" -LTO_OBJ = -LIBLTO = -endif - -ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h b/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h deleted file mode 100644 index 8cd430adb9eb..000000000000 --- a/sys-devel/binutils-apple/files/ld64-136-compile_stubs.h +++ /dev/null @@ -1,53 +0,0 @@ -static const char *compile_stubs = -"#!/bin/csh\n" -"\n" -"# Attempt to find the architecture.\n" -"# First look through the command line args.\n" -"set arch=unknown\n" -"set link_cmd=(`cat link_command`)\n" -"while ( $#link_cmd > 0 )\n" -" if ( \"$link_cmd[1]\" == \"-arch\" ) then\n" -" set arch=$link_cmd[2]\n" -" endif\n" -" shift link_cmd\n" -"end\n" -"\n" -"# look for an explicit arch file\n" -"if ( \"$arch\" == \"unknown\" ) then\n" -" if ( -e arch ) then\n" -" set arch=`cat arch`\n" -" endif\n" -"endif\n" -"\n" -"if ( \"$arch\" == \"unknown\" ) then\n" -"echo \"***** Unable to determine architecture.\"\n" -"exit 1\n" -"endif \n" -"\n" -"# Create .dylibs for each file in the dylib_stubs directory.\n" -"if ( -e dylib_stubs ) then\n" -" set files=`cd dylib_stubs ; echo *`\n" -" mkdir -p dylibs\n" -" foreach file ($files)\n" -" if ( ! -e dylibs/$file ) then\n" -" clang -arch $arch -c -fno-builtin -o tmp_object.o -x c dylib_stubs/$file\n" -" ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o dylibs/$file tmp_object.o\n" -" endif\n" -" end\n" -"endif\n" -"\n" -"# Create .frameworks for each file in the framework_stubs directory.\n" -"if ( -e framework_stubs ) then\n" -" set files=`cd framework_stubs ; echo *`\n" -" foreach file ($files)\n" -" if ( ! -e frameworks/$file.framework ) then\n" -" clang -arch $arch -c -fno-builtin -o tmp_object.o -x c framework_stubs/$file\n" -" mkdir -p frameworks/$file.framework\n" -" ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o frameworks/$file.framework/$file tmp_object.o\n" -" endif\n" -" end\n" -"endif\n" -"\n" -"# Clean up.\n" -"rm -f tmp_object.o\n" -; diff --git a/sys-devel/binutils-apple/files/ld64-236.3-Makefile b/sys-devel/binutils-apple/files/ld64-236.3-Makefile deleted file mode 100644 index 1f35c8ff9f39..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-Makefile +++ /dev/null @@ -1,51 +0,0 @@ -CPPFLAGS += -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. - -# some files generate warnings about applying offsetof to a non-POD type. -# Upstream seems aware of that and ignores by setting -# GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO in the xcode project. -CXXFLAGS += -Wno-invalid-offsetof - -all: rebase unwinddump dyldinfo ld64 ObjectDump machocheck - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -LD64LIBS=ld/parsers/archive_file.o ld/parsers/macho_relocatable_file.o \ - ld/parsers/opaque_section_file.o \ - ld/parsers/macho_dylib_file.o \ - ld/passes/branch_island.o ld/passes/dylibs.o ld/passes/order.o \ - ld/passes/branch_shim.o ld/passes/got.o ld/passes/tlvp.o \ - ld/passes/compact_unwind.o ld/passes/huge.o \ - ld/passes/dtrace_dof.o ld/passes/objc.o \ - ld/passes/stubs/stubs.o \ - ld/InputFiles.o ld/OutputFile.o ld/SymbolTable.o \ - ld/Snapshot.o \ - ld/Options.o ld/Resolver.o ld/debugline.o ld/ld.o - -ifeq ($(LTO),1) -CPPFLAGS += -DLTO -LTO_OBJ = ld/parsers/lto_file.o -LIBLTO = -lLTO -else -LTO_OBJ = -LIBLTO = -endif - -ld64: libprunetrie.a version.o $(LD64LIBS) $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o ld/parsers/macho_relocatable_file.o $(LTO_OBJ) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBLTO) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch b/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch deleted file mode 100644 index b64e52906f4f..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-arm64-fixup.patch +++ /dev/null @@ -1,17 +0,0 @@ -Use correct enum values (backport from 241.9). - ---- ld64-236.3/src/other/ObjectDump.cpp.orig 2014-11-12 21:17:01.000000000 +0100 -+++ ld64-236.3/src/other/ObjectDump.cpp 2014-11-12 21:17:44.000000000 +0100 -@@ -995,10 +995,10 @@ - case ld::Fixup::kindStoreTargetAddressARM64PageOff12: - printf("ARM64 store 12-bit page offset of %s", referenceTargetAtomName(ref)); - break; -- case ld::Fixup::kindStoreTargetAddressARM64TLVPage21: -+ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadPage21: - printf("ARM64 store 21-bit pcrel ADRP to TLV for %s", referenceTargetAtomName(ref)); - break; -- case ld::Fixup::kindStoreTargetAddressARM64TLVPageOff12: -+ case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadPageOff12: - printf("ARM64 store 12-bit page offset of TLV of %s", referenceTargetAtomName(ref)); - break; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21: diff --git a/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch b/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch deleted file mode 100644 index c4c5e0d113c8..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-constant-types.patch +++ /dev/null @@ -1,61 +0,0 @@ -Avoid error with gcc on 32bit platforms: -ld/LinkEdit.hpp:1329: error: integer constant is too large for 'long' type - ---- ./ld64-236.3/src/ld/LinkEdit.hpp.orig 2015-01-14 18:00:49.000000000 +0100 -+++ ./ld64-236.3/src/ld/LinkEdit.hpp 2015-01-14 18:02:23.000000000 +0100 -@@ -1326,7 +1326,7 @@ - void FunctionStartsAtom<A>::encode() const - { - this->_encodedData.reserve(8192); -- const uint64_t badAddress = 0xFFFFFFFFFFFFFFFF; -+ const uint64_t badAddress = 0xFFFFFFFFFFFFFFFFULL; - uint64_t addr = badAddress; - // delta compress all function addresses - for (std::vector<ld::Internal::FinalSection*>::iterator it = this->_state.sections.begin(); it != this->_state.sections.end(); ++it) { ---- ./ld64-236.3/src/ld/Options.cpp.orig 2015-01-14 18:01:12.000000000 +0100 -+++ ./ld64-236.3/src/ld/Options.cpp 2015-01-14 18:02:09.000000000 +0100 -@@ -4173,7 +4173,7 @@ - switch (fArchitecture) { - case CPU_TYPE_I386: - case CPU_TYPE_ARM: -- if ( fStackAddr > 0xFFFFFFFF ) -+ if ( fStackAddr > 0xFFFFFFFFULL ) - throw "-stack_addr must be < 4G for 32-bit processes"; - break; - case CPU_TYPE_X86_64: -@@ -4193,29 +4193,29 @@ - if ( fStackSize > 0xFFFFFFFF ) - throw "-stack_size must be < 4G for 32-bit processes"; - if ( fStackAddr == 0 ) { -- fStackAddr = 0xC0000000; -+ fStackAddr = 0xC0000000ULL; - } -- if ( (fStackAddr > 0xB0000000) && ((fStackAddr-fStackSize) < 0xB0000000) ) -+ if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) ) - warning("custom stack placement overlaps and will disable shared region"); - break; - case CPU_TYPE_ARM: - if ( fStackSize > 0x2F000000 ) - throw "-stack_size must be < 752MB"; - if ( fStackAddr == 0 ) -- fStackAddr = 0x2F000000; -- if ( fStackAddr > 0x30000000) -+ fStackAddr = 0x2F000000ULL; -+ if ( fStackAddr > 0x30000000ULL) - throw "-stack_addr must be < 0x30000000 for arm"; - break; - case CPU_TYPE_X86_64: - if ( fStackAddr == 0 ) { -- fStackAddr = 0x00007FFF5C000000LL; -+ fStackAddr = 0x00007FFF5C000000ULL; - } - break; - case CPU_TYPE_ARM64: - if ( fStackSize > 0x20000000 ) - throw "-stack_size must be < 512MB"; - if ( fStackAddr == 0 ) { -- fStackAddr = 0x120000000; -+ fStackAddr = 0x120000000ULL; - } - break; - } diff --git a/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch b/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch deleted file mode 100644 index f8b42b459b6f..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-crashreporter.patch +++ /dev/null @@ -1,23 +0,0 @@ -Allow to disable crash reporter - -diff -ur ld64-236.3/src/ld/Options.cpp ld64-236.3/src/ld/Options.cpp ---- ld64-236.3/src/ld/Options.cpp 2014-08-29 16:40:18.000000000 +0200 -+++ ld64-236.3/src/ld/Options.cpp 2014-08-29 16:35:36.000000000 +0200 -@@ -54,7 +54,7 @@ - // magic to place command line in crash reports - const int crashreporterBufferSize = 2000; - static char crashreporterBuffer[crashreporterBufferSize]; --#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 -+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(SUPPORT_CRASHREPORTER) - #include <CrashReporterClient.h> - // hack until ld does not need to build on 10.6 anymore - struct crashreporter_annotations_t gCRAnnotations -@@ -4564,7 +4564,7 @@ - bool newLinker = false; - - // build command line buffer in case ld crashes --#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 -+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && defined(SUPPORT_CRASHREPORTER) - CRSetCrashLogMessage(crashreporterBuffer); - #endif - const char* srcRoot = getenv("SRCROOT"); diff --git a/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch b/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch deleted file mode 100644 index 1e1f578ca354..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-gcc.patch +++ /dev/null @@ -1,1038 +0,0 @@ -Provide c++11 headers from tr1 include directory and namespace. - -Work around weird namespacing bug in gcc-4.2.1 where class ld::Section -conflicts with template mach_o::relocatable::Section by renaming the latter to -MRFSection (could possibly be done using sed from ebuild or avoided by figuring -out, what's actually going on with those namespaces). - -diff -ur ld64-236.3.orig/src/ld/InputFiles.h ld64-236.3/src/ld/InputFiles.h ---- ld64-236.3.orig/src/ld/InputFiles.h 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/InputFiles.h 2015-01-11 22:43:08.000000000 +0100 -@@ -46,6 +46,14 @@ - #include <pthread.h> - #endif - -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else -+#include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif -+ - #include <vector> - - #include "Options.h" -@@ -107,7 +115,7 @@ - static void parseWorkerThread(InputFiles *inputFiles); - void startThread(void (*threadFunc)(InputFiles *)) const; - -- typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib; -+ typedef std::UNORDERED_MAP<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib; - - const Options& _options; - std::vector<ld::File*> _inputFiles; -diff -ur ld64-236.3.orig/src/ld/LinkEditClassic.hpp ld64-236.3/src/ld/LinkEditClassic.hpp ---- ld64-236.3.orig/src/ld/LinkEditClassic.hpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/LinkEditClassic.hpp 2015-01-11 22:44:04.000000000 +0100 -@@ -31,8 +31,13 @@ - #include <limits.h> - #include <unistd.h> - --#include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -92,7 +97,7 @@ - - private: - enum { kBufferSize = 0x01000000 }; -- typedef std::unordered_map<const char*, int32_t, CStringHash, CStringEquals> StringToOffset; -+ typedef std::UNORDERED_MAP<const char*, int32_t, CStringHash, CStringEquals> StringToOffset; - - const uint32_t _pointerSize; - std::vector<char*> _fullBuffers; -diff -ur ld64-236.3.orig/src/ld/Options.cpp ld64-236.3/src/ld/Options.cpp ---- ld64-236.3.orig/src/ld/Options.cpp 2015-01-11 17:35:08.000000000 +0100 -+++ ld64-236.3/src/ld/Options.cpp 2015-01-11 22:47:34.000000000 +0100 -@@ -4335,7 +4335,7 @@ - - // make sure all required exported symbols exist - std::vector<const char*> impliedExports; -- for (NameSet::iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) { -+ for (NameSet::const_iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) { - const char* name = *it; - const int len = strlen(name); - if ( (strcmp(&name[len-3], ".eh") == 0) || (strncmp(name, ".objc_category_name_", 20) == 0) ) { -@@ -4367,7 +4367,7 @@ - } - - // make sure all required re-exported symbols exist -- for (NameSet::iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) { -+ for (NameSet::const_iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) { - fInitialUndefines.push_back(*it); - } - -diff -ur ld64-236.3.orig/src/ld/Options.h ld64-236.3/src/ld/Options.h ---- ld64-236.3.orig/src/ld/Options.h 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/Options.h 2015-01-11 22:44:00.000000000 +0100 -@@ -30,8 +30,17 @@ - #include <mach/machine.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "ld.hpp" - #include "Snapshot.h" -@@ -376,8 +385,8 @@ - const std::vector<SectionRename>& sectionRenames() const { return fSectionRenames; } - - private: -- typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder; -- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet; -+ typedef std::UNORDERED_MAP<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder; -+ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> NameSet; - enum ExportMode { kExportDefault, kExportSome, kDontExportSome }; - enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives }; - enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome }; -@@ -389,8 +398,8 @@ - bool containsNonWildcard(const char*) const; - bool empty() const { return fRegular.empty() && fWildCard.empty(); } - bool hasWildCards() const { return !fWildCard.empty(); } -- NameSet::iterator regularBegin() const { return fRegular.begin(); } -- NameSet::iterator regularEnd() const { return fRegular.end(); } -+ NameSet::const_iterator regularBegin() const { return fRegular.begin(); } -+ NameSet::const_iterator regularEnd() const { return fRegular.end(); } - void remove(const NameSet&); - private: - static bool hasWildCards(const char*); -diff -ur ld64-236.3.orig/src/ld/OutputFile.cpp ld64-236.3/src/ld/OutputFile.cpp ---- ld64-236.3.orig/src/ld/OutputFile.cpp 2015-01-11 17:35:08.000000000 +0100 -+++ ld64-236.3/src/ld/OutputFile.cpp 2015-01-12 00:24:43.000000000 +0100 -@@ -50,7 +50,13 @@ - #include <vector> - #include <list> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include <CommonCrypto/CommonDigest.h> - #include <AvailabilityMacros.h> -@@ -4699,7 +4705,7 @@ - const char* filename = NULL; - bool wroteStartSO = false; - state.stabs.reserve(atomsNeedingDebugNotes.size()*4); -- std::unordered_set<const char*, CStringHash, CStringEquals> seenFiles; -+ std::UNORDERED_SET<const char*, CStringHash, CStringEquals> seenFiles; - for (std::vector<const ld::Atom*>::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) { - const ld::Atom* atom = *it; - const ld::File* atomFile = atom->file(); -diff -ur ld64-236.3.orig/src/ld/Resolver.h ld64-236.3/src/ld/Resolver.h ---- ld64-236.3.orig/src/ld/Resolver.h 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/Resolver.h 2015-01-11 22:49:14.000000000 +0100 -@@ -42,7 +42,13 @@ - #include <mach-o/dyld.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -103,7 +109,7 @@ - void doLinkerOption(const std::vector<const char*>& linkerOption, const char* fileName); - void dumpAtoms(); - -- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet; -+ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet; - - class NotLive { - public: -diff -ur ld64-236.3.orig/src/ld/SymbolTable.h ld64-236.3/src/ld/SymbolTable.h ---- ld64-236.3.orig/src/ld/SymbolTable.h 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/SymbolTable.h 2015-01-11 22:46:19.000000000 +0100 -@@ -42,7 +42,13 @@ - #include <mach-o/dyld.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -57,38 +63,38 @@ - typedef uint32_t IndirectBindingSlot; - - private: -- typedef std::unordered_map<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot; -+ typedef std::UNORDERED_MAP<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot; - - class ContentFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot; - - class ReferencesHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot; - - class CStringHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot; - - class UTF16StringHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot; - - typedef std::map<IndirectBindingSlot, const char*> SlotToName; -- typedef std::unordered_map<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap; -+ typedef std::UNORDERED_MAP<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap; - - typedef std::vector<const ld::Atom *> DuplicatedSymbolAtomList; - typedef std::map<const char *, DuplicatedSymbolAtomList * > DuplicateSymbols; -diff -ur ld64-236.3.orig/src/ld/ld.cpp ld64-236.3/src/ld/ld.cpp ---- ld64-236.3.orig/src/ld/ld.cpp 2015-01-11 17:35:08.000000000 +0100 -+++ ld64-236.3/src/ld/ld.cpp 2015-01-11 22:42:58.000000000 +0100 -@@ -54,7 +54,13 @@ - #include <vector> - #include <list> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - #include <cxxabi.h> - - #include "Options.h" -@@ -150,7 +156,7 @@ - struct SectionEquals { - bool operator()(const ld::Section* left, const ld::Section* right) const; - }; -- typedef std::unordered_map<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut; -+ typedef std::UNORDERED_MAP<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut; - - - SectionInToOut _sectionInToFinalMap; -diff -ur ld64-236.3.orig/src/ld/ld.hpp ld64-236.3/src/ld/ld.hpp ---- ld64-236.3.orig/src/ld/ld.hpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/ld.hpp 2015-01-11 22:42:46.000000000 +0100 -@@ -32,7 +32,13 @@ - #include <assert.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "configure.h" - -@@ -821,7 +827,7 @@ - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - --typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -+typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; - - class Internal - { -diff -ur ld64-236.3.orig/src/ld/parsers/archive_file.cpp ld64-236.3/src/ld/parsers/archive_file.cpp ---- ld64-236.3.orig/src/ld/parsers/archive_file.cpp 2015-01-11 17:35:08.000000000 +0100 -+++ ld64-236.3/src/ld/parsers/archive_file.cpp 2015-01-11 22:41:37.000000000 +0100 -@@ -33,7 +33,13 @@ - #include <set> - #include <map> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "MachOFileAbstraction.hpp" - #include "Architectures.hpp" -@@ -116,7 +122,7 @@ - struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint32_t index;}; - bool loadMember(MemberState& state, ld::File::AtomHandler& handler, const char *format, ...) const; - -- typedef std::unordered_map<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap; -+ typedef std::UNORDERED_MAP<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap; - - typedef typename A::P P; - typedef typename A::P::E E; -diff -ur ld64-236.3.orig/src/ld/parsers/lto_file.cpp ld64-236.3/src/ld/parsers/lto_file.cpp ---- ld64-236.3.orig/src/ld/parsers/lto_file.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/parsers/lto_file.cpp 2015-01-11 22:44:48.000000000 +0100 -@@ -33,8 +33,17 @@ - #include <pthread.h> - #include <mach-o/dyld.h> - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "MachOFileAbstraction.hpp" - #include "Architectures.hpp" -@@ -217,8 +226,8 @@ - static void ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t, const char*, void*); - #endif - -- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -- typedef std::unordered_map<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom; -+ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -+ typedef std::UNORDERED_MAP<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom; - - class AtomSyncer : public ld::File::AtomHandler { - public: -diff -ur ld64-236.3.orig/src/ld/parsers/macho_dylib_file.cpp ld64-236.3/src/ld/parsers/macho_dylib_file.cpp ---- ld64-236.3.orig/src/ld/parsers/macho_dylib_file.cpp 2015-01-11 17:35:08.000000000 +0100 -+++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-11 22:45:17.000000000 +0100 -@@ -34,8 +34,17 @@ - #include <vector> - #include <set> - #include <algorithm> --#include <unordered_map> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "Architectures.hpp" - #include "MachOFileAbstraction.hpp" -@@ -189,8 +198,8 @@ - }; - }; - struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; }; -- typedef std::unordered_map<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap; -- typedef std::unordered_set<const char*, CStringHash, ld::CStringEquals> NameSet; -+ typedef std::UNORDERED_MAP<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap; -+ typedef std::UNORDERED_SET<const char*, CStringHash, ld::CStringEquals> NameSet; - - struct Dependent { const char* path; File<A>* dylib; bool reExport; }; - -@@ -548,14 +557,18 @@ - if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u toc entries for %s\n", dynamicInfo->nextdefsym(), this->path()); - const macho_nlist<P>* start = &symbolTable[dynamicInfo->iextdefsym()]; - const macho_nlist<P>* end = &start[dynamicInfo->nextdefsym()]; -+#ifndef __GLIBCXX__ - _atoms.reserve(dynamicInfo->nextdefsym()); // set initial bucket count -+#endif - for (const macho_nlist<P>* sym=start; sym < end; ++sym) { - this->addSymbol(&strings[sym->n_strx()], (sym->n_desc() & N_WEAK_DEF) != 0, false, sym->n_value()); - } - } - else { - int32_t count = dynamicInfo->ntoc(); -+#ifndef __GLIBCXX__ - _atoms.reserve(count); // set initial bucket count -+#endif - if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u entries for %s\n", count, this->path()); - const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo->tocoff()); - for (int32_t i = 0; i < count; ++i) { -diff -ur ld64-236.3.orig/src/ld/parsers/macho_relocatable_file.cpp ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp ---- ld64-236.3.orig/src/ld/parsers/macho_relocatable_file.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp 2015-01-11 23:08:13.000000000 +0100 -@@ -62,7 +62,7 @@ - // forward reference - template <typename A> class Parser; - template <typename A> class Atom; --template <typename A> class Section; -+template <typename A> class MRFSection; - template <typename A> class CFISection; - template <typename A> class CUSection; - -@@ -100,14 +100,14 @@ - const uint8_t* fileContent() { return _fileContent; } - private: - friend class Atom<A>; -- friend class Section<A>; -+ friend class MRFSection<A>; - friend class Parser<A>; - friend class CFISection<A>::OAS; - - typedef typename A::P P; - - const uint8_t* _fileContent; -- Section<A>** _sectionsArray; -+ MRFSection<A>** _sectionsArray; - uint8_t* _atomsArray; - uint32_t _sectionsArrayCount; - uint32_t _atomsArrayCount; -@@ -129,14 +129,14 @@ - - - template <typename A> --class Section : public ld::Section -+class MRFSection : public ld::Section - { - public: - typedef typename A::P::uint_t pint_t; - typedef typename A::P P; - typedef typename A::P::E E; - -- virtual ~Section() { } -+ virtual ~MRFSection() { } - class File<A>& file() const { return _file; } - const macho_section<P>* machoSection() const { return _machOSection; } - uint32_t sectionNum(class Parser<A>&) const; -@@ -160,10 +160,10 @@ - static const char* makeSectionName(const macho_section<typename A::P>* s); - - protected: -- Section(File<A>& f, const macho_section<typename A::P>* s) -+ MRFSection(File<A>& f, const macho_section<typename A::P>* s) - : ld::Section(makeSegmentName(s), makeSectionName(s), sectionType(s)), - _file(f), _machOSection(s), _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { } -- Section(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false) -+ MRFSection(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false) - : ld::Section(segName, sectName, t, hidden), _file(f), _machOSection(NULL), - _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { } - -@@ -186,11 +186,11 @@ - - - template <typename A> --class CFISection : public Section<A> -+class CFISection : public MRFSection<A> - { - public: - CFISection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - uint32_t cfiCount(); - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeCFI; } -@@ -250,11 +250,11 @@ - - - template <typename A> --class CUSection : public Section<A> -+class CUSection : public MRFSection<A> - { - public: - CUSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - - typedef typename A::P::uint_t pint_t; - typedef typename A::P P; -@@ -291,11 +291,11 @@ - - - template <typename A> --class TentativeDefinitionSection : public Section<A> -+class TentativeDefinitionSection : public MRFSection<A> - { - public: - TentativeDefinitionSection(Parser<A>& parser, File<A>& f) -- : Section<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {} -+ : MRFSection<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {} - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeZeroFill; } - virtual bool addFollowOnFixups() const { return false; } -@@ -313,11 +313,11 @@ - - - template <typename A> --class AbsoluteSymbolSection : public Section<A> -+class AbsoluteSymbolSection : public MRFSection<A> - { - public: - AbsoluteSymbolSection(Parser<A>& parser, File<A>& f) -- : Section<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {} -+ : MRFSection<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {} - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeUnclassified; } - virtual bool dontDeadStrip() { return false; } -@@ -339,7 +339,7 @@ - - - template <typename A> --class SymboledSection : public Section<A> -+class SymboledSection : public MRFSection<A> - { - public: - SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s); -@@ -371,11 +371,11 @@ - - - template <typename A> --class ImplicitSizeSection : public Section<A> -+class ImplicitSizeSection : public MRFSection<A> - { - public: - ImplicitSizeSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - virtual uint32_t computeAtomCount(class Parser<A>& parser, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&); - virtual uint32_t appendAtoms(class Parser<A>& parser, uint8_t* buffer, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&); - protected: -@@ -709,8 +709,8 @@ - - public: - // methods for all atoms from mach-o object file -- Section<A>& sect() const { return (Section<A>&)section(); } -- File<A>& machofile() const { return ((Section<A>*)(this->_section))->file(); } -+ MRFSection<A>& sect() const { return (MRFSection<A>&)section(); } -+ File<A>& machofile() const { return ((MRFSection<A>*)(this->_section))->file(); } - void setFixupsRange(uint32_t s, uint32_t c); - void setUnwindInfoRange(uint32_t s, uint32_t c); - void extendUnwindInfoRange(); -@@ -727,7 +727,7 @@ - typedef typename A::P::E E; - typedef typename A::P::uint_t pint_t; - // constuct via all attributes -- Atom(Section<A>& sct, const char* nm, pint_t addr, uint64_t sz, -+ Atom(MRFSection<A>& sct, const char* nm, pint_t addr, uint64_t sz, - ld::Atom::Definition d, ld::Atom::Combine c, ld::Atom::Scope s, - ld::Atom::ContentType ct, ld::Atom::SymbolTableInclusion i, - bool dds, bool thumb, bool al, ld::Atom::Alignment a) -@@ -737,7 +737,7 @@ - _unwindInfoStartIndex(0), _fixupsCount(0), - _lineInfoCount(0), _unwindInfoCount(0) { } - // construct via symbol table entry -- Atom(Section<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym, -+ Atom(MRFSection<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym, - uint64_t sz, bool alias=false) - : ld::Atom((ld::Section&)sct, parser.definitionFromSymbol(sym), - parser.combineFromSymbol(sym), parser.scopeFromSymbol(sym), -@@ -760,7 +760,7 @@ - - private: - friend class Parser<A>; -- friend class Section<A>; -+ friend class MRFSection<A>; - friend class CStringSection<A>; - friend class AbsoluteSymbolSection<A>; - -@@ -991,8 +991,8 @@ - uint32_t undefinedStartIndex() { return _undefinedStartIndex; } - uint32_t undefinedEndIndex() { return _undefinedEndIndex; } - void addFixup(FixupInAtom f) { _allFixups.push_back(f); } -- Section<A>* sectionForNum(unsigned int sectNum); -- Section<A>* sectionForAddress(pint_t addr); -+ MRFSection<A>* sectionForNum(unsigned int sectNum); -+ MRFSection<A>* sectionForAddress(pint_t addr); - Atom<A>* findAtomByAddress(pint_t addr); - Atom<A>* findAtomByAddressOrNullIfStub(pint_t addr); - Atom<A>* findAtomByAddressOrLocalTargetOfStub(pint_t addr, uint32_t* offsetInAtom); -@@ -1034,7 +1034,7 @@ - : sortedSymbolIndexes(ssa), sortedSymbolCount(ssc), cfiStartsArray(cfisa), - cfiStartsCount(cfisc), fileHasOverlappingSymbols(ols), - newSection(false), cfiIndex(0), symIndex(0) {} -- bool next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, -+ bool next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, - pint_t* addr, pint_t* size, const macho_nlist<P>** sym); - pint_t peek(Parser<A>& parser, pint_t startAddr, pint_t endAddr); - void beginSection() { newSection = true; symIndex = 0; } -@@ -1063,7 +1063,7 @@ - - - private: -- friend class Section<A>; -+ friend class MRFSection<A>; - - enum SectionType { sectionTypeIgnore, sectionTypeLiteral4, sectionTypeLiteral8, sectionTypeLiteral16, - sectionTypeNonLazy, sectionTypeCFI, sectionTypeCString, sectionTypeCStringPointer, -@@ -1404,7 +1404,7 @@ - // was becuase of a label, the symbol). Returns false when no more chunks. - // - template <typename A> --bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, -+bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, - pint_t* addr, pint_t* size, const macho_nlist<P>** symbol) - { - // may not be a label on start of section, but need atom demarcation there -@@ -1590,7 +1590,7 @@ - uint32_t sortedSymbolIndexes[_symbolsInSections]; - this->makeSortedSymbolsArray(sortedSymbolIndexes, sortedSectionIndexes); - -- // allocate Section<A> object for each mach-o section -+ // allocate MRFSection<A> object for each mach-o section - makeSections(); - - // if it exists, do special early parsing of __compact_unwind section -@@ -1687,7 +1687,7 @@ - #endif - } - -- Section<A>** sections = _file->_sectionsArray; -+ MRFSection<A>** sections = _file->_sectionsArray; - uint32_t sectionsCount = _file->_sectionsArrayCount; - - // figure out how many atoms will be allocated and allocate -@@ -2208,11 +2208,11 @@ - _file->_objConstraint = ld::File::objcConstraintRetainRelease; - if ( sect->size() > 8 ) { - warning("section %s/%s has unexpectedly large size %llu in %s", -- sect->segname(), Section<A>::makeSectionName(sect), sect->size(), _file->path()); -+ sect->segname(), MRFSection<A>::makeSectionName(sect), sect->size(), _file->path()); - } - } - else { -- warning("can't parse %s/%s section in %s", sect->segname(), Section<A>::makeSectionName(sect), _file->path()); -+ warning("can't parse %s/%s section in %s", sect->segname(), MRFSection<A>::makeSectionName(sect), _file->path()); - } - continue; - } -@@ -2308,24 +2308,24 @@ - // sort by address (mach-o object files don't aways have sections sorted) - ::qsort(machOSects, count, sizeof(MachOSectionAndSectionClass<P>), MachOSectionAndSectionClass<P>::sorter); - -- // we will synthesize a dummy Section<A> object for tentative definitions -+ // we will synthesize a dummy MRFSection<A> object for tentative definitions - if ( _tentativeDefinitionCount > 0 ) { - totalSectionsSize += sizeof(TentativeDefinitionSection<A>); - machOSects[count++].type = sectionTypeTentativeDefinitions; - } - -- // we will synthesize a dummy Section<A> object for Absolute symbols -+ // we will synthesize a dummy MRFSection<A> object for Absolute symbols - if ( _absoluteSymbolCount > 0 ) { - totalSectionsSize += sizeof(AbsoluteSymbolSection<A>); - machOSects[count++].type = sectionTypeAbsoluteSymbols; - } - - // allocate one block for all Section objects as well as pointers to each -- uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(Section<A>*)]; -- _file->_sectionsArray = (Section<A>**)space; -+ uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(MRFSection<A>*)]; -+ _file->_sectionsArray = (MRFSection<A>**)space; - _file->_sectionsArrayCount = count; -- Section<A>** objects = _file->_sectionsArray; -- space += count*sizeof(Section<A>*); -+ MRFSection<A>** objects = _file->_sectionsArray; -+ space += count*sizeof(MRFSection<A>*); - for (uint32_t i=0; i < count; ++i) { - switch ( machOSects[i].type ) { - case sectionTypeIgnore: -@@ -2413,7 +2413,7 @@ - - - template <typename A> --Section<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr) -+MRFSection<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr) - { - for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) { - const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection(); -@@ -2440,7 +2440,7 @@ - } - - template <typename A> --Section<A>* Parser<A>::sectionForNum(unsigned int num) -+MRFSection<A>* Parser<A>::sectionForNum(unsigned int num) - { - for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) { - const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection(); -@@ -2456,7 +2456,7 @@ - template <typename A> - Atom<A>* Parser<A>::findAtomByAddress(pint_t addr) - { -- Section<A>* section = this->sectionForAddress(addr); -+ MRFSection<A>* section = this->sectionForAddress(addr); - return section->findAtomByAddress(addr); - } - -@@ -2513,7 +2513,7 @@ - target.addend = 0; - return; - } -- Section<A>* section = this->sectionForAddress(addr); -+ MRFSection<A>* section = this->sectionForAddress(addr); - target.atom = section->findAtomByAddress(addr); - target.addend = addr - target.atom->_objAddress; - target.weakImport = false; -@@ -2561,7 +2561,7 @@ - } - return; - } -- Section<A>* section = this->sectionForNum(sectNum); -+ MRFSection<A>* section = this->sectionForNum(sectNum); - target.atom = section->findAtomByAddress(addr); - if ( target.atom == NULL ) { - typedef typename A::P::sint_t sint_t; -@@ -3723,7 +3723,7 @@ - } - - template <typename A> --const char* Section<A>::makeSegmentName(const macho_section<typename A::P>* sect) -+const char* MRFSection<A>::makeSegmentName(const macho_section<typename A::P>* sect) - { - // mach-o section record only has room for 16-byte seg/sect names - // so a 16-byte name has no trailing zero -@@ -3736,7 +3736,7 @@ - } - - template <typename A> --const char* Section<A>::makeSectionName(const macho_section<typename A::P>* sect) -+const char* MRFSection<A>::makeSectionName(const macho_section<typename A::P>* sect) - { - const char* name = sect->sectname(); - if ( strlen(name) < 16 ) -@@ -3770,13 +3770,13 @@ - } - - template <typename A> --bool Section<A>::readable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::readable(const macho_section<typename A::P>* sect) - { - return true; - } - - template <typename A> --bool Section<A>::writable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::writable(const macho_section<typename A::P>* sect) - { - // mach-o .o files do not contain segment permissions - // we just know TEXT is special -@@ -3784,7 +3784,7 @@ - } - - template <typename A> --bool Section<A>::exectuable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::exectuable(const macho_section<typename A::P>* sect) - { - // mach-o .o files do not contain segment permissions - // we just know TEXT is special -@@ -3793,7 +3793,7 @@ - - - template <typename A> --ld::Section::Type Section<A>::sectionType(const macho_section<typename A::P>* sect) -+ld::Section::Type MRFSection<A>::sectionType(const macho_section<typename A::P>* sect) - { - switch ( sect->flags() & SECTION_TYPE ) { - case S_ZEROFILL: -@@ -3871,7 +3871,7 @@ - - - template <typename A> --Atom<A>* Section<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end) -+Atom<A>* MRFSection<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end) - { - // do a binary search of atom array - uint32_t atomCount = end - start; -@@ -3903,7 +3903,7 @@ - } - - template <typename A> --ld::Atom::Alignment Section<A>::alignmentForAddress(pint_t addr) -+ld::Atom::Alignment MRFSection<A>::alignmentForAddress(pint_t addr) - { - const uint32_t sectionAlignment = this->_machOSection->align(); - uint32_t modulus = (addr % (1 << sectionAlignment)); -@@ -3913,7 +3913,7 @@ - } - - template <typename A> --uint32_t Section<A>::sectionNum(class Parser<A>& parser) const -+uint32_t MRFSection<A>::sectionNum(class Parser<A>& parser) const - { - if ( _machOSection == NULL ) - return 0; -@@ -4481,7 +4481,7 @@ - else { - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t personalityAddr = *content; -- Section<x86_64>* personalitySection = parser.sectionForAddress(personalityAddr); -+ MRFSection<x86_64>* personalitySection = parser.sectionForAddress(personalityAddr); - assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function"); - // atoms may not be constructed yet, so scan symbol table for labels - const char* name = parser.scanSymbolTableForAddress(personalityAddr); -@@ -4501,7 +4501,7 @@ - // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t nlPointerAddr = *content; -- Section<x86>* nlSection = parser.sectionForAddress(nlPointerAddr); -+ MRFSection<x86>* nlSection = parser.sectionForAddress(nlPointerAddr); - if ( nlSection->type() == ld::Section::typeCode ) { - // personality function is defined in this .o file, so this is a direct reference to it - // atoms may not be constructed yet, so scan symbol table for labels -@@ -4528,7 +4528,7 @@ - else { - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t personalityAddr = *content; -- Section<arm64>* personalitySection = parser.sectionForAddress(personalityAddr); -+ MRFSection<arm64>* personalitySection = parser.sectionForAddress(personalityAddr); - assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function"); - // atoms may not be constructed yet, so scan symbol table for labels - const char* name = parser.scanSymbolTableForAddress(personalityAddr); -@@ -4681,7 +4681,7 @@ - - template <typename A> - SymboledSection<A>::SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s), _type(ld::Atom::typeUnclassified) -+ : MRFSection<A>(f, s), _type(ld::Atom::typeUnclassified) - { - switch ( s->flags() & SECTION_TYPE ) { - case S_ZEROFILL: -@@ -4727,7 +4727,7 @@ - if ( ! this->_file.canScatterAtoms() ) - return true; - // call inherited -- return Section<A>::dontDeadStrip(); -+ return MRFSection<A>::dontDeadStrip(); - } - return false; - } -@@ -5572,7 +5572,7 @@ - - - template <> --uint32_t Section<x86_64>::x86_64PcRelOffset(uint8_t r_type) -+uint32_t MRFSection<x86_64>::x86_64PcRelOffset(uint8_t r_type) - { - switch ( r_type ) { - case X86_64_RELOC_SIGNED: -@@ -5589,7 +5589,7 @@ - - - template <> --bool Section<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - uint64_t srcAddr = sect->addr() + reloc->r_address(); -@@ -5796,7 +5796,7 @@ - - - template <> --bool Section<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - uint32_t srcAddr; -@@ -6037,7 +6037,7 @@ - - #if SUPPORT_ARCH_arm_any - template <> --bool Section<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - bool result = false; -@@ -6495,7 +6495,7 @@ - - #if SUPPORT_ARCH_arm64 - template <> --bool Section<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc) - { - bool result = false; - Parser<arm64>::SourceLocation src; -@@ -6893,7 +6893,7 @@ - - #if SUPPORT_ARCH_arm64 - template <> --void Section<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) { -+void MRFSection<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) { - switch (kind) { - case LOH_ARM64_ADRP_ADRP: - case LOH_ARM64_ADRP_LDR: -@@ -6948,18 +6948,18 @@ - extra.info.delta2 = (count > 1) ? ((addrs[1] - lowestAddress) >> 2) : 0; - extra.info.delta3 = (count > 2) ? ((addrs[2] - lowestAddress) >> 2) : 0; - extra.info.delta4 = (count > 3) ? ((addrs[3] - lowestAddress) >> 2) : 0; -- typename Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress()); -+ Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress()); - parser.addFixup(src, ld::Fixup::k1of1, ld::Fixup::kindLinkerOptimizationHint, extra.addend); - } - #endif - - template <typename A> --void Section<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) { -+void MRFSection<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) { - - } - - template <typename A> --void Section<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&) -+void MRFSection<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&) - { - const macho_section<P>* sect = this->machoSection(); - const macho_relocation_info<P>* relocs = (macho_relocation_info<P>*)(file().fileContent() + sect->reloff()); -@@ -6970,7 +6970,7 @@ - ++r; // skip next - } - catch (const char* msg) { -- throwf("in section %s,%s reloc %u: %s", sect->segname(), Section<A>::makeSectionName(sect), r, msg); -+ throwf("in section %s,%s reloc %u: %s", sect->segname(), MRFSection<A>::makeSectionName(sect), r, msg); - } - } - -diff -ur ld64-236.3.orig/src/ld/passes/dtrace_dof.cpp ld64-236.3/src/ld/passes/dtrace_dof.cpp ---- ld64-236.3.orig/src/ld/passes/dtrace_dof.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/passes/dtrace_dof.cpp 2015-01-12 00:27:58.000000000 +0100 -@@ -30,8 +30,17 @@ - - #include <vector> - #include <map> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#include <tr1/unordered_set> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_map> - #include <unordered_set> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "ld.hpp" - #include "MachOFileAbstraction.hpp" -@@ -111,8 +120,8 @@ - uint32_t offset; - const char* probeName; - }; --typedef std::unordered_map<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes; --typedef std::unordered_set<const char*, CStringHash, CStringEquals> CStringSet; -+typedef std::UNORDERED_MAP<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes; -+typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> CStringSet; - - - -diff -ur ld64-236.3.orig/src/ld/passes/order.cpp ld64-236.3/src/ld/passes/order.cpp ---- ld64-236.3.orig/src/ld/passes/order.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/ld/passes/order.cpp 2015-01-11 22:45:57.000000000 +0100 -@@ -32,7 +32,13 @@ - #include <vector> - #include <map> - #include <set> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "ld.hpp" - #include "order.h" -@@ -84,7 +90,7 @@ - const Layout& _layout; - }; - -- typedef std::unordered_map<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom; -+ typedef std::UNORDERED_MAP<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom; - - typedef std::map<const ld::Atom*, const ld::Atom*> AtomToAtom; - -diff -ur ld64-236.3.orig/src/other/dyldinfo.cpp ld64-236.3/src/other/dyldinfo.cpp ---- ld64-236.3.orig/src/other/dyldinfo.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/other/dyldinfo.cpp 2015-01-12 00:27:33.000000000 +0100 -@@ -33,7 +33,6 @@ - - #include <vector> - #include <set> --#include <unordered_set> - - #include "configure.h" - #include "MachOFileAbstraction.hpp" -diff -ur ld64-236.3.orig/src/other/machochecker.cpp ld64-236.3/src/other/machochecker.cpp ---- ld64-236.3.orig/src/other/machochecker.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/other/machochecker.cpp 2015-01-11 22:46:37.000000000 +0100 -@@ -33,7 +33,13 @@ - - #include <vector> - #include <set> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "configure.h" - -@@ -124,7 +130,7 @@ - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - -- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet; -+ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet; - - MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path); - void checkMachHeader(); -diff -ur ld64-236.3.orig/src/other/unwinddump.cpp ld64-236.3/src/other/unwinddump.cpp ---- ld64-236.3.orig/src/other/unwinddump.cpp 2014-04-05 00:42:29.000000000 +0200 -+++ ld64-236.3/src/other/unwinddump.cpp 2015-01-11 23:58:00.000000000 +0100 -@@ -33,7 +33,6 @@ - - #include <vector> - #include <set> --#include <unordered_set> - - #include "configure.h" - #include "MachOFileAbstraction.hpp" diff --git a/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch b/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch deleted file mode 100644 index 29b50f628122..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-missing-cputypes.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ld64-236.3/src/include/mach/machine.h.orig 2015-01-24 13:22:36.000000000 +0100 -+++ ld64-236.3/src/include/mach/machine.h 2015-01-24 13:22:51.000000000 +0100 -@@ -233,6 +233,7 @@ - */ - - #define CPU_SUBTYPE_I386_ALL ((cpu_subtype_t) 3) -+#define CPU_SUBTYPE_X86_ALL CPU_SUBTYPE_I386_ALL - #define CPU_SUBTYPE_X86_64_ALL CPU_SUBTYPE_I386_ALL - #define CPU_SUBTYPE_386 ((cpu_subtype_t) 3) - #define CPU_SUBTYPE_486 ((cpu_subtype_t) 4) diff --git a/sys-devel/binutils-apple/files/ld64-236.3-noarm.patch b/sys-devel/binutils-apple/files/ld64-236.3-noarm.patch deleted file mode 100644 index 5a235ec85e32..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-noarm.patch +++ /dev/null @@ -1,1236 +0,0 @@ -Fully conditionalise arm support so it can be disabled on 10.4. - ---- ld64-236.3/src/ld/HeaderAndLoadCommands.hpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/HeaderAndLoadCommands.hpp 2015-01-23 06:56:04.000000000 +0100 -@@ -605,8 +605,12 @@ - - template <> uint32_t HeaderAndLoadCommandsAtom<x86>::cpuType() const { return CPU_TYPE_I386; } - template <> uint32_t HeaderAndLoadCommandsAtom<x86_64>::cpuType() const { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> uint32_t HeaderAndLoadCommandsAtom<arm>::cpuType() const { return CPU_TYPE_ARM; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuType() const { return CPU_TYPE_ARM64; } -+#endif - - - -@@ -625,17 +629,21 @@ - return _state.cpuSubType; - } - -+#if SUPPORT_ARCH_arm_any - template <> - uint32_t HeaderAndLoadCommandsAtom<arm>::cpuSubType() const - { - return _state.cpuSubType; - } -+#endif - -+#if SUPPORT_ARCH_arm64 - template <> - uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuSubType() const - { - return CPU_SUBTYPE_ARM64_ALL; - } -+#endif - - - ---- ld64-236.3/src/ld/LinkEdit.hpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/LinkEdit.hpp 2015-01-23 06:56:04.000000000 +0100 -@@ -1595,6 +1595,7 @@ - for (ld::Fixup::iterator fit = atom->fixupsBegin(); fit != atom->fixupsEnd(); ++fit) { - if ( fit->kind != ld::Fixup::kindLinkerOptimizationHint) - continue; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 extra; - extra.addend = fit->u.addend; - _encodedData.append_uleb128(extra.info.kind); -@@ -1606,6 +1607,7 @@ - _encodedData.append_uleb128((extra.info.delta3 << 2) + fit->offsetInAtom + address); - if ( extra.info.count > 2 ) - _encodedData.append_uleb128((extra.info.delta4 << 2) + fit->offsetInAtom + address); -+#endif - } - } - } ---- ld64-236.3/src/ld/Options.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/Options.cpp 2015-01-23 07:05:43.000000000 +0100 -@@ -567,8 +567,13 @@ - #endif - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif -+#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64 - if ( (fMacVersionMin == ld::macVersionUnset) && (fIOSVersionMin == ld::iOSVersionUnset) && (fOutputKind != Options::kObjectFile) ) { - #if defined(DEFAULT_IPHONEOS_MIN_VERSION) - warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION); -@@ -579,6 +584,7 @@ - #endif - } - break; -+#endif - } - #ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordArch(fArchitectureName); -@@ -1649,9 +1655,11 @@ - symbolStart = NULL; - } - else if ( strncmp(symbolStart, "arm:", 4) == 0 ) { -+#if SUPPORT_ARCH_arm_any - if ( fArchitecture == CPU_TYPE_ARM ) - symbolStart = &symbolStart[4]; - else -+#endif - symbolStart = NULL; - } - if ( symbolStart != NULL ) { -@@ -3483,6 +3491,7 @@ - #endif - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) { - #if defined(DEFAULT_IPHONEOS_MIN_VERSION) -@@ -3494,6 +3503,7 @@ - #endif - } - break; -+#endif - default: - // architecture will be infered later by examining .o files - break; -@@ -3516,12 +3526,14 @@ - fMacVersionMin = ld::mac10_4; - } - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - if ( fIOSVersionMin < ld::iOS_7_0 ) { - //warning("-mios_version_min should be 7.0 or later for arm64"); - fIOSVersionMin = ld::iOS_7_0; - } - break; -+#endif - } - - // default to adding functions start for dynamic code, static code must opt-in -@@ -3561,6 +3573,7 @@ - fAllowTextRelocs = true; - fUndefinedTreatment = kUndefinedDynamicLookup; - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - // arm64 uses new MH_KEXT_BUNDLE type - fMakeCompressedDyldInfo = false; -@@ -3569,6 +3582,8 @@ - fKextsUseStubs = true; - fUndefinedTreatment = kUndefinedDynamicLookup; - break; -+#endif -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fIOSVersionMin >= ld::iOS_5_0 ) { - // iOS 5.0 and later use new MH_KEXT_BUNDLE type -@@ -3580,6 +3595,7 @@ - fUndefinedTreatment = kUndefinedDynamicLookup; - break; - } -+#endif - // else use object file - case CPU_TYPE_I386: - // use .o files -@@ -3632,6 +3648,7 @@ - if ( fSplitSegs && (fBaseWritableAddress-fBaseAddress != 0x10000000) ) - fBaseWritableAddress = fBaseAddress + 0x10000000; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fOutputKind != Options::kDynamicLibrary ) { - fSplitSegs = false; -@@ -3642,6 +3659,7 @@ - fBaseWritableAddress = fBaseAddress + 0x08000000; - } - break; -+#endif - default: - fSplitSegs = false; - fBaseAddress = 0; -@@ -3656,6 +3674,7 @@ - break; - case CPU_TYPE_X86_64: - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - switch ( fOutputKind ) { - case Options::kDynamicExecutable: -@@ -3678,6 +3697,7 @@ - fBaseAddress = 0; - } - break; -+#endif - } - - // <rdar://problem/6138961> -r implies no prebinding for all architectures -@@ -3723,6 +3743,7 @@ - case CPU_TYPE_X86_64: - fPrebind = false; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - switch ( fOutputKind ) { - case Options::kDynamicExecutable: -@@ -3740,6 +3761,7 @@ - break; - } - break; -+#endif - } - } - -@@ -3766,10 +3788,12 @@ - case CPU_TYPE_I386: - if ( fIOSVersionMin != ld::iOSVersionUnset ) // simulator never needs modules - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fPrebind ) - fNeedsModuleTable = true; // redo_prebinding requires a module table - break; -+#endif - } - } - -@@ -3993,7 +3993,9 @@ - switch ( fArchitecture ) { - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - switch ( fOutputKind ) { - case Options::kObjectFile: - case Options::kStaticExecutable: -@@ -4010,10 +4012,12 @@ - break; - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - fAddCompactUnwindEncoding = false; - fRemoveDwarfUnwindIfCompactExists = false; - break; -+#endif - case 0: - // if -arch is missing, assume we don't want compact unwind info - fAddCompactUnwindEncoding = false; -@@ -3815,7 +3843,15 @@ - // only iOS main executables should be encrypted - if ( fOutputKind != Options::kDynamicExecutable ) - fEncryptable = false; -- if ( (fArchitecture != CPU_TYPE_ARM) && (fArchitecture != CPU_TYPE_ARM64) ) -+ if ( -+#if SUPPORT_ARCH_arm_any -+ (fArchitecture != CPU_TYPE_ARM) && -+#endif -+#if SUPPORT_ARCH_arm64 -+ (fArchitecture != CPU_TYPE_ARM64) && -+#endif -+ 1 -+ ) - fEncryptable = false; - - // don't move inits in dyld because dyld wants certain -@@ -3867,11 +3903,15 @@ - - // only ARM and x86_64 enforces that cpu-sub-types must match - switch ( fArchitecture ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - case CPU_TYPE_X86_64: - break; - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - fAllowCpuSubtypeMismatches = true; - break; - } -@@ -3917,6 +3957,7 @@ - fPositionIndependentExecutable = true; - } - -+#if SUPPORT_ARCH_arm_any - // armv7 for iOS4.3 defaults to PIE - if ( (fArchitecture == CPU_TYPE_ARM) - && fArchSupportsThumb2 -@@ -3924,15 +3965,18 @@ - && (fIOSVersionMin >= ld::iOS_4_3) ) { - fPositionIndependentExecutable = true; - } -+#endif - - // -no_pie anywhere on command line disable PIE - if ( fDisablePositionIndependentExecutable ) - fPositionIndependentExecutable = false; - -+#if SUPPORT_ARCH_arm64 - // arm64 is always PIE - if ( (fArchitecture == CPU_TYPE_ARM64) && (fOutputKind == kDynamicExecutable) ) { - fPositionIndependentExecutable = true; - } -+#endif - - // set fOutputSlidable - switch ( fOutputKind ) { -@@ -3958,9 +4002,11 @@ - if ( fMacVersionMin >= ld::mac10_7 ) { - fTLVSupport = true; - } -+#if SUPPORT_ARCH_arm64 - else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= 0x00080000) ) { - fTLVSupport = true; - } -+#endif - - // default to adding version load command for dynamic code, static code must opt-in - switch ( fOutputKind ) { -@@ -4149,6 +4195,7 @@ - } - - // <rdar://problem/12258065> ARM64 needs 16KB page size for user land code -+#if SUPPORT_ARCH_arm64 - if ( fArchitecture == CPU_TYPE_ARM64 ) { - if ( fSegmentAlignment == 4096 ) { - switch ( fOutputKind ) { -@@ -4166,6 +4213,7 @@ - } - } - } -+#endif - - // <rdar://problem/13624134> linker should not convert dwarf unwind if .o file has compact unwind section - switch ( fOutputKind ) { -@@ -4267,12 +4315,16 @@ - if ( fStackAddr != 0 ) { - switch (fArchitecture) { - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - if ( fStackAddr > 0xFFFFFFFFULL ) - throw "-stack_addr must be < 4G for 32-bit processes"; - break; - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - break; - } - if ( (fStackAddr & -4096) != fStackAddr ) -@@ -4293,6 +4345,7 @@ - if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) ) - warning("custom stack placement overlaps and will disable shared region"); - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fStackSize > 0x2F000000 ) - throw "-stack_size must be < 752MB"; -@@ -4301,11 +4354,13 @@ - if ( fStackAddr > 0x30000000ULL) - throw "-stack_addr must be < 0x30000000 for arm"; - break; -+#endif - case CPU_TYPE_X86_64: - if ( fStackAddr == 0 ) { - fStackAddr = 0x00007FFF5C000000ULL; - } - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - if ( fStackSize > 0x20000000 ) - throw "-stack_size must be < 512MB"; -@@ -4313,6 +4368,7 @@ - fStackAddr = 0x120000000ULL; - } - break; -+#endif - } - if ( (fStackSize & -4096) != fStackSize ) - throw "-stack_size must be multiples of 4K"; -@@ -4422,8 +4478,12 @@ - alterObjC1ClassNamesToObjC2 = true; - break; - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - alterObjC1ClassNamesToObjC2 = true; - break; - } -@@ -4799,11 +4799,15 @@ - // zero page size not specified on command line, set default - switch (fArchitecture) { - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - // first 4KB for 32-bit architectures - fZeroPageSize = 0x1000; - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - case CPU_TYPE_X86_64: - // first 4GB for x86_64 on all OS's - fZeroPageSize = 0x100000000ULL; -@@ -4621,9 +4685,11 @@ - - // -force_cpusubtype_ALL is not supported for ARM - if ( fForceSubtypeAll ) { -+#if SUPPORT_ARCH_arm_any - if ( fArchitecture == CPU_TYPE_ARM ) { - warning("-force_cpusubtype_ALL will become unsupported for ARM architectures"); - } -+#endif - } - - // -reexported_symbols_list can only be used with -dynamiclib ---- ld64-236.3/src/ld/OutputFile.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/OutputFile.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -629,7 +629,12 @@ - // is encoded in mach-o the same as: - // .long _foo + 0x40000000 - // so if _foo lays out to 0xC0000100, the first is ok, but the second is not. -- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) { -+ if ( -+#if SUPPORT_ARCH_arm_any -+ (_options.architecture() == CPU_TYPE_ARM) || -+#endif -+ (_options.architecture() == CPU_TYPE_I386) || -+ 0) { - // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static - if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) { - warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", -@@ -1229,22 +1234,26 @@ - return false; - const ld::Fixup* f; - switch ( fixup->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64Page21: - return !mustBeGOT; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21: - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPage21: - return true; -+#endif - case ld::Fixup::kindSetTargetAddress: - f = fixup; - do { - ++f; - } while ( ! f->lastInCluster() ); - switch (f->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64Page21: - return !mustBeGOT; - case ld::Fixup::kindStoreARM64GOTLoadPage21: - case ld::Fixup::kindStoreARM64GOTLeaPage21: - return true; -+#endif - default: - break; - } -@@ -1261,22 +1270,26 @@ - return false; - const ld::Fixup* f; - switch ( fixup->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64PageOff12: - return !mustBeGOT; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPageOff12: - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12: - return true; -+#endif - case ld::Fixup::kindSetTargetAddress: - f = fixup; - do { - ++f; - } while ( ! f->lastInCluster() ); - switch (f->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64PageOff12: - return !mustBeGOT; - case ld::Fixup::kindStoreARM64GOTLoadPageOff12: - case ld::Fixup::kindStoreARM64GOTLeaPageOff12: - return true; -+#endif - default: - break; - } -@@ -1311,7 +1324,9 @@ - std::map<uint32_t, const Fixup*> usedByHints; - for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) { - uint8_t* fixUpLocation = &buffer[fit->offsetInAtom]; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 lohExtra; -+#endif - switch ( (ld::Fixup::Kind)(fit->kind) ) { - case ld::Fixup::kindNone: - case ld::Fixup::kindNoneFollowOn: -@@ -1570,6 +1585,7 @@ - break; - case ld::Fixup::kindLinkerOptimizationHint: - // expand table of address/offsets used by hints -+#if SUPPORT_ARCH_arm64 - lohExtra.addend = fit->u.addend; - usedByHints[fit->offsetInAtom + (lohExtra.info.delta1 << 2)] = NULL; - if ( lohExtra.info.count > 0 ) -@@ -1578,6 +1594,7 @@ - usedByHints[fit->offsetInAtom + (lohExtra.info.delta3 << 2)] = NULL; - if ( lohExtra.info.count > 2 ) - usedByHints[fit->offsetInAtom + (lohExtra.info.delta4 << 2)] = NULL; -+#endif - break; - case ld::Fixup::kindStoreTargetAddressLittleEndian32: - accumulator = addressOf(state, fit, &toTarget); -@@ -2057,6 +2074,7 @@ - //uint8_t loadSize, destReg; - //uint32_t scaledOffset; - //uint32_t imm12; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 alt; - alt.addend = fit->u.addend; - setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA); -@@ -2415,6 +2433,7 @@ - fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress); - break; - } -+#endif - } - // apply hints pass 2 - for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) { -@@ -2422,6 +2441,7 @@ - continue; - InstructionInfo infoA; - InstructionInfo infoB; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 alt; - alt.addend = fit->u.addend; - setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA); -@@ -2453,6 +2473,7 @@ - } - break; - } -+#endif - } - } - -@@ -2469,6 +2490,7 @@ - for (uint8_t* p=from; p < to; ++p) - *p = 0x90; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( thumb ) { - for (uint8_t* p=from; p < to; p += 2) -@@ -2479,6 +2501,7 @@ - OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000); - } - break; -+#endif - default: - for (uint8_t* p=from; p < to; ++p) - *p = 0x00; -@@ -2807,7 +2830,11 @@ - - // in -r mode, clarify symbolTableNotInFinalLinkedImages - if ( _options.outputKind() == Options::kObjectFile ) { -- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0 ) { - // x86_64 .o files need labels on anonymous literal strings - if ( (sect->type() == ld::Section::typeCString) && (atom->combine() == ld::Atom::combineByNameAndContent) ) { - (const_cast<ld::Atom*>(atom))->setSymbolTableInclusion(ld::Atom::symbolTableIn); -@@ -4030,8 +4057,10 @@ - if ( _options.sharedRegionEligible() ) { - // <rdar://problem/13287063> when range checking, ignore high byte of arm64 addends - uint64_t checkAddend = addend; -+#if SUPPORT_ARCH_arm64 - if ( _options.architecture() == CPU_TYPE_ARM64 ) - checkAddend &= 0x0FFFFFFFFFFFFFFFULL; -+#endif - if ( checkAddend != 0 ) { - // make sure the addend does not cause the pointer to point outside the target's segment - // if it does, update_dyld_shared_cache will not be able to put this dylib into the shared cache -@@ -4238,12 +4267,17 @@ - - bool OutputFile::useExternalSectionReloc(const ld::Atom* atom, const ld::Atom* target, ld::Fixup* fixupWithTarget) - { -- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0) { - // x86_64 and ARM64 use external relocations for everthing that has a symbol - return ( target->symbolTableInclusion() != ld::Atom::symbolTableNotIn ); - } - - // <rdar://problem/9513487> support arm branch interworking in -r mode -+#if SUPPORT_ARCH_arm_any - if ( (_options.architecture() == CPU_TYPE_ARM) && (_options.outputKind() == Options::kObjectFile) ) { - if ( atom->isThumb() != target->isThumb() ) { - switch ( fixupWithTarget->kind ) { -@@ -4257,6 +4291,7 @@ - } - } - } -+#endif - - if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) { - if ( target->contentType() == ld::Atom::typeTLV ) -@@ -4324,7 +4359,11 @@ - bool minusTargetUsesExternalReloc = (minusTarget != NULL) && this->useExternalSectionReloc(atom, minusTarget, fixupWithMinusTarget); - - // in x86_64 and arm64 .o files an external reloc means the content contains just the addend -- if ( (_options.architecture() == CPU_TYPE_X86_64) ||(_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0 ) { - if ( targetUsesExternalReloc ) { - fixupWithTarget->contentAddendOnly = true; - fixupWithStore->contentAddendOnly = true; ---- ld64-236.3/src/ld/parsers/archive_file.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/parsers/archive_file.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -232,8 +232,12 @@ - - template <> cpu_type_t File<x86>::architecture() { return CPU_TYPE_I386; } - template <> cpu_type_t File<x86_64>::architecture() { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> cpu_type_t File<arm>::architecture() { return CPU_TYPE_ARM; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> cpu_type_t File<arm64>::architecture() { return CPU_TYPE_ARM64; } -+#endif - - - template <typename A> ---- ld64-236.3/src/ld/parsers/macho_dylib_file.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-23 07:01:27.000000000 +0100 -@@ -250,11 +250,15 @@ - bool File<A>::_s_logHashtable = false; - - template <> const char* File<x86_64>::objCInfoSegmentName() { return "__DATA"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* File<arm>::objCInfoSegmentName() { return "__DATA"; } -+#endif - template <typename A> const char* File<A>::objCInfoSegmentName() { return "__OBJC"; } - - template <> const char* File<x86_64>::objCInfoSectionName() { return "__objc_imageinfo"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* File<arm>::objCInfoSectionName() { return "__objc_imageinfo"; } -+#endif - template <typename A> const char* File<A>::objCInfoSectionName() { return "__image_info"; } - - template <typename A> -@@ -1006,6 +1010,7 @@ - } - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle) - { -@@ -1032,9 +1037,11 @@ - return false; - } - } -+#endif - - - -+#if SUPPORT_ARCH_arm64 - template <> - bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle) - { -@@ -1061,6 +1068,7 @@ - return false; - } - } -+#endif - - - bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult) -@@ -1084,17 +1084,21 @@ - *subResult = CPU_SUBTYPE_X86_ALL; - return true; - } -+#if SUPPORT_ARCH_arm_any - if ( Parser<arm>::validFile(fileContent, false) ) { - *result = CPU_TYPE_ARM; - const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#if SUPPORT_ARCH_arm64 - if ( Parser<arm64>::validFile(fileContent, false) ) { - *result = CPU_TYPE_ARM64; - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#endif - #ifdef SUPPORT_ARCH_ppc - if ( Parser<ppc>::validFile(fileContent, false) ) { - *result = CPU_TYPE_POWERPC; -@@ -1123,6 +1135,7 @@ - return "x86_64"; - } - -+#if SUPPORT_ARCH_arm_any - template <> - const char* Parser<arm>::fileKind(const uint8_t* fileContent) - { -@@ -1138,6 +1151,7 @@ - } - return "arm???"; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1163,9 +1177,11 @@ - if ( Parser<x86>::validFile(fileContent, true) ) { - return Parser<x86>::fileKind(fileContent); - } -+#if SUPPORT_ARCH_arm_any - if ( Parser<arm>::validFile(fileContent, true) ) { - return Parser<arm>::fileKind(fileContent); - } -+#endif - #if SUPPORT_ARCH_arm64 - if ( Parser<arm64>::validFile(fileContent, false) ) { - return Parser<arm64>::fileKind(fileContent); ---- ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/parsers/macho_relocatable_file.cpp 2015-01-23 07:02:23.000000000 +0100 -@@ -861,6 +861,7 @@ - } - } - -+#if SUPPORT_ARCH_arm_any - template <> - void Atom<arm>::verifyAlignment(const macho_section<P>&) const - { -@@ -869,6 +870,7 @@ - warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path()); - } - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1218,6 +1220,7 @@ - return true; - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype) - { -@@ -1238,8 +1241,10 @@ - } - return true; - } -+#endif - - -+#if SUPPORT_ARCH_arm64 - template <> - bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype) - { -@@ -1252,6 +1257,7 @@ - return false; - return true; - } -+#endif - - - template <> -@@ -1276,6 +1282,7 @@ - return "x86_64"; - } - -+#if SUPPORT_ARCH_arm_any - template <> - const char* Parser<arm>::fileKind(const uint8_t* fileContent) - { -@@ -1291,6 +1298,7 @@ - } - return "arm???"; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1802,8 +1810,12 @@ - - template <> uint8_t Parser<x86>::loadCommandSizeMask() { return 0x03; } - template <> uint8_t Parser<x86_64>::loadCommandSizeMask() { return 0x07; } -+#if SUPPORT_ARCH_arm_any - template <> uint8_t Parser<arm>::loadCommandSizeMask() { return 0x03; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> uint8_t Parser<arm64>::loadCommandSizeMask() { return 0x07; } -+#endif - - template <typename A> - bool Parser<A>::parseLoadCommands() -@@ -3921,8 +3933,10 @@ - return 1 + (this->_machOSection - parser.firstMachOSection()); - } - -+#if SUPPORT_ARCH_arm_any - // arm does not have zero cost exceptions - template <> uint32_t CFISection<arm>::cfiCount() { return 0; } -+#endif - - template <typename A> - uint32_t CFISection<A>::cfiCount() -@@ -4050,6 +4064,7 @@ - - - -+#if SUPPORT_ARCH_arm_any - template <> - void CFISection<arm>::cfiParse(class Parser<arm>& parser, uint8_t* buffer, - libunwind::CFI_Atom_Info<CFISection<arm>::OAS>::CFI_Atom_Info cfiArray[], -@@ -4058,6 +4073,7 @@ - // arm does not use zero cost exceptions - assert(count == 0); - } -+#endif - - template <> - void CFISection<arm64>::cfiParse(class Parser<arm64>& parser, uint8_t* buffer, -@@ -4159,8 +4175,12 @@ - - template <> bool CFISection<x86_64>::bigEndian() { return false; } - template <> bool CFISection<x86>::bigEndian() { return false; } -+#if SUPPORT_ARCH_arm_any - template <> bool CFISection<arm>::bigEndian() { return false; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> bool CFISection<arm64>::bigEndian() { return false; } -+#endif - - - template <> -@@ -5077,11 +5097,13 @@ - return ld::Fixup::kindStoreLittleEndian32; - } - -+#if SUPPORT_ARCH_arm_any - template <> - ld::Fixup::Kind NonLazyPointerSection<arm>::fixupKind() - { - return ld::Fixup::kindStoreLittleEndian32; - } -+#endif - - template <> - ld::Fixup::Kind NonLazyPointerSection<arm64>::fixupKind() -@@ -7170,10 +7192,14 @@ - return ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ); - case CPU_TYPE_I386: - return ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ); -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - return ( mach_o::relocatable::Parser<arm>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) ); -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - return ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) ); -+#endif - } - return false; - } -@@ -7194,17 +7220,21 @@ - *subResult = CPU_SUBTYPE_X86_ALL; - return true; - } -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - *result = CPU_TYPE_ARM; - const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, false, 0) ) { - *result = CPU_TYPE_ARM64; - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#endif - return false; - } - -@@ -7219,9 +7249,11 @@ - if ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ) { - return mach_o::relocatable::Parser<x86>::fileKind(fileContent); - } -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<arm>::fileKind(fileContent); - } -+#endif - return NULL; - } - -@@ -7233,9 +7265,11 @@ - if ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ) { - return mach_o::relocatable::Parser<x86_64>::hasObjC2Categories(fileContent); - } -+#if SUPPORT_ARCH_arm_any - else if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<arm>::hasObjC2Categories(fileContent); - } -+#endif - else if ( mach_o::relocatable::Parser<x86>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<x86>::hasObjC2Categories(fileContent); - } ---- ld64-236.3/src/ld/passes/branch_island.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/passes/branch_island.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -284,6 +284,7 @@ - static uint64_t textSizeWhenMightNeedBranchIslands(const Options& opts, bool seenThumbBranch) - { - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( ! seenThumbBranch ) - return 32000000; // ARM can branch +/- 32MB -@@ -292,6 +293,7 @@ - else - return 4000000; // thumb1 can branch +/- 4MB - break; -+#endif - } - assert(0 && "unexpected architecture"); - return 0x100000000LL; -@@ -301,6 +303,7 @@ - static uint64_t maxDistanceBetweenIslands(const Options& opts, bool seenThumbBranch) - { - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( ! seenThumbBranch ) - return 30*1024*1024; // 2MB of branch islands per 32MB -@@ -309,6 +312,7 @@ - else - return 3500000; // 0.5MB of branch islands per 4MB - break; -+#endif - } - assert(0 && "unexpected architecture"); - return 0x100000000LL; -@@ -653,8 +657,10 @@ - - // only ARM needs branch islands - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - break; -+#endif - default: - return; - } ---- ld64-236.3/src/ld/passes/branch_shim.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/passes/branch_shim.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -276,6 +276,9 @@ - // - void doPass(const Options& opts, ld::Internal& state) - { -+#if !SUPPORT_ARCH_arm_any -+ return; -+#else - // only make branch shims in final linked images - if ( opts.outputKind() == Options::kObjectFile ) - return; -@@ -386,6 +389,7 @@ - // append all new shims to end of __text - sect->atoms.insert(sect->atoms.end(), shims.begin(), shims.end()); - } -+#endif - } - - ---- ld64-236.3/src/ld/passes/dtrace_dof.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/passes/dtrace_dof.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -179,8 +179,12 @@ - switch ( opts.architecture() ) { - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - storeKind = ld::Fixup::kindStoreLittleEndian32; - break; - default: ---- ld64-236.3/src/ld/passes/stubs/stubs.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/passes/stubs/stubs.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -324,9 +324,11 @@ - if ( _options.outputKind() != Options::kDynamicLibrary ) - throwf("resolver functions (%s) can only be used in dylibs", atom->name()); - if ( !_options.makeCompressedDyldInfo() ) { -+#if SUPPORT_ARCH_arm_any - if ( _options.architecture() == CPU_TYPE_ARM ) - throwf("resolver functions (%s) can only be used when targeting iOS 4.2 or later", atom->name()); - else -+#endif - throwf("resolver functions (%s) can only be used when targeting Mac OS X 10.6 or later", atom->name()); - } - stubFor[atom] = NULL; -@@ -354,6 +356,7 @@ - throw "symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o"; - - // disable arm close stubs in some cases -+#if SUPPORT_ARCH_arm_any - if ( _architecture == CPU_TYPE_ARM ) { - if ( codeSize > 4*1024*1024 ) - _largeText = true; -@@ -377,6 +380,7 @@ - } - } - } -+#endif - - // make stub atoms - for (std::map<const ld::Atom*,ld::Atom*>::iterator it = stubFor.begin(); it != stubFor.end(); ++it) { ---- ld64-236.3/src/ld/Resolver.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/ld/Resolver.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -396,6 +396,7 @@ - // update cpu-sub-type - cpu_subtype_t nextObjectSubType = file.cpuSubType(); - switch ( _options.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( _options.subArchitecture() != nextObjectSubType ) { - if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) { -@@ -414,6 +415,7 @@ - } - } - break; -+#endif - - case CPU_TYPE_I386: - _internal.cpuSubType = CPU_SUBTYPE_I386_ALL; ---- ld64-236.3/src/other/machochecker.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/other/machochecker.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -252,6 +252,7 @@ - return false; - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool MachOChecker<arm>::validFile(const uint8_t* fileContent) - { -@@ -269,6 +270,7 @@ - } - return false; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -294,7 +296,9 @@ - template <> uint8_t MachOChecker<ppc64>::loadCommandSizeMask() { return 0x07; } - template <> uint8_t MachOChecker<x86>::loadCommandSizeMask() { return 0x03; } - template <> uint8_t MachOChecker<x86_64>::loadCommandSizeMask() { return 0x07; } -+#if SUPPORT_ARCH_arm_any - template <> uint8_t MachOChecker<arm>::loadCommandSizeMask() { return 0x03; } -+#endif - #if SUPPORT_ARCH_arm64 - template <> uint8_t MachOChecker<arm64>::loadCommandSizeMask() { return 0x07; } - #endif -@@ -324,11 +328,13 @@ - return threadInfo->thread_register(7); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::getInitialStackPointer(const macho_thread_command<arm::P>* threadInfo) - { - return threadInfo->thread_register(13); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -362,11 +368,13 @@ - return threadInfo->thread_register(16); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::getEntryPoint(const macho_thread_command<arm::P>* threadInfo) - { - return threadInfo->thread_register(15); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1025,6 +1033,7 @@ - return fFirstWritableSegment->vmaddr(); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::relocBase() - { -@@ -1033,6 +1042,7 @@ - else - return fFirstSegment->vmaddr(); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> ---- ld64-236.3/src/other/ObjectDump.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/other/ObjectDump.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -806,6 +806,7 @@ - case ld::Fixup::kindStoreThumbHigh16: - printf(", then store high-16 in Thumb movt"); - break; -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64Branch26: - printf(", then store as ARM64 26-bit pcrel branch"); - break; -@@ -839,6 +840,7 @@ - case ld::Fixup::kindStoreARM64PCRelToGOT: - printf(", then store as 32-bit delta to GOT entry"); - break; -+#endif - case ld::Fixup::kindDtraceExtra: - printf("dtrace static probe extra info"); - break; -@@ -983,6 +985,7 @@ - case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64: - printf("tlv template offset of %s", referenceTargetAtomName(ref)); - break; -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64Branch26: - printf("ARM64 store 26-bit pcrel branch to %s", referenceTargetAtomName(ref)); - break; -@@ -1010,6 +1013,7 @@ - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12: - printf("ARM64 store 12-bit page offset of lea of %s", referenceTargetAtomName(ref)); - break; -+#endif - //default: - // printf("unknown fixup"); - // break; ---- ld64-236.3/src/other/rebase.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/other/rebase.cpp 2015-01-23 06:56:04.000000000 +0100 -@@ -160,9 +160,11 @@ - case CPU_TYPE_X86_64: - fRebasers.push_back(new Rebaser<x86_64>(&p[fileOffset])); - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - fRebasers.push_back(new Rebaser<arm>(&p[fileOffset])); - break; -+#endif - default: - throw "unknown file format"; - } -@@ -186,9 +188,11 @@ - else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC_64) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_X86_64)) { - fRebasers.push_back(new Rebaser<x86_64>(mh)); - } -+#if SUPPORT_ARCH_arm_any - else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_ARM)) { - fRebasers.push_back(new Rebaser<arm>(mh)); - } -+#endif - else { - throw "unknown file format"; - } -@@ -236,7 +240,9 @@ - template <> cpu_type_t Rebaser<ppc64>::getArchitecture() const { return CPU_TYPE_POWERPC64; } - template <> cpu_type_t Rebaser<x86>::getArchitecture() const { return CPU_TYPE_I386; } - template <> cpu_type_t Rebaser<x86_64>::getArchitecture() const { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> cpu_type_t Rebaser<arm>::getArchitecture() const { return CPU_TYPE_ARM; } -+#endif - - template <typename A> - uint64_t Rebaser<A>::getBaseAddress() const -@@ -875,8 +881,10 @@ - return "i386"; - case CPU_TYPE_X86_64: - return "x86_64"; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - return "arm"; -+#endif - } - return "unknown"; - } -@@ -969,6 +977,7 @@ - else if ( arch == CPU_TYPE_X86_64 ) { - return 0x200000000ULL; - } -+#if SUPPORT_ARCH_arm_any - else if ( arch == CPU_TYPE_ARM ) { - // place dylibs below dyld - uint64_t topAddr = 0x2FE00000; -@@ -977,6 +986,7 @@ - throwf("total size of images (0x%X) does not fit below 0x2FE00000", totalSize); - return topAddr - totalSize; - } -+#endif - else - throw "unknown architecture"; - } -@@ -1043,7 +1053,9 @@ - onlyArchs.insert(CPU_TYPE_POWERPC64); - onlyArchs.insert(CPU_TYPE_I386); - onlyArchs.insert(CPU_TYPE_X86_64); -+#if SUPPORT_ARCH_arm_any - onlyArchs.insert(CPU_TYPE_ARM); -+#endif - } - - // scan files and collect sizes ---- ld64-236.3/src/other/unwinddump.cpp.orig 2015-01-23 06:55:36.000000000 +0100 -+++ ld64-236.3/src/other/unwinddump.cpp 2015-01-23 07:03:16.000000000 +0100 -@@ -97,7 +97,9 @@ - - template <> const char* UnwindPrinter<x86>::archName() { return "i386"; } - template <> const char* UnwindPrinter<x86_64>::archName() { return "x86_64"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* UnwindPrinter<arm>::archName() { return "arm"; } -+#endif - #if SUPPORT_ARCH_arm64 - template <> const char* UnwindPrinter<arm64>::archName() { return "arm64"; } - #endif diff --git a/sys-devel/binutils-apple/files/ld64-236.3-nolto.patch b/sys-devel/binutils-apple/files/ld64-236.3-nolto.patch deleted file mode 100644 index 5d68c377ea0e..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-nolto.patch +++ /dev/null @@ -1,219 +0,0 @@ -Allow to fully disable LTO - ---- ld64-236.3/src/ld/InputFiles.cpp -+++ ld64-236.3/src/ld/InputFiles.cpp -@@ -59,7 +59,9 @@ - #include "macho_relocatable_file.h" - #include "macho_dylib_file.h" - #include "archive_file.h" -+#ifdef LTO - #include "lto_file.h" -+#endif - #include "opaque_section_file.h" - #include "MachOFileAbstraction.hpp" - #include "Snapshot.h" -@@ -187,9 +189,11 @@ - if ( result != NULL ) - return result; - -+#ifdef LTO - result = lto::archName(p, len); - if ( result != NULL ) - return result; -+#endif - - if ( strncmp((const char*)p, "!<arch>\n", 8) == 0 ) - return "archive"; -@@ -292,6 +296,7 @@ - return objResult; - } - -+#ifdef LTO - // see if it is an llvm object file - objResult = lto::parse(p, len, info.path, info.modTime, info.ordinal, _options.architecture(), _options.subArchitecture(), _options.logAllFiles(), _options.verboseOptimizationHints()); - if ( objResult != NULL ) { -@@ -299,6 +304,7 @@ - OSAtomicIncrement32(&_totalObjectLoaded); - return objResult; - } -+#endif - - // see if it is a dynamic library - ld::dylib::File* dylibResult = mach_o::dylib::parse(p, len, info.path, info.modTime, _options, info.ordinal, info.options.fBundleLoader, indirectDylib); -@@ -322,6 +328,7 @@ - return archiveResult; - } - -+#ifdef LTO - // does not seem to be any valid linker input file, check LTO misconfiguration problems - if ( lto::archName((uint8_t*)p, len) != NULL ) { - if ( lto::libLTOisLoaded() ) { -@@ -349,6 +356,7 @@ - throwf("could not process llvm bitcode object file, because %s could not be loaded", libLTO); - } - } -+#endif - - // error handling - if ( ((fat_header*)p)->magic == OSSwapBigToHostInt32(FAT_MAGIC) ) { ---- ld64-236.3/src/ld/ld.cpp -+++ ld64-236.3/src/ld/ld.cpp -@@ -91,7 +91,9 @@ - #include "parsers/archive_file.h" - #include "parsers/macho_relocatable_file.h" - #include "parsers/macho_dylib_file.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - #include "parsers/opaque_section_file.h" - - ---- ld64-236.3/src/ld/Options.cpp -+++ ld64-236.3/src/ld/Options.cpp -@@ -41,10 +41,13 @@ - #include "MachOFileAbstraction.hpp" - #include "Snapshot.h" - -+ -+#ifdef LTO - // upward dependency on lto::version() - namespace lto { - extern const char* version(); - } -+#endif - - // magic to place command line in crash reports - const int crashreporterBufferSize = 2000; -@@ -3179,9 +3182,11 @@ - fprintf(stderr, "configured to support archs: %s\n", ALL_SUPPORTED_ARCHS); - // if only -v specified, exit cleanly - if ( argc == 2 ) { -+#ifdef LTO - const char* ltoVers = lto::version(); - if ( ltoVers != NULL ) - fprintf(stderr, "LTO support using: %s\n", ltoVers); -+#endif - exit(0); - } - } ---- ld64-236.3/src/ld/parsers/archive_file.cpp -+++ ld64-236.3/src/ld/parsers/archive_file.cpp -@@ -45,7 +45,9 @@ - #include "Architectures.hpp" - - #include "macho_relocatable_file.h" -+#ifdef LTO - #include "lto_file.h" -+#endif - #include "archive_file.h" - - -@@ -97,8 +99,10 @@ - private: - static bool validMachOFile(const uint8_t* fileContent, uint64_t fileLength, - const mach_o::relocatable::ParserOptions& opts); -+#ifdef LTO - static bool validLTOFile(const uint8_t* fileContent, uint64_t fileLength, - const mach_o::relocatable::ParserOptions& opts); -+#endif - static cpu_type_t architecture(); - - class Entry : ar_hdr -@@ -242,11 +246,13 @@ - return mach_o::relocatable::isObjectFile(fileContent, fileLength, opts); - } - -+#ifdef LTO - template <typename A> - bool File<A>::validLTOFile(const uint8_t* fileContent, uint64_t fileLength, const mach_o::relocatable::ParserOptions& opts) - { - return lto::isObjectFile(fileContent, fileLength, opts.architecture, opts.subType); - } -+#endif - - - -@@ -267,7 +273,11 @@ - if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) ) - continue; - // archive is valid if first .o file is valid -- return (validMachOFile(p->content(), p->contentSize(), opts) || validLTOFile(p->content(), p->contentSize(), opts)); -+ return (validMachOFile(p->content(), p->contentSize(), opts) -+#ifdef LTO -+ || validLTOFile(p->content(), p->contentSize(), opts) -+#endif -+ ); - } - // empty archive - return true; -@@ -388,6 +398,7 @@ - _instantiatedEntries[member] = state; - return _instantiatedEntries[member]; - } -+#ifdef LTO - // see if member is llvm bitcode file - result = lto::parse(member->content(), member->contentSize(), - mPath, member->modificationTime(), ordinal, -@@ -397,6 +408,7 @@ - _instantiatedEntries[member] = state; - return _instantiatedEntries[member]; - } -+#endif - - throwf("archive member '%s' with length %d is not mach-o or llvm bitcode", memberName, member->contentSize()); - } ---- ld64-236.3/src/ld/Resolver.cpp -+++ ld64-236.3/src/ld/Resolver.cpp -@@ -56,7 +56,9 @@ - #include "InputFiles.h" - #include "SymbolTable.h" - #include "Resolver.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - - - namespace ld { -@@ -1438,6 +1440,7 @@ - - void Resolver::linkTimeOptimize() - { -+#ifdef LTO - // only do work here if some llvm obj files where loaded - if ( ! _haveLLVMObjs ) - return; -@@ -1535,6 +1538,9 @@ - // check new code does not override some dylib - this->checkDylibSymbolCollisions(); - } -+#else -+ return; -+#endif - } - - ---- ld64-236.3/src/other/ObjectDump.cpp -+++ ld64-236.3/src/other/ObjectDump.cpp -@@ -33,7 +33,9 @@ - - #include "MachOFileAbstraction.hpp" - #include "parsers/macho_relocatable_file.h" -+#ifdef LTO - #include "parsers/lto_file.h" -+#endif - - static bool sDumpContent= true; - static bool sDumpStabs = false; -@@ -1249,10 +1251,12 @@ - if ( objResult != NULL ) - return objResult; - -+#ifdef LTO - // see if it is an llvm object file - objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, ld::File::Ordinal::NullOrdinal(), sPreferredArch, sPreferredSubArch, false, true); - if ( objResult != NULL ) - return objResult; -+#endif - - throwf("not a mach-o object file: %s", path); - #else diff --git a/sys-devel/binutils-apple/files/ld64-236.3-noppc.patch b/sys-devel/binutils-apple/files/ld64-236.3-noppc.patch deleted file mode 100644 index 85e9d94b35e1..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-noppc.patch +++ /dev/null @@ -1,26 +0,0 @@ -Allow to fully disable powerpc. - ---- ld64-236.3/src/ld/parsers/macho_dylib_file.cpp.orig 2015-01-23 17:59:55.000000000 +0100 -+++ ld64-236.3/src/ld/parsers/macho_dylib_file.cpp 2015-01-23 18:00:04.000000000 +0100 -@@ -1095,17 +1095,21 @@ - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#ifdef SUPPORT_ARCH_ppc - if ( Parser<ppc>::validFile(fileContent, false) ) { - *result = CPU_TYPE_POWERPC; - const macho_header<Pointer32<BigEndian> >* header = (const macho_header<Pointer32<BigEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#ifdef SUPPORT_ARCH_ppc64 - if ( Parser<ppc64>::validFile(fileContent, false) ) { - *result = CPU_TYPE_POWERPC64; - *subResult = CPU_SUBTYPE_POWERPC_ALL; - return true; - } -+#endif - return false; - } - diff --git a/sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch b/sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch deleted file mode 100644 index aa75a03cbf74..000000000000 --- a/sys-devel/binutils-apple/files/ld64-236.3-nosnapshots.patch +++ /dev/null @@ -1,644 +0,0 @@ -Allow to disable snapshot support because of missing Block API on OS X < 10.6. - ---- ld64-236.3/src/ld/ld.cpp.orig 2015-01-16 14:49:49.000000000 -0800 -+++ ld64-236.3/src/ld/ld.cpp 2015-01-16 14:50:42.000000000 -0800 -@@ -1072,11 +1072,13 @@ - // implement assert() function to print out a backtrace before aborting - void __assert_rtn(const char* func, const char* file, int line, const char* failedexpr) - { -+#ifdef SUPPORT_SNAPSHOTS - Snapshot *snapshot = Snapshot::globalSnapshot; - - snapshot->setSnapshotMode(Snapshot::SNAPSHOT_DEBUG); - snapshot->createSnapshot(); - snapshot->recordAssertionMessage("Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line); -+#endif - - void* callStack[128]; - int depth = ::backtrace(callStack, 128); -@@ -1094,9 +1096,13 @@ - } - long offset = (uintptr_t)callStack[i] - (uintptr_t)info.dli_saddr; - fprintf(stderr, "%d %p %s + %ld\n", i, callStack[i], symboName, offset); -+#ifdef SUPPORT_SNAPSHOTS - snapshot->recordAssertionMessage("%d %p %s + %ld\n", i, callStack[i], symboName, offset); -+#endif - } -+#ifdef SUPPORT_SNAPSHOTS - fprintf(stderr, "A linker snapshot was created at:\n\t%s\n", snapshot->rootDir()); -+#endif - fprintf(stderr, "ld: Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line); - exit(1); - } ---- ld64-236.3/src/ld/Options.cpp.orig 2015-01-16 14:49:49.000000000 -0800 -+++ ld64-236.3/src/ld/Options.cpp 2015-01-16 14:50:42.000000000 -0800 -@@ -182,7 +182,11 @@ - fGenerateDtraceDOF(true), fAllowBranchIslands(true), - fDebugInfoStripping(kDebugInfoMinimal), fTraceOutputFile(NULL), - fMacVersionMin(ld::macVersionUnset), fIOSVersionMin(ld::iOSVersionUnset), -- fSaveTempFiles(false), fSnapshotRequested(false), fPipelineFifo(NULL), -+ fSaveTempFiles(false), -+#ifdef SUPPORT_SNAPSHOTS -+ fSnapshotRequested(false), -+#endif -+ fPipelineFifo(NULL), - fDependencyInfoPath(NULL), fDependencyFileDescriptor(-1) - { - this->checkForClassic(argc, argv); -@@ -577,7 +581,9 @@ - } - break; - } -+#ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordArch(fArchitectureName); -+#endif - // only use compressed LINKEDIT for: - // Mac OS X 10.6 or later - // iOS 3.1 or later -@@ -1822,8 +1828,10 @@ - // - void Options::parse(int argc, const char* argv[]) - { -+#ifdef SUPPORT_SNAPSHOTS - // Store the original args in the link snapshot. - fLinkSnapshot.recordRawArgs(argc, argv); -+#endif - - // pass one builds search list from -L and -F options - this->buildSearchPaths(argc, argv); -@@ -1836,17 +1844,21 @@ - const char* arg = argv[i]; - - if ( arg[0] == '-' ) { -+#ifdef SUPPORT_SNAPSHOTS - // by default, copy one arg to the snapshot link command, and do no file copying - int snapshotArgIndex = i; - int snapshotArgCount = -1; // -1 means compute count based on change in index - int snapshotFileArgIndex = -1; // -1 means no data file parameter to arg -+#endif - - // Since we don't care about the files passed, just the option names, we do this here. - if (fPrintOptions) - fprintf (stderr, "[Logging ld64 options]\t%s\n", arg); - - if ( (arg[1] == 'L') || (arg[1] == 'F') ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; // stripped out of link snapshot -+#endif - if (arg[2] == '\0') - ++i; - // previously handled by buildSearchPaths() -@@ -1893,12 +1905,16 @@ - fOutputKind = kKextBundle; - } - else if ( strcmp(arg, "-o") == 0 ) { -- snapshotArgCount = 0; - fOutputFile = argv[++i]; -+#ifdef SUPPORT_SNAPSHOTS -+ snapshotArgCount = 0; - fLinkSnapshot.setSnapshotName(fOutputFile); -+#endif - } - else if ( strncmp(arg, "-lazy-l", 7) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[7], true); - info.options.fLazyLoad = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -1906,13 +1922,17 @@ - fUsingLazyDylibLinking = true; - } - else if ( strcmp(arg, "-lto_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - fOverridePathlibLTO = argv[++i]; - if ( fOverridePathlibLTO == NULL ) - throw "missing argument to -lto_library"; - } - else if ( (arg[1] == 'l') && (strncmp(arg,"-lazy_",6) !=0) ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[2]); - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); -@@ -1920,8 +1940,10 @@ - // This causes a dylib to be weakly bound at - // link time. This corresponds to weak_import. - else if ( strncmp(arg, "-weak-l", 7) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[7]); - info.options.fWeakImport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -1979,12 +2001,16 @@ - else if ( strcmp(arg, "-sectorder") == 0 ) { - if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) ) - throw "-sectorder missing <segment> <section> <file-path>"; -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 3; -+#endif - parseSectionOrderFile(argv[i+1], argv[i+2], argv[i+3]); - i += 3; - } - else if ( strcmp(arg, "-order_file") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - parseOrderFile(argv[++i], false); - } - else if ( strcmp(arg, "-order_file_statistics") == 0 ) { -@@ -1995,7 +2021,9 @@ - else if ( (strcmp(arg, "-sectcreate") == 0) || (strcmp(arg, "-segcreate") == 0) ) { - if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) ) - throw "-sectcreate missing <segment> <section> <file-path>"; -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 3; -+#endif - addSection(argv[i+1], argv[i+2], argv[i+3]); - i += 3; - } -@@ -2024,7 +2052,9 @@ - } - // Same as -@ from the FSF linker. - else if ( strcmp(arg, "-filelist") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - const char* path = argv[++i]; - if ( (path == NULL) || (path[0] == '-') ) - throw "-filelist missing <path>"; -@@ -2051,7 +2081,9 @@ - } - } - else if ( strcmp(arg, "-interposable_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - fInterposeMode = kInterposeSome; - loadExportFile(argv[++i], "-interposable_list", fInterposeList); - } -@@ -2060,14 +2092,18 @@ - fInterposeMode = kInterposeNone; - } - else if ( strcmp(arg, "-exported_symbols_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fExportMode == kDontExportSome ) - throw "can't use -exported_symbols_list and -unexported_symbols_list"; - fExportMode = kExportSome; - loadExportFile(argv[++i], "-exported_symbols_list", fExportSymbols); - } - else if ( strcmp(arg, "-unexported_symbols_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fExportMode == kExportSome ) - throw "can't use -unexported_symbols_list and -exported_symbols_list"; - fExportMode = kDontExportSome; -@@ -2086,14 +2122,18 @@ - fDontExportSymbols.insert(argv[++i]); - } - else if ( strcmp(arg, "-non_global_symbols_no_strip_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fLocalSymbolHandling == kLocalSymbolsSelectiveExclude ) - throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list"; - fLocalSymbolHandling = kLocalSymbolsSelectiveInclude; - loadExportFile(argv[++i], "-non_global_symbols_no_strip_list", fLocalSymbolsIncluded); - } - else if ( strcmp(arg, "-non_global_symbols_strip_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fLocalSymbolHandling == kLocalSymbolsSelectiveInclude ) - throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list"; - fLocalSymbolHandling = kLocalSymbolsSelectiveExclude; -@@ -2109,16 +2149,20 @@ - } - // Similar to -weak-l but uses the absolute path name to the library. - else if ( strcmp(arg, "-weak_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fWeakImport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-lazy_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fLazyLoad = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2126,22 +2170,28 @@ - fUsingLazyDylibLinking = true; - } - else if ( strcmp(arg, "-framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-weak_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fWeakImport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-lazy_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fLazyLoad = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2219,8 +2269,10 @@ - // This should probably be deprecated when we respect -L and -F - // when searching for libraries. - else if ( strcmp(arg, "-dylib_file") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // ignore for snapshot because a stub dylib will be created in the snapshot - snapshotArgCount = 0; -+#endif - addDylibOverride(argv[++i]); - } - // What to expand @executable_path to if found in dependent dylibs -@@ -2277,7 +2329,9 @@ - } - // ??? Deprecate when we get rid of basing at build time. - else if ( strcmp(arg, "-seg_addr_table") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - const char* name = argv[++i]; - if ( name == NULL ) - throw "-seg_addr_table missing argument"; -@@ -2341,7 +2395,9 @@ - i += 2; - } - else if ( strcmp(arg, "-bundle_loader") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - fBundleLoader = argv[++i]; - if ( (fBundleLoader == NULL) || (fBundleLoader[0] == '-') ) - throw "-bundle_loader missing <path>"; -@@ -2573,7 +2629,9 @@ - // previously handled by buildSearchPaths() - } - else if ( strcmp(arg, "-syslibroot") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - ++i; - // previously handled by buildSearchPaths() - } -@@ -2584,7 +2642,9 @@ - fUUIDMode = kUUIDRandom; - } - else if ( strcmp(arg, "-dtrace") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - const char* name = argv[++i]; - if ( name == NULL ) - throw "-dtrace missing argument"; -@@ -2607,7 +2667,9 @@ - fAliases.push_back(pair); - } - else if ( strcmp(arg, "-alias_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - parseAliasFile(argv[++i]); - } - else if ( strcmp(arg, "-save-temps") == 0 ) { -@@ -2638,48 +2700,60 @@ - fDisablePositionIndependentExecutable = true; - } - else if ( strncmp(arg, "-reexport-l", 11) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[11], true); - info.options.fReExport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-reexport_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fReExport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-reexport_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fReExport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strncmp(arg, "-upward-l", 9) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[9], true); - info.options.fUpward = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-upward_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fUpward = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-upward_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fUpward = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2733,7 +2807,9 @@ - fMarkDeadStrippableDylib = true; - } - else if ( strcmp(arg, "-exported_symbols_order") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadSymbolOrderFile(argv[++i], fExportSymbolsOrder); - } - else if ( strcmp(arg, "-no_compact_linkedit") == 0 ) { -@@ -2825,11 +2901,15 @@ - fObjcCategoryMerging = false; - } - else if ( strcmp(arg, "-force_symbols_weak_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadExportFile(argv[++i], "-force_symbols_weak_list", fForceWeakSymbols); - } - else if ( strcmp(arg, "-force_symbols_not_weak_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadExportFile(argv[++i], "-force_symbols_not_weak_list", fForceNotWeakSymbols); - } - else if ( strcmp(arg, "-force_symbol_weak") == 0 ) { -@@ -2845,7 +2925,9 @@ - fForceNotWeakSymbols.insert(symbol); - } - else if ( strcmp(arg, "-reexported_symbols_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fExportMode == kExportSome ) - throw "can't use -exported_symbols_list and -reexported_symbols_list"; - loadExportFile(argv[++i], "-reexported_symbols_list", fReExportSymbols); -@@ -2861,6 +2943,7 @@ - else if ( strcmp(arg, "-page_align_data_atoms") == 0 ) { - fPageAlignDataAtoms = true; - } -+#ifdef SUPPORT_SNAPSHOTS - else if (strcmp(arg, "-debug_snapshot") == 0) { - fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG); - fSnapshotRequested = true; -@@ -2873,6 +2956,7 @@ - fLinkSnapshot.setSnapshotPath(path); - fSnapshotRequested = true; - } -+#endif - else if ( strcmp(arg, "-new_main") == 0 ) { - fEntryPointLoadCommandForceOn = true; - } -@@ -2914,7 +2998,9 @@ - fExportDynamic = true; - } - else if ( strcmp(arg, "-force_symbols_coalesce_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadExportFile(argv[++i], "-force_symbols_coalesce_list", fForceCoalesceSymbols); - } - else if ( strcmp(arg, "-add_linker_option") == 0 ) { -@@ -2984,10 +3070,12 @@ - throwf("unknown option: %s", arg); - } - -+#ifdef SUPPORT_SNAPSHOTS - if (snapshotArgCount == -1) - snapshotArgCount = i-snapshotArgIndex+1; - if (snapshotArgCount > 0) - fLinkSnapshot.addSnapshotLinkArg(snapshotArgIndex, snapshotArgCount, snapshotFileArgIndex); -+#endif - } - else { - FileInfo info = findFile(arg); -@@ -3006,8 +3096,10 @@ - addLibrary(info); - } - -+#ifdef SUPPORT_SNAPSHOTS - if (fSnapshotRequested) - fLinkSnapshot.createSnapshot(); -+#endif - } - - -@@ -3270,6 +3362,7 @@ - if ( customDyldPath != NULL ) - fDyldInstallPath = customDyldPath; - -+#ifdef SUPPORT_SNAPSHOTS - const char* debugArchivePath = getenv("LD_DEBUG_SNAPSHOT"); - if (debugArchivePath != NULL) { - fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG); -@@ -3277,6 +3370,7 @@ - fLinkSnapshot.setSnapshotPath(debugArchivePath); - fSnapshotRequested = true; - } -+#endif - - const char* pipeFdString = getenv("LD_PIPELINE_FIFO"); - if (pipeFdString != NULL) { -@@ -4133,7 +4227,9 @@ - if ( strcmp(&lastSlash[1], subUmbrella) == 0 ) { - info.options.fReExport = true; - found = true; -+#ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordSubUmbrella(info.path); -+#endif - break; - } - } -@@ -4156,7 +4252,9 @@ - if ( strncmp(&lastSlash[1], subLibrary, dot-lastSlash-1) == 0 ) { - info.options.fReExport = true; - found = true; -+#ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordSubLibrary(info.path); -+#endif - break; - } - } ---- ld64-236.3/src/ld/Options.h.orig 2015-01-16 14:49:49.000000000 -0800 -+++ ld64-236.3/src/ld/Options.h 2015-01-16 14:50:42.000000000 -0800 -@@ -48,7 +48,9 @@ - extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2))); - extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2))); - -+#ifdef SUPPORT_SNAPSHOTS - class Snapshot; -+#endif - - class LibraryOptions - { -@@ -362,7 +364,9 @@ - bool forceWeakNonWildCard(const char* symbolName) const; - bool forceNotWeakNonWildcard(const char* symbolName) const; - bool forceCoalesce(const char* symbolName) const; -+#ifdef SUPPORT_SNAPSHOTS - Snapshot& snapshot() const { return fLinkSnapshot; } -+#endif - bool errorBecauseOfWarnings() const; - bool needsThreadLoadCommand() const { return fNeedsThreadLoadCommand; } - bool needsEntryPointLoadCommand() const { return fEntryPointLoadCommand; } -@@ -640,8 +644,10 @@ - std::vector< std::vector<const char*> > fLinkerOptions; - std::vector<SectionRename> fSectionRenames; - bool fSaveTempFiles; -+#ifdef SUPPORT_SNAPSHOTS - mutable Snapshot fLinkSnapshot; - bool fSnapshotRequested; -+#endif - const char* fPipelineFifo; - const char* fDependencyInfoPath; - mutable int fDependencyFileDescriptor; ---- ld64-236.3/src/ld/Snapshot.cpp.orig 2015-01-16 14:51:58.000000000 -0800 -+++ ld64-236.3/src/ld/Snapshot.cpp 2015-01-16 14:50:42.000000000 -0800 -@@ -6,6 +6,9 @@ - // Copyright (c) 2011 Apple Inc. All rights reserved. - // - -+#include "Snapshot.h" -+ -+#ifdef SUPPORT_SNAPSHOTS - #include <string.h> - #include <unistd.h> - #include <stdio.h> -@@ -17,7 +20,6 @@ - #include <time.h> - #include <Block.h> - --#include "Snapshot.h" - #include "Options.h" - - #include "compile_stubs.h" -@@ -538,3 +538,5 @@ - } - } - } -+ -+#endif /* SUPPORT_SNAPSHOT */ ---- ld64-236.3/src/ld/Snapshot.h.orig 2015-01-23 07:59:55.000000000 +0100 -+++ ld64-236.3/src/ld/Snapshot.h 2015-01-23 07:58:14.000000000 +0100 -@@ -8,6 +8,8 @@ - - #ifndef ld64_Snapshot_h - #define ld64_Snapshot_h -+ -+#ifdef SUPPORT_SNAPSHOTS - #include <stdint.h> - #include <string.h> - #include <map> -@@ -151,3 +153,5 @@ - }; - - #endif -+ -+#endif ---- ld64-236.3/src/ld/InputFiles.cpp.orig 2015-01-16 14:54:33.000000000 -0800 -+++ ld64-236.3/src/ld/InputFiles.cpp 2015-01-16 14:55:37.000000000 -0800 -@@ -1101,7 +1101,9 @@ - case ld::File::Reloc: - { - ld::relocatable::File* reloc = (ld::relocatable::File*)file; -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordObjectFile(reloc->path()); -+#endif - if ( _options.dumpDependencyInfo() ) - _options.dumpDependency(Options::depObjectFile, reloc->path()); - } -@@ -1201,7 +1203,9 @@ - if ( dylibFile->justInTimeforEachAtom(name, handler) ) { - // we found a definition in this dylib - // done, unless it is a weak definition in which case we keep searching -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordDylibSymbol(dylibFile, name); -+#endif - if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) { - return true; - } -@@ -1215,7 +1219,9 @@ - if ( archiveFile->justInTimeDataOnlyforEachAtom(name, handler) ) { - if ( _options.traceArchives() ) - logArchive(archiveFile); -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordArchive(archiveFile->path()); -+#endif - // found data definition in static library, done - return true; - } -@@ -1224,7 +1230,9 @@ - if ( archiveFile->justInTimeforEachAtom(name, handler) ) { - if ( _options.traceArchives() ) - logArchive(archiveFile); -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordArchive(archiveFile->path()); -+#endif - // found definition in static library, done - return true; - } -@@ -1251,7 +1259,9 @@ - if ( dylibFile->justInTimeforEachAtom(name, handler) ) { - // we found a definition in this dylib - // done, unless it is a weak definition in which case we keep searching -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordDylibSymbol(dylibFile, name); -+#endif - if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) { - return true; - } diff --git a/sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch b/sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch deleted file mode 100644 index dd0a6f22bc0b..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-arm64-cputype.patch +++ /dev/null @@ -1,17 +0,0 @@ -Remove redefinitions of CPU types that cause warnings and mask that some -platform isn't actually supported on a host version. - -diff -ur ld64-241.9/src/abstraction/MachOFileAbstraction.hpp work/ld64-241.9/src/abstraction/MachOFileAbstraction.hpp ---- ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2014-11-04 00:30:51.000000000 +0100 -+++ ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2015-01-22 21:31:58.000000000 +0100 -@@ -253,10 +253,6 @@ - - - --// hack until arm64 headers are worked out --#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) --#define CPU_SUBTYPE_ARM64_ALL 0 --#define CPU_SUBTYPE_ARM64_V8 1 - - #define ARM64_RELOC_UNSIGNED 0 // for pointers - #define ARM64_RELOC_SUBTRACTOR 1 // must be followed by a ARM64_RELOC_UNSIGNED diff --git a/sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch b/sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch deleted file mode 100644 index 294b05fb88b4..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-atomic-volatile.patch +++ /dev/null @@ -1,27 +0,0 @@ -OSAtmicAdd and friends don't expect volatile parameters on OS X < 10.5. - -diff -ur ld64-241.9/src/ld/InputFiles.h ld64-241.9/src/ld/InputFiles.h ---- ld64-241.9/src/ld/InputFiles.h 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/InputFiles.h 2015-01-22 20:19:51.000000000 +0100 -@@ -86,11 +86,16 @@ - void createIndirectDylibs(); - - // for -print_statistics -- volatile int64_t _totalObjectSize; -- volatile int64_t _totalArchiveSize; -- volatile int32_t _totalObjectLoaded; -- volatile int32_t _totalArchivesLoaded; -- volatile int32_t _totalDylibsLoaded; -+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 -+#define LD_ATOMIC_VOLATILE volatile -+#else -+#define LD_ATOMIC_VOLATILE -+#endif -+ LD_ATOMIC_VOLATILE int64_t _totalObjectSize; -+ LD_ATOMIC_VOLATILE int64_t _totalArchiveSize; -+ LD_ATOMIC_VOLATILE int32_t _totalObjectLoaded; -+ LD_ATOMIC_VOLATILE int32_t _totalArchivesLoaded; -+ LD_ATOMIC_VOLATILE int32_t _totalDylibsLoaded; - - - private: diff --git a/sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch b/sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch deleted file mode 100644 index 833fec2b66e9..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-cc_md5.patch +++ /dev/null @@ -1,24 +0,0 @@ -Provide CC_MD5 on OS X < 10.5. - ---- ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 23:20:33.000000000 +0100 -+++ ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 23:26:02.000000000 +0100 -@@ -71,6 +71,19 @@ - #include "LinkEdit.hpp" - #include "LinkEditClassic.hpp" - -+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 -+/* CC_MD5 missing on < 10.5 - provide replacement */ -+unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned char *md) { -+ CC_MD5_CTX ctx; -+ if(md == NULL) -+ return NULL; -+ -+ CC_MD5_Init(&ctx); -+ CC_MD5_Update(&ctx, data, len); -+ CC_MD5_Final(md, &ctx); -+ return md; -+} -+#endif - - namespace ld { - namespace tool { diff --git a/sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch b/sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch deleted file mode 100644 index f1fbbd82ec37..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-extraneous-includes.patch +++ /dev/null @@ -1,13 +0,0 @@ -Remove unneeded and sometimes missing headers. - -diff -ur ld64-241.9/src/ld/Options.cpp work/ld64-241.9/src/ld/Options.cpp ---- ld64-241.9/src/ld/Options.cpp 2015-01-22 21:42:04.000000000 +0100 -+++ ld64-241.9/src/ld/Options.cpp 2015-01-22 21:45:15.000000000 +0100 -@@ -31,7 +31,6 @@ - #include <fcntl.h> - #include <errno.h> - #include <string.h> --#include <spawn.h> - #include <cxxabi.h> - #include <Availability.h> - diff --git a/sys-devel/binutils-apple/files/ld64-241.9-gcc.patch b/sys-devel/binutils-apple/files/ld64-241.9-gcc.patch deleted file mode 100644 index 06b735b242a5..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-gcc.patch +++ /dev/null @@ -1,1029 +0,0 @@ -Provide c++11 headers from tr1 include directory and namespace. - -Work around weird namespacing bug in gcc-4.2.1 where class ld::Section -conflicts with template mach_o::relocatable::Section by renaming the latter to -MRFSection (could possibly be done using sed from ebuild or avoided by figuring -out, what's actually going on with those namespaces). - ---- ./ld64-241.9/src/ld/InputFiles.h.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/InputFiles.h 2015-01-12 22:12:18.000000000 +0100 -@@ -46,6 +46,14 @@ - #include <pthread.h> - #endif - -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else -+#include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif -+ - #include <vector> - - #include "Options.h" -@@ -107,7 +115,7 @@ - static void parseWorkerThread(InputFiles *inputFiles); - void startThread(void (*threadFunc)(InputFiles *)) const; - -- typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib; -+ typedef std::UNORDERED_MAP<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib; - - const Options& _options; - std::vector<ld::File*> _inputFiles; ---- ./ld64-241.9/src/ld/ld.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/ld.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -54,7 +54,13 @@ - #include <vector> - #include <list> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - #include <cxxabi.h> - - #include "Options.h" -@@ -149,7 +155,7 @@ - struct SectionEquals { - bool operator()(const ld::Section* left, const ld::Section* right) const; - }; -- typedef std::unordered_map<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut; -+ typedef std::UNORDERED_MAP<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut; - - - SectionInToOut _sectionInToFinalMap; ---- ./ld64-241.9/src/ld/ld.hpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/ld.hpp 2015-01-12 22:12:18.000000000 +0100 -@@ -32,7 +32,13 @@ - #include <assert.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "configure.h" - -@@ -822,7 +828,7 @@ - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - --typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -+typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; - - class Internal - { ---- ./ld64-241.9/src/ld/LinkEditClassic.hpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/LinkEditClassic.hpp 2015-01-12 22:12:18.000000000 +0100 -@@ -31,8 +31,13 @@ - #include <limits.h> - #include <unistd.h> - --#include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -92,7 +97,7 @@ - - private: - enum { kBufferSize = 0x01000000 }; -- typedef std::unordered_map<const char*, int32_t, CStringHash, CStringEquals> StringToOffset; -+ typedef std::UNORDERED_MAP<const char*, int32_t, CStringHash, CStringEquals> StringToOffset; - - const uint32_t _pointerSize; - std::vector<char*> _fullBuffers; ---- ./ld64-241.9/src/ld/Options.cpp.gcc 2014-11-04 00:25:08.000000000 +0100 -+++ ./ld64-241.9/src/ld/Options.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -4548,7 +4548,7 @@ - - // make sure all required exported symbols exist - std::vector<const char*> impliedExports; -- for (NameSet::iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) { -+ for (NameSet::const_iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) { - const char* name = *it; - const int len = strlen(name); - if ( (strcmp(&name[len-3], ".eh") == 0) || (strncmp(name, ".objc_category_name_", 20) == 0) ) { -@@ -4580,7 +4580,7 @@ - } - - // make sure all required re-exported symbols exist -- for (NameSet::iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) { -+ for (NameSet::const_iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) { - fInitialUndefines.push_back(*it); - } - ---- ./ld64-241.9/src/ld/Options.h.gcc 2014-11-04 00:29:32.000000000 +0100 -+++ ./ld64-241.9/src/ld/Options.h 2015-01-12 22:12:18.000000000 +0100 -@@ -30,8 +30,17 @@ - #include <mach/machine.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "ld.hpp" - #include "Snapshot.h" -@@ -396,8 +405,8 @@ - bool moveRwSymbol(const char* symName, const char* filePath, const char*& seg, bool& wildCardMatch) const; - - private: -- typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder; -- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet; -+ typedef std::UNORDERED_MAP<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder; -+ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> NameSet; - enum ExportMode { kExportDefault, kExportSome, kDontExportSome }; - enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives }; - enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome }; -@@ -410,8 +419,8 @@ - bool containsNonWildcard(const char*) const; - bool empty() const { return fRegular.empty() && fWildCard.empty(); } - bool hasWildCards() const { return !fWildCard.empty(); } -- NameSet::iterator regularBegin() const { return fRegular.begin(); } -- NameSet::iterator regularEnd() const { return fRegular.end(); } -+ NameSet::const_iterator regularBegin() const { return fRegular.begin(); } -+ NameSet::const_iterator regularEnd() const { return fRegular.end(); } - void remove(const NameSet&); - private: - static bool hasWildCards(const char*); ---- ./ld64-241.9/src/ld/OutputFile.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/OutputFile.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -50,7 +50,13 @@ - #include <vector> - #include <list> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include <CommonCrypto/CommonDigest.h> - #include <AvailabilityMacros.h> -@@ -4748,7 +4754,7 @@ - const char* filename = NULL; - bool wroteStartSO = false; - state.stabs.reserve(atomsNeedingDebugNotes.size()*4); -- std::unordered_set<const char*, CStringHash, CStringEquals> seenFiles; -+ std::UNORDERED_SET<const char*, CStringHash, CStringEquals> seenFiles; - for (std::vector<const ld::Atom*>::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) { - const ld::Atom* atom = *it; - const ld::File* atomFile = atom->file(); ---- ./ld64-241.9/src/ld/parsers/archive_file.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/parsers/archive_file.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -33,7 +33,13 @@ - #include <set> - #include <map> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "MachOFileAbstraction.hpp" - #include "Architectures.hpp" -@@ -112,7 +118,7 @@ - struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint32_t index;}; - bool loadMember(MemberState& state, ld::File::AtomHandler& handler, const char *format, ...) const; - -- typedef std::unordered_map<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap; -+ typedef std::UNORDERED_MAP<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap; - - typedef typename A::P P; - typedef typename A::P::E E; ---- ./ld64-241.9/src/ld/parsers/lto_file.cpp.gcc 2014-11-04 00:59:51.000000000 +0100 -+++ ./ld64-241.9/src/ld/parsers/lto_file.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -33,8 +33,17 @@ - #include <pthread.h> - #include <mach-o/dyld.h> - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "MachOFileAbstraction.hpp" - #include "Architectures.hpp" -@@ -218,8 +227,8 @@ - static void ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t, const char*, void*); - #endif - -- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -- typedef std::unordered_map<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom; -+ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -+ typedef std::UNORDERED_MAP<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom; - - class AtomSyncer : public ld::File::AtomHandler { - public: ---- ./ld64-241.9/src/ld/parsers/macho_dylib_file.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/parsers/macho_dylib_file.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -34,8 +34,17 @@ - #include <vector> - #include <set> - #include <algorithm> --#include <unordered_map> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "Architectures.hpp" - #include "MachOFileAbstraction.hpp" -@@ -193,8 +202,8 @@ - }; - }; - struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; }; -- typedef std::unordered_map<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap; -- typedef std::unordered_set<const char*, CStringHash, ld::CStringEquals> NameSet; -+ typedef std::UNORDERED_MAP<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap; -+ typedef std::UNORDERED_SET<const char*, CStringHash, ld::CStringEquals> NameSet; - - struct Dependent { const char* path; File<A>* dylib; bool reExport; }; - -@@ -562,14 +571,18 @@ - if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u toc entries for %s\n", dynamicInfo->nextdefsym(), this->path()); - const macho_nlist<P>* start = &symbolTable[dynamicInfo->iextdefsym()]; - const macho_nlist<P>* end = &start[dynamicInfo->nextdefsym()]; -+#ifndef __GLIBCXX__ - _atoms.reserve(dynamicInfo->nextdefsym()); // set initial bucket count -+#endif - for (const macho_nlist<P>* sym=start; sym < end; ++sym) { - this->addSymbol(&strings[sym->n_strx()], (sym->n_desc() & N_WEAK_DEF) != 0, false, sym->n_value()); - } - } - else { - int32_t count = dynamicInfo->ntoc(); -+#ifndef __GLIBCXX__ - _atoms.reserve(count); // set initial bucket count -+#endif - if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u entries for %s\n", count, this->path()); - const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo->tocoff()); - for (int32_t i = 0; i < count; ++i) { ---- ./ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp.gcc 2014-11-04 00:57:10.000000000 +0100 -+++ ./ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-12 22:22:53.000000000 +0100 -@@ -62,7 +62,7 @@ - // forward reference - template <typename A> class Parser; - template <typename A> class Atom; --template <typename A> class Section; -+template <typename A> class MRFSection; - template <typename A> class CFISection; - template <typename A> class CUSection; - -@@ -102,14 +102,14 @@ - const uint8_t* fileContent() { return _fileContent; } - private: - friend class Atom<A>; -- friend class Section<A>; -+ friend class MRFSection<A>; - friend class Parser<A>; - friend class CFISection<A>::OAS; - - typedef typename A::P P; - - const uint8_t* _fileContent; -- Section<A>** _sectionsArray; -+ MRFSection<A>** _sectionsArray; - uint8_t* _atomsArray; - uint8_t* _aliasAtomsArray; - uint32_t _sectionsArrayCount; -@@ -134,14 +134,14 @@ - - - template <typename A> --class Section : public ld::Section -+class MRFSection : public ld::Section - { - public: - typedef typename A::P::uint_t pint_t; - typedef typename A::P P; - typedef typename A::P::E E; - -- virtual ~Section() { } -+ virtual ~MRFSection() { } - class File<A>& file() const { return _file; } - const macho_section<P>* machoSection() const { return _machOSection; } - uint32_t sectionNum(class Parser<A>&) const; -@@ -165,10 +165,10 @@ - static const char* makeSectionName(const macho_section<typename A::P>* s); - - protected: -- Section(File<A>& f, const macho_section<typename A::P>* s) -+ MRFSection(File<A>& f, const macho_section<typename A::P>* s) - : ld::Section(makeSegmentName(s), makeSectionName(s), sectionType(s)), - _file(f), _machOSection(s), _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { } -- Section(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false) -+ MRFSection(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false) - : ld::Section(segName, sectName, t, hidden), _file(f), _machOSection(NULL), - _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { } - -@@ -192,11 +192,11 @@ - - - template <typename A> --class CFISection : public Section<A> -+class CFISection : public MRFSection<A> - { - public: - CFISection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - uint32_t cfiCount(Parser<A>& parser); - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeCFI; } -@@ -256,11 +256,11 @@ - - - template <typename A> --class CUSection : public Section<A> -+class CUSection : public MRFSection<A> - { - public: - CUSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - - typedef typename A::P::uint_t pint_t; - typedef typename A::P P; -@@ -297,11 +297,11 @@ - - - template <typename A> --class TentativeDefinitionSection : public Section<A> -+class TentativeDefinitionSection : public MRFSection<A> - { - public: - TentativeDefinitionSection(Parser<A>& parser, File<A>& f) -- : Section<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {} -+ : MRFSection<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {} - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeZeroFill; } - virtual bool addFollowOnFixups() const { return false; } -@@ -319,11 +319,11 @@ - - - template <typename A> --class AbsoluteSymbolSection : public Section<A> -+class AbsoluteSymbolSection : public MRFSection<A> - { - public: - AbsoluteSymbolSection(Parser<A>& parser, File<A>& f) -- : Section<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {} -+ : MRFSection<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {} - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeUnclassified; } - virtual bool dontDeadStrip() { return false; } -@@ -345,7 +345,7 @@ - - - template <typename A> --class SymboledSection : public Section<A> -+class SymboledSection : public MRFSection<A> - { - public: - SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s); -@@ -377,11 +377,11 @@ - - - template <typename A> --class ImplicitSizeSection : public Section<A> -+class ImplicitSizeSection : public MRFSection<A> - { - public: - ImplicitSizeSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - virtual uint32_t computeAtomCount(class Parser<A>& parser, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&); - virtual uint32_t appendAtoms(class Parser<A>& parser, uint8_t* buffer, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&); - protected: -@@ -715,8 +715,8 @@ - - public: - // methods for all atoms from mach-o object file -- Section<A>& sect() const { return (Section<A>&)section(); } -- File<A>& machofile() const { return ((Section<A>*)(this->_section))->file(); } -+ MRFSection<A>& sect() const { return (MRFSection<A>&)section(); } -+ File<A>& machofile() const { return ((MRFSection<A>*)(this->_section))->file(); } - void setFixupsRange(uint32_t s, uint32_t c); - void setUnwindInfoRange(uint32_t s, uint32_t c); - void extendUnwindInfoRange(); -@@ -733,7 +733,7 @@ - typedef typename A::P::E E; - typedef typename A::P::uint_t pint_t; - // constuct via all attributes -- Atom(Section<A>& sct, const char* nm, pint_t addr, uint64_t sz, -+ Atom(MRFSection<A>& sct, const char* nm, pint_t addr, uint64_t sz, - ld::Atom::Definition d, ld::Atom::Combine c, ld::Atom::Scope s, - ld::Atom::ContentType ct, ld::Atom::SymbolTableInclusion i, - bool dds, bool thumb, bool al, ld::Atom::Alignment a) -@@ -743,7 +743,7 @@ - _unwindInfoStartIndex(0), _fixupsCount(0), - _lineInfoCount(0), _unwindInfoCount(0) { } - // construct via symbol table entry -- Atom(Section<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym, -+ Atom(MRFSection<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym, - uint64_t sz, bool alias=false) - : ld::Atom((ld::Section&)sct, parser.definitionFromSymbol(sym), - parser.combineFromSymbol(sym), parser.scopeFromSymbol(sym), -@@ -766,7 +766,7 @@ - - private: - friend class Parser<A>; -- friend class Section<A>; -+ friend class MRFSection<A>; - friend class CStringSection<A>; - friend class AbsoluteSymbolSection<A>; - -@@ -1031,8 +1031,8 @@ - uint32_t undefinedStartIndex() { return _undefinedStartIndex; } - uint32_t undefinedEndIndex() { return _undefinedEndIndex; } - void addFixup(FixupInAtom f) { _allFixups.push_back(f); } -- Section<A>* sectionForNum(unsigned int sectNum); -- Section<A>* sectionForAddress(pint_t addr); -+ MRFSection<A>* sectionForNum(unsigned int sectNum); -+ MRFSection<A>* sectionForAddress(pint_t addr); - Atom<A>* findAtomByAddress(pint_t addr); - Atom<A>* findAtomByAddressOrNullIfStub(pint_t addr); - Atom<A>* findAtomByAddressOrLocalTargetOfStub(pint_t addr, uint32_t* offsetInAtom); -@@ -1074,7 +1074,7 @@ - : sortedSymbolIndexes(ssa), sortedSymbolCount(ssc), cfiStartsArray(cfisa), - cfiStartsCount(cfisc), fileHasOverlappingSymbols(ols), - newSection(false), cfiIndex(0), symIndex(0) {} -- bool next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, -+ bool next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, - pint_t* addr, pint_t* size, const macho_nlist<P>** sym); - pint_t peek(Parser<A>& parser, pint_t startAddr, pint_t endAddr); - void beginSection() { newSection = true; symIndex = 0; } -@@ -1103,7 +1103,7 @@ - - - private: -- friend class Section<A>; -+ friend class MRFSection<A>; - - enum SectionType { sectionTypeIgnore, sectionTypeLiteral4, sectionTypeLiteral8, sectionTypeLiteral16, - sectionTypeNonLazy, sectionTypeCFI, sectionTypeCString, sectionTypeCStringPointer, -@@ -1448,7 +1448,7 @@ - // was becuase of a label, the symbol). Returns false when no more chunks. - // - template <typename A> --bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, -+bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, - pint_t* addr, pint_t* size, const macho_nlist<P>** symbol) - { - // may not be a label on start of section, but need atom demarcation there -@@ -1600,7 +1600,7 @@ - } - - template <> --typename arm::P::uint_t Parser<arm>::realAddr(typename arm::P::uint_t addr) -+arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr) - { - return addr & (-2); - } -@@ -1646,7 +1646,7 @@ - uint32_t sortedSymbolIndexes[_symbolsInSections]; - this->makeSortedSymbolsArray(sortedSymbolIndexes, sortedSectionIndexes); - -- // allocate Section<A> object for each mach-o section -+ // allocate MRFSection<A> object for each mach-o section - makeSections(); - - // if it exists, do special early parsing of __compact_unwind section -@@ -1743,7 +1743,7 @@ - #endif - } - -- Section<A>** sections = _file->_sectionsArray; -+ MRFSection<A>** sections = _file->_sectionsArray; - uint32_t sectionsCount = _file->_sectionsArrayCount; - - // figure out how many atoms will be allocated and allocate -@@ -2306,11 +2306,11 @@ - _file->_swiftVersion = ((flags >> 8) & 0xFF); - if ( sect->size() > 8 ) { - warning("section %s/%s has unexpectedly large size %llu in %s", -- sect->segname(), Section<A>::makeSectionName(sect), sect->size(), _file->path()); -+ sect->segname(), MRFSection<A>::makeSectionName(sect), sect->size(), _file->path()); - } - } - else { -- warning("can't parse %s/%s section in %s", sect->segname(), Section<A>::makeSectionName(sect), _file->path()); -+ warning("can't parse %s/%s section in %s", sect->segname(), MRFSection<A>::makeSectionName(sect), _file->path()); - } - continue; - } -@@ -2406,24 +2406,24 @@ - // sort by address (mach-o object files don't aways have sections sorted) - ::qsort(machOSects, count, sizeof(MachOSectionAndSectionClass<P>), MachOSectionAndSectionClass<P>::sorter); - -- // we will synthesize a dummy Section<A> object for tentative definitions -+ // we will synthesize a dummy MRFSection<A> object for tentative definitions - if ( _tentativeDefinitionCount > 0 ) { - totalSectionsSize += sizeof(TentativeDefinitionSection<A>); - machOSects[count++].type = sectionTypeTentativeDefinitions; - } - -- // we will synthesize a dummy Section<A> object for Absolute symbols -+ // we will synthesize a dummy MRFSection<A> object for Absolute symbols - if ( _absoluteSymbolCount > 0 ) { - totalSectionsSize += sizeof(AbsoluteSymbolSection<A>); - machOSects[count++].type = sectionTypeAbsoluteSymbols; - } - - // allocate one block for all Section objects as well as pointers to each -- uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(Section<A>*)]; -- _file->_sectionsArray = (Section<A>**)space; -+ uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(MRFSection<A>*)]; -+ _file->_sectionsArray = (MRFSection<A>**)space; - _file->_sectionsArrayCount = count; -- Section<A>** objects = _file->_sectionsArray; -- space += count*sizeof(Section<A>*); -+ MRFSection<A>** objects = _file->_sectionsArray; -+ space += count*sizeof(MRFSection<A>*); - for (uint32_t i=0; i < count; ++i) { - switch ( machOSects[i].type ) { - case sectionTypeIgnore: -@@ -2511,7 +2511,7 @@ - - - template <typename A> --Section<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr) -+MRFSection<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr) - { - for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) { - const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection(); -@@ -2538,7 +2538,7 @@ - } - - template <typename A> --Section<A>* Parser<A>::sectionForNum(unsigned int num) -+MRFSection<A>* Parser<A>::sectionForNum(unsigned int num) - { - for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) { - const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection(); -@@ -2554,7 +2554,7 @@ - template <typename A> - Atom<A>* Parser<A>::findAtomByAddress(pint_t addr) - { -- Section<A>* section = this->sectionForAddress(addr); -+ MRFSection<A>* section = this->sectionForAddress(addr); - return section->findAtomByAddress(addr); - } - -@@ -2611,7 +2611,7 @@ - target.addend = 0; - return; - } -- Section<A>* section = this->sectionForAddress(addr); -+ MRFSection<A>* section = this->sectionForAddress(addr); - target.atom = section->findAtomByAddress(addr); - target.addend = addr - target.atom->_objAddress; - target.weakImport = false; -@@ -2659,7 +2659,7 @@ - } - return; - } -- Section<A>* section = this->sectionForNum(sectNum); -+ MRFSection<A>* section = this->sectionForNum(sectNum); - target.atom = section->findAtomByAddress(addr); - if ( target.atom == NULL ) { - typedef typename A::P::sint_t sint_t; -@@ -3867,7 +3867,7 @@ - } - - template <typename A> --const char* Section<A>::makeSegmentName(const macho_section<typename A::P>* sect) -+const char* MRFSection<A>::makeSegmentName(const macho_section<typename A::P>* sect) - { - // mach-o section record only has room for 16-byte seg/sect names - // so a 16-byte name has no trailing zero -@@ -3880,7 +3880,7 @@ - } - - template <typename A> --const char* Section<A>::makeSectionName(const macho_section<typename A::P>* sect) -+const char* MRFSection<A>::makeSectionName(const macho_section<typename A::P>* sect) - { - const char* name = sect->sectname(); - if ( strlen(name) < 16 ) -@@ -3914,13 +3914,13 @@ - } - - template <typename A> --bool Section<A>::readable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::readable(const macho_section<typename A::P>* sect) - { - return true; - } - - template <typename A> --bool Section<A>::writable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::writable(const macho_section<typename A::P>* sect) - { - // mach-o .o files do not contain segment permissions - // we just know TEXT is special -@@ -3928,7 +3928,7 @@ - } - - template <typename A> --bool Section<A>::exectuable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::exectuable(const macho_section<typename A::P>* sect) - { - // mach-o .o files do not contain segment permissions - // we just know TEXT is special -@@ -3937,7 +3937,7 @@ - - - template <typename A> --ld::Section::Type Section<A>::sectionType(const macho_section<typename A::P>* sect) -+ld::Section::Type MRFSection<A>::sectionType(const macho_section<typename A::P>* sect) - { - switch ( sect->flags() & SECTION_TYPE ) { - case S_ZEROFILL: -@@ -4015,7 +4015,7 @@ - - - template <typename A> --Atom<A>* Section<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end) -+Atom<A>* MRFSection<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end) - { - // do a binary search of atom array - uint32_t atomCount = end - start; -@@ -4047,7 +4047,7 @@ - } - - template <typename A> --ld::Atom::Alignment Section<A>::alignmentForAddress(pint_t addr) -+ld::Atom::Alignment MRFSection<A>::alignmentForAddress(pint_t addr) - { - const uint32_t sectionAlignment = this->_machOSection->align(); - uint32_t modulus = (addr % (1 << sectionAlignment)); -@@ -4057,7 +4057,7 @@ - } - - template <typename A> --uint32_t Section<A>::sectionNum(class Parser<A>& parser) const -+uint32_t MRFSection<A>::sectionNum(class Parser<A>& parser) const - { - if ( _machOSection == NULL ) - return 0; -@@ -4650,7 +4650,7 @@ - // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t nlPointerAddr = *content; -- Section<x86>* nlSection = parser.sectionForAddress(nlPointerAddr); -+ MRFSection<x86>* nlSection = parser.sectionForAddress(nlPointerAddr); - if ( nlSection->type() == ld::Section::typeCode ) { - // personality function is defined in this .o file, so this is a direct reference to it - // atoms may not be constructed yet, so scan symbol table for labels -@@ -4677,7 +4677,7 @@ - else { - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t personalityAddr = *content; -- Section<arm64>* personalitySection = parser.sectionForAddress(personalityAddr); -+ MRFSection<arm64>* personalitySection = parser.sectionForAddress(personalityAddr); - assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function"); - // atoms may not be constructed yet, so scan symbol table for labels - const char* name = parser.scanSymbolTableForAddress(personalityAddr); -@@ -4831,7 +4831,7 @@ - - template <typename A> - SymboledSection<A>::SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s), _type(ld::Atom::typeUnclassified) -+ : MRFSection<A>(f, s), _type(ld::Atom::typeUnclassified) - { - switch ( s->flags() & SECTION_TYPE ) { - case S_ZEROFILL: -@@ -4877,7 +4877,7 @@ - if ( ! this->_file.canScatterAtoms() ) - return true; - // call inherited -- return Section<A>::dontDeadStrip(); -+ return MRFSection<A>::dontDeadStrip(); - } - return false; - } -@@ -5724,7 +5724,7 @@ - - - template <> --uint32_t Section<x86_64>::x86_64PcRelOffset(uint8_t r_type) -+uint32_t MRFSection<x86_64>::x86_64PcRelOffset(uint8_t r_type) - { - switch ( r_type ) { - case X86_64_RELOC_SIGNED: -@@ -5741,7 +5741,7 @@ - - - template <> --bool Section<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - uint64_t srcAddr = sect->addr() + reloc->r_address(); -@@ -5948,7 +5948,7 @@ - - - template <> --bool Section<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - uint32_t srcAddr; -@@ -6189,7 +6189,7 @@ - - #if SUPPORT_ARCH_arm_any - template <> --bool Section<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - bool result = false; -@@ -6656,7 +6656,7 @@ - - #if SUPPORT_ARCH_arm64 - template <> --bool Section<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc) - { - bool result = false; - Parser<arm64>::SourceLocation src; -@@ -7054,7 +7054,7 @@ - - #if SUPPORT_ARCH_arm64 - template <> --void Section<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) { -+void MRFSection<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) { - switch (kind) { - case LOH_ARM64_ADRP_ADRP: - case LOH_ARM64_ADRP_LDR: -@@ -7109,18 +7109,18 @@ - extra.info.delta2 = (count > 1) ? ((addrs[1] - lowestAddress) >> 2) : 0; - extra.info.delta3 = (count > 2) ? ((addrs[2] - lowestAddress) >> 2) : 0; - extra.info.delta4 = (count > 3) ? ((addrs[3] - lowestAddress) >> 2) : 0; -- typename Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress()); -+ Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress()); - parser.addFixup(src, ld::Fixup::k1of1, ld::Fixup::kindLinkerOptimizationHint, extra.addend); - } - #endif - - template <typename A> --void Section<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) { -+void MRFSection<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) { - - } - - template <typename A> --void Section<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&) -+void MRFSection<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&) - { - const macho_section<P>* sect = this->machoSection(); - const macho_relocation_info<P>* relocs = (macho_relocation_info<P>*)(file().fileContent() + sect->reloff()); -@@ -7131,7 +7131,7 @@ - ++r; // skip next - } - catch (const char* msg) { -- throwf("in section %s,%s reloc %u: %s", sect->segname(), Section<A>::makeSectionName(sect), r, msg); -+ throwf("in section %s,%s reloc %u: %s", sect->segname(), MRFSection<A>::makeSectionName(sect), r, msg); - } - } - -@@ -7157,7 +7157,7 @@ - } - if ( !this->_altEntries.empty() && !this->addFollowOnFixups() ) { - if ( _altEntries.count(_beginAtoms) != 0 ) -- warning("N_ALT_ENTRY bit set on first atom in section %s/%s", sect->segname(), Section<A>::makeSectionName(sect)); -+ warning("N_ALT_ENTRY bit set on first atom in section %s/%s", sect->segname(), MRFSection<A>::makeSectionName(sect)); - - Atom<A>* end = &_endAtoms[-1]; - for(Atom<A>* p = _beginAtoms; p < end; ++p) { ---- ./ld64-241.9/src/ld/passes/dtrace_dof.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/passes/dtrace_dof.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -30,8 +30,17 @@ - - #include <vector> - #include <map> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#include <tr1/unordered_set> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_map> - #include <unordered_set> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "ld.hpp" - #include "MachOFileAbstraction.hpp" -@@ -111,8 +120,8 @@ - uint32_t offset; - const char* probeName; - }; --typedef std::unordered_map<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes; --typedef std::unordered_set<const char*, CStringHash, CStringEquals> CStringSet; -+typedef std::UNORDERED_MAP<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes; -+typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> CStringSet; - - - ---- ./ld64-241.9/src/ld/passes/order.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/passes/order.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -32,7 +32,13 @@ - #include <vector> - #include <map> - #include <set> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "ld.hpp" - #include "order.h" -@@ -85,7 +91,7 @@ - ld::Internal& _state; - }; - -- typedef std::unordered_map<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom; -+ typedef std::UNORDERED_MAP<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom; - - typedef std::map<const ld::Atom*, const ld::Atom*> AtomToAtom; - ---- ./ld64-241.9/src/ld/Resolver.h.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/Resolver.h 2015-01-12 22:12:18.000000000 +0100 -@@ -42,7 +42,13 @@ - #include <mach-o/dyld.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -105,7 +111,7 @@ - void doLinkerOption(const std::vector<const char*>& linkerOption, const char* fileName); - void dumpAtoms(); - -- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet; -+ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet; - - class NotLive { - public: ---- ./ld64-241.9/src/ld/SymbolTable.h.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/ld/SymbolTable.h 2015-01-12 22:12:18.000000000 +0100 -@@ -42,7 +42,13 @@ - #include <mach-o/dyld.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -57,38 +63,38 @@ - typedef uint32_t IndirectBindingSlot; - - private: -- typedef std::unordered_map<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot; -+ typedef std::UNORDERED_MAP<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot; - - class ContentFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot; - - class ReferencesHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot; - - class CStringHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot; - - class UTF16StringHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot; - - typedef std::map<IndirectBindingSlot, const char*> SlotToName; -- typedef std::unordered_map<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap; -+ typedef std::UNORDERED_MAP<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap; - - typedef std::vector<const ld::Atom *> DuplicatedSymbolAtomList; - typedef std::map<const char *, DuplicatedSymbolAtomList * > DuplicateSymbols; ---- ./ld64-241.9/src/other/dyldinfo.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/other/dyldinfo.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -33,7 +33,6 @@ - - #include <vector> - #include <set> --#include <unordered_set> - - #include "configure.h" - #include "MachOFileAbstraction.hpp" ---- ./ld64-241.9/src/other/machochecker.cpp.gcc 2014-09-11 00:24:46.000000000 +0200 -+++ ./ld64-241.9/src/other/machochecker.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -33,7 +33,13 @@ - - #include <vector> - #include <set> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "configure.h" - -@@ -124,7 +130,7 @@ - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - -- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet; -+ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet; - - MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path); - void checkMachHeader(); ---- ./ld64-241.9/src/other/unwinddump.cpp.gcc 2014-11-04 00:56:18.000000000 +0100 -+++ ./ld64-241.9/src/other/unwinddump.cpp 2015-01-12 22:12:18.000000000 +0100 -@@ -33,7 +33,6 @@ - - #include <vector> - #include <set> --#include <unordered_set> - - #include "configure.h" - #include "MachOFileAbstraction.hpp" diff --git a/sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch b/sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch deleted file mode 100644 index 58579f007de7..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-get-comm-align.patch +++ /dev/null @@ -1,30 +0,0 @@ -Provide macros [GS]ET_COMM_ALIGN if it's missing (<= 10.4). - ---- ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 22:23:11.000000000 +0100 -+++ ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 22:28:03.000000000 +0100 -@@ -51,6 +51,10 @@ - #include "macho_relocatable_file.h" - - -+/* missing on < 10.5 */ -+#if !defined(GET_COMM_ALIGN) -+#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f) -+#endif - - extern void throwf(const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2))); - extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2))); ---- Gentoo/tmp/var/tmp/portage/sys-devel/binutils-apple-6.1/work/ld64-241.9/src/ld/LinkEditClassic.hpp 2015-01-22 22:29:14.000000000 +0100 -+++ ld64-241.9/src/ld/LinkEditClassic.hpp 2015-01-22 22:31:23.000000000 +0100 -@@ -39,6 +39,12 @@ - #define UNORDERED_MAP unordered_map - #endif - -+#if !defined(SET_COMM_ALIGN) -+/* missing on < 10.5 */ -+#define SET_COMM_ALIGN(n_desc,align) \ -+ (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8)) -+#endif -+ - #include "Options.h" - #include "ld.hpp" - #include "Architectures.hpp" diff --git a/sys-devel/binutils-apple/files/ld64-241.9-lto-noremarks.patch b/sys-devel/binutils-apple/files/ld64-241.9-lto-noremarks.patch deleted file mode 100644 index d4667ab63b8c..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-lto-noremarks.patch +++ /dev/null @@ -1,107 +0,0 @@ -Shut up ld64 by default when using LTO. - -diff -ru ld64-241.9.orig/src/ld/Options.cpp ld64-241.9/src/ld/Options.cpp ---- ld64-241.9.orig/src/ld/Options.cpp 2015-02-02 22:14:29.000000000 +0100 -+++ ld64-241.9/src/ld/Options.cpp 2015-02-02 22:15:41.000000000 +0100 -@@ -183,6 +183,9 @@ - fDebugInfoStripping(kDebugInfoMinimal), fTraceOutputFile(NULL), - fMacVersionMin(ld::macVersionUnset), fIOSVersionMin(ld::iOSVersionUnset), - fSaveTempFiles(false), -+#ifdef LTO -+ fVerboseLTORemarks(false), -+#endif - #ifdef SUPPORT_SNAPSHOTS - fSnapshotRequested(false), - #endif -@@ -3138,6 +3141,11 @@ - else if ( strcmp(arg, "-ignore_optimization_hints") == 0 ) { - fIgnoreOptimizationHints = true; - } -+#ifdef LTO -+ else if ( strcmp(arg, "-verbose_lto_remarks") == 0 ) { -+ fVerboseLTORemarks = true; -+ } -+#endif - else if ( strcmp(arg, "-no_dtrace_dof") == 0 ) { - fGenerateDtraceDOF = false; - } -Only in ld64-241.9/src/ld: Options.cpp~ -diff -ru ld64-241.9.orig/src/ld/Options.h ld64-241.9/src/ld/Options.h ---- ld64-241.9.orig/src/ld/Options.h 2015-02-02 22:14:29.000000000 +0100 -+++ ld64-241.9/src/ld/Options.h 2015-02-02 22:16:36.000000000 +0100 -@@ -381,6 +381,9 @@ - bool forceWeakNonWildCard(const char* symbolName) const; - bool forceNotWeakNonWildcard(const char* symbolName) const; - bool forceCoalesce(const char* symbolName) const; -+#ifdef LTO -+ bool verboseLTORemarks() const { return fVerboseLTORemarks; } -+#endif - #ifdef SUPPORT_SNAPSHOTS - Snapshot& snapshot() const { return fLinkSnapshot; } - #endif -@@ -681,6 +684,9 @@ - std::vector<SymbolsMove> fSymbolsMovesCode; - std::vector<SymbolsMove> fSymbolsMovesZeroFill; - bool fSaveTempFiles; -+#ifdef LTO -+ bool fVerboseLTORemarks; -+#endif - #ifdef SUPPORT_SNAPSHOTS - mutable Snapshot fLinkSnapshot; - bool fSnapshotRequested; -Only in ld64-241.9/src/ld: Options.h~ -diff -ru ld64-241.9.orig/src/ld/Resolver.cpp ld64-241.9/src/ld/Resolver.cpp ---- ld64-241.9.orig/src/ld/Resolver.cpp 2015-02-02 22:14:29.000000000 +0100 -+++ ld64-241.9/src/ld/Resolver.cpp 2015-02-02 22:17:16.000000000 +0100 -@@ -1559,6 +1559,7 @@ - optOpt.mcpu = _options.mcpuLTO(); - optOpt.llvmOptions = &_options.llvmOptions(); - optOpt.initialUndefines = &_options.initialUndefines(); -+ optOpt.verboseLTORemarks = _options.verboseLTORemarks(); - - std::vector<const ld::Atom*> newAtoms; - std::vector<const char*> additionalUndefines; -Only in ld64-241.9/src/ld: Resolver.cpp~ -diff -ru ld64-241.9.orig/src/ld/parsers/lto_file.cpp ld64-241.9/src/ld/parsers/lto_file.cpp ---- ld64-241.9.orig/src/ld/parsers/lto_file.cpp 2015-02-02 22:14:29.000000000 +0100 -+++ ld64-241.9/src/ld/parsers/lto_file.cpp 2015-02-02 22:18:27.000000000 +0100 -@@ -489,13 +489,17 @@ - - - #if LTO_API_VERSION >= 7 --void Parser::ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t severity, const char* message, void*) -+void Parser::ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t severity, const char* message, void* data) - { - switch ( severity ) { - #if LTO_API_VERSION >= 10 - case LTO_DS_REMARK: -+ { -+ const OptimizeOptions* options = (const OptimizeOptions*)data; -+ if (options->verboseLTORemarks) - fprintf(stderr, "ld: LTO remark: %s\n", message); - break; -+ } - #endif - case LTO_DS_NOTE: - case LTO_DS_WARNING: -@@ -530,7 +533,7 @@ - // create optimizer and add each Reader - lto_code_gen_t generator = ::lto_codegen_create(); - #if LTO_API_VERSION >= 7 -- lto_codegen_set_diagnostic_handler(generator, ltoDiagnosticHandler, NULL); -+ lto_codegen_set_diagnostic_handler(generator, ltoDiagnosticHandler, (void*)&options); - #endif - - // <rdar://problem/12379604> The order that files are merged must match command line order -Only in ld64-241.9/src/ld/parsers: lto_file.cpp~ -diff -ru ld64-241.9.orig/src/ld/parsers/lto_file.h ld64-241.9/src/ld/parsers/lto_file.h ---- ld64-241.9.orig/src/ld/parsers/lto_file.h 2015-02-02 22:14:29.000000000 +0100 -+++ ld64-241.9/src/ld/parsers/lto_file.h 2015-02-02 22:18:57.000000000 +0100 -@@ -61,6 +61,7 @@ - const char* mcpu; - const std::vector<const char*>* llvmOptions; - const std::vector<const char*>* initialUndefines; -+ bool verboseLTORemarks; - }; - - extern bool optimize( const std::vector<const ld::Atom*>& allAtoms, diff --git a/sys-devel/binutils-apple/files/ld64-241.9-noarm.patch b/sys-devel/binutils-apple/files/ld64-241.9-noarm.patch deleted file mode 100644 index 24d288467433..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-noarm.patch +++ /dev/null @@ -1,1288 +0,0 @@ -Fully conditionalise arm support so it can be disabled on 10.4. - -diff -ur ld64-241.9/src/abstraction/MachOFileAbstraction.hpp ld64-241.9/src/abstraction/MachOFileAbstraction.hpp ---- ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2014-11-04 00:30:51.000000000 +0100 -+++ ld64-241.9/src/abstraction/MachOFileAbstraction.hpp 2015-01-22 05:53:13.000000000 +0100 -diff -ur ld64-241.9/src/ld/HeaderAndLoadCommands.hpp ld64-241.9/src/ld/HeaderAndLoadCommands.hpp ---- ld64-241.9/src/ld/HeaderAndLoadCommands.hpp 2014-09-11 00:24:46.000000000 +0200 -+++ ld64-241.9/src/ld/HeaderAndLoadCommands.hpp 2015-01-22 06:46:10.000000000 +0100 -@@ -607,8 +607,12 @@ - - template <> uint32_t HeaderAndLoadCommandsAtom<x86>::cpuType() const { return CPU_TYPE_I386; } - template <> uint32_t HeaderAndLoadCommandsAtom<x86_64>::cpuType() const { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> uint32_t HeaderAndLoadCommandsAtom<arm>::cpuType() const { return CPU_TYPE_ARM; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuType() const { return CPU_TYPE_ARM64; } -+#endif - - - -@@ -627,17 +631,21 @@ - return _state.cpuSubType; - } - -+#if SUPPORT_ARCH_arm_any - template <> - uint32_t HeaderAndLoadCommandsAtom<arm>::cpuSubType() const - { - return _state.cpuSubType; - } -+#endif - -+#if SUPPORT_ARCH_arm64 - template <> - uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuSubType() const - { - return CPU_SUBTYPE_ARM64_ALL; - } -+#endif - - - -diff -ur ld64-241.9/src/ld/LinkEdit.hpp ld64-241.9/src/ld/LinkEdit.hpp ---- ld64-241.9/src/ld/LinkEdit.hpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/LinkEdit.hpp 2015-01-22 05:32:47.000000000 +0100 -@@ -1595,6 +1595,7 @@ - for (ld::Fixup::iterator fit = atom->fixupsBegin(); fit != atom->fixupsEnd(); ++fit) { - if ( fit->kind != ld::Fixup::kindLinkerOptimizationHint) - continue; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 extra; - extra.addend = fit->u.addend; - _encodedData.append_uleb128(extra.info.kind); -@@ -1606,6 +1607,7 @@ - _encodedData.append_uleb128((extra.info.delta3 << 2) + fit->offsetInAtom + address); - if ( extra.info.count > 2 ) - _encodedData.append_uleb128((extra.info.delta4 << 2) + fit->offsetInAtom + address); -+#endif - } - } - } -diff -ur ld64-241.9/src/ld/Options.cpp ld64-241.9/src/ld/Options.cpp ---- ld64-241.9/src/ld/Options.cpp 2015-01-22 20:59:48.000000000 +0100 -+++ ld64-241.9/src/ld/Options.cpp 2015-01-22 20:52:17.000000000 +0100 -@@ -580,8 +580,13 @@ - #endif - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif -+#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64 - if ( (fMacVersionMin == ld::macVersionUnset) && (fIOSVersionMin == ld::iOSVersionUnset) && (fOutputKind != Options::kObjectFile) ) { - #if defined(DEFAULT_IPHONEOS_MIN_VERSION) - warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION); -@@ -592,6 +597,7 @@ - #endif - } - break; -+#endif - } - #ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordArch(fArchitectureName); -@@ -1683,9 +1689,11 @@ - symbolStart = NULL; - } - else if ( strncmp(symbolStart, "arm:", 4) == 0 ) { -+#if SUPPORT_ARCH_arm_any - if ( fArchitecture == CPU_TYPE_ARM ) - symbolStart = &symbolStart[4]; - else -+#endif - symbolStart = NULL; - } - if ( symbolStart != NULL ) { -@@ -3668,6 +3676,7 @@ - #endif - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) { - #if defined(DEFAULT_IPHONEOS_MIN_VERSION) -@@ -3679,6 +3688,7 @@ - #endif - } - break; -+#endif - default: - // architecture will be infered later by examining .o files - break; -@@ -3701,12 +3711,14 @@ - fMacVersionMin = ld::mac10_4; - } - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - if ( fIOSVersionMin < ld::iOS_7_0 ) { - //warning("-mios_version_min should be 7.0 or later for arm64"); - fIOSVersionMin = ld::iOS_7_0; - } - break; -+#endif - } - - // default to adding functions start for dynamic code, static code must opt-in -@@ -3746,6 +3758,7 @@ - fAllowTextRelocs = true; - fUndefinedTreatment = kUndefinedDynamicLookup; - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - // arm64 uses new MH_KEXT_BUNDLE type - fMakeCompressedDyldInfo = false; -@@ -3754,6 +3767,8 @@ - fKextsUseStubs = true; - fUndefinedTreatment = kUndefinedDynamicLookup; - break; -+#endif -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fIOSVersionMin >= ld::iOS_5_0 ) { - // iOS 5.0 and later use new MH_KEXT_BUNDLE type -@@ -3765,6 +3780,7 @@ - fUndefinedTreatment = kUndefinedDynamicLookup; - break; - } -+#endif - // else use object file - case CPU_TYPE_I386: - // use .o files -@@ -3817,6 +3833,7 @@ - if ( fSplitSegs && (fBaseWritableAddress-fBaseAddress != 0x10000000) ) - fBaseWritableAddress = fBaseAddress + 0x10000000; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fOutputKind != Options::kDynamicLibrary ) { - fSplitSegs = false; -@@ -3827,6 +3844,7 @@ - fBaseWritableAddress = fBaseAddress + 0x08000000; - } - break; -+#endif - default: - fSplitSegs = false; - fBaseAddress = 0; -@@ -3841,6 +3859,7 @@ - break; - case CPU_TYPE_X86_64: - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - switch ( fOutputKind ) { - case Options::kDynamicExecutable: -@@ -3863,6 +3882,7 @@ - fBaseAddress = 0; - } - break; -+#endif - } - - // <rdar://problem/6138961> -r implies no prebinding for all architectures -@@ -3908,6 +3928,7 @@ - case CPU_TYPE_X86_64: - fPrebind = false; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - switch ( fOutputKind ) { - case Options::kDynamicExecutable: -@@ -3925,6 +3946,7 @@ - break; - } - break; -+#endif - } - } - -@@ -3951,10 +3973,12 @@ - case CPU_TYPE_I386: - if ( fIOSVersionMin != ld::iOSVersionUnset ) // simulator never needs modules - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fPrebind ) - fNeedsModuleTable = true; // redo_prebinding requires a module table - break; -+#endif - } - } - -@@ -3993,7 +3993,9 @@ - switch ( fArchitecture ) { - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - switch ( fOutputKind ) { - case Options::kObjectFile: - case Options::kStaticExecutable: -@@ -4010,10 +4012,12 @@ - break; - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - fAddCompactUnwindEncoding = false; - fRemoveDwarfUnwindIfCompactExists = false; - break; -+#endif - case 0: - // if -arch is missing, assume we don't want compact unwind info - fAddCompactUnwindEncoding = false; -@@ -4015,7 +4043,15 @@ - fEncryptable = false; - break; - } -- if ( (fArchitecture != CPU_TYPE_ARM) && (fArchitecture != CPU_TYPE_ARM64) ) -+ if ( -+#if SUPPORT_ARCH_arm_any -+ (fArchitecture != CPU_TYPE_ARM) && -+#endif -+#if SUPPORT_ARCH_arm64 -+ (fArchitecture != CPU_TYPE_ARM64) && -+#endif -+ 1 -+ ) - fEncryptable = false; - - // don't move inits in dyld because dyld wants certain -@@ -4067,11 +4103,15 @@ - - // only ARM and x86_64 enforces that cpu-sub-types must match - switch ( fArchitecture ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - case CPU_TYPE_X86_64: - break; - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - fAllowCpuSubtypeMismatches = true; - break; - } -@@ -4117,6 +4157,7 @@ - fPositionIndependentExecutable = true; - } - -+#if SUPPORT_ARCH_arm_any - // armv7 for iOS4.3 defaults to PIE - if ( (fArchitecture == CPU_TYPE_ARM) - && fArchSupportsThumb2 -@@ -4124,6 +4165,7 @@ - && (fIOSVersionMin >= ld::iOS_4_3) ) { - fPositionIndependentExecutable = true; - } -+#endif - - // Simulator defaults to PIE - if ( fTargetIOSSimulator && (fOutputKind == kDynamicExecutable) ) -@@ -4133,10 +4175,12 @@ - if ( fDisablePositionIndependentExecutable ) - fPositionIndependentExecutable = false; - -+#if SUPPORT_ARCH_arm64 - // arm64 is always PIE - if ( (fArchitecture == CPU_TYPE_ARM64) && (fOutputKind == kDynamicExecutable) ) { - fPositionIndependentExecutable = true; - } -+#endif - - // set fOutputSlidable - switch ( fOutputKind ) { -@@ -4162,9 +4206,11 @@ - if ( fMacVersionMin >= ld::mac10_7 ) { - fTLVSupport = true; - } -+#if SUPPORT_ARCH_arm64 - else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= ld::iOS_8_0) ) { - fTLVSupport = true; - } -+#endif - - // default to adding version load command for dynamic code, static code must opt-in - switch ( fOutputKind ) { -@@ -4369,9 +4415,15 @@ - // <rdar://problem/12258065> ARM64 needs 16KB page size for user land code - // <rdar://problem/15974532> make armv7[s] use 16KB pages in user land code for iOS 8 or later - if ( fSegmentAlignment == 4096 ) { -- if ( (fArchitecture == CPU_TYPE_ARM64) -- || ((fArchitecture == CPU_TYPE_ARM) && (fIOSVersionMin >= ld::iOS_8_0) && -- ((fSubArchitecture == CPU_SUBTYPE_ARM_V7S) || (fSubArchitecture == CPU_SUBTYPE_ARM_V7))) ) { -+ if ( -+#if SUPPORT_ARCH_arm64 -+ (fArchitecture == CPU_TYPE_ARM64) || -+#endif -+#if SUPPORT_ARCH_arm_any -+ ((fArchitecture == CPU_TYPE_ARM) && (fIOSVersionMin >= ld::iOS_8_0) && -+ ((fSubArchitecture == CPU_SUBTYPE_ARM_V7S) || (fSubArchitecture == CPU_SUBTYPE_ARM_V7))) || -+#endif -+ 0) { - switch ( fOutputKind ) { - case Options::kDynamicExecutable: - case Options::kDynamicLibrary: -@@ -4488,12 +4540,16 @@ - if ( fStackAddr != 0 ) { - switch (fArchitecture) { - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - if ( fStackAddr > 0xFFFFFFFFULL ) - throw "-stack_addr must be < 4G for 32-bit processes"; - break; - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - break; - } - if ( (fStackAddr & -4096) != fStackAddr ) -@@ -4514,6 +4570,7 @@ - if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) ) - warning("custom stack placement overlaps and will disable shared region"); - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fStackSize > 0x2F000000 ) - throw "-stack_size must be < 752MB"; -@@ -4522,11 +4579,13 @@ - if ( fStackAddr > 0x30000000ULL) - throw "-stack_addr must be < 0x30000000 for arm"; - break; -+#endif - case CPU_TYPE_X86_64: - if ( fStackAddr == 0 ) { - fStackAddr = 0x00007FFF5C000000ULL; - } - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - if ( fStackSize > 0x20000000 ) - throw "-stack_size must be < 512MB"; -@@ -4534,6 +4593,7 @@ - fStackAddr = 0x120000000ULL; - } - break; -+#endif - } - if ( (fStackSize & -4096) != fStackSize ) - throw "-stack_size must be multiples of 4K"; -@@ -4643,8 +4703,12 @@ - alterObjC1ClassNamesToObjC2 = true; - break; - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - alterObjC1ClassNamesToObjC2 = true; - break; - } -@@ -4799,11 +4799,15 @@ - // zero page size not specified on command line, set default - switch (fArchitecture) { - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - // first 4KB for 32-bit architectures - fZeroPageSize = 0x1000; - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - case CPU_TYPE_X86_64: - // first 4GB for x86_64 on all OS's - fZeroPageSize = 0x100000000ULL; -@@ -4842,9 +4910,11 @@ - - // -force_cpusubtype_ALL is not supported for ARM - if ( fForceSubtypeAll ) { -+#if SUPPORT_ARCH_arm_any - if ( fArchitecture == CPU_TYPE_ARM ) { - warning("-force_cpusubtype_ALL will become unsupported for ARM architectures"); - } -+#endif - } - - // -reexported_symbols_list can only be used with -dynamiclib -diff -ur ld64-241.9/src/ld/OutputFile.cpp ld64-241.9/src/ld/OutputFile.cpp ---- ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/OutputFile.cpp 2015-01-22 20:16:24.000000000 +0100 -@@ -631,7 +631,12 @@ - // is encoded in mach-o the same as: - // .long _foo + 0x40000000 - // so if _foo lays out to 0xC0000100, the first is ok, but the second is not. -- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) { -+ if ( -+#if SUPPORT_ARCH_arm_any -+ (_options.architecture() == CPU_TYPE_ARM) || -+#endif -+ (_options.architecture() == CPU_TYPE_I386) || -+ 0) { - // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static - if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) { - warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", -@@ -1235,22 +1240,26 @@ - return false; - const ld::Fixup* f; - switch ( fixup->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64Page21: - return !mustBeGOT; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21: - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPage21: - return true; -+#endif - case ld::Fixup::kindSetTargetAddress: - f = fixup; - do { - ++f; - } while ( ! f->lastInCluster() ); - switch (f->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64Page21: - return !mustBeGOT; - case ld::Fixup::kindStoreARM64GOTLoadPage21: - case ld::Fixup::kindStoreARM64GOTLeaPage21: - return true; -+#endif - default: - break; - } -@@ -1267,22 +1276,26 @@ - return false; - const ld::Fixup* f; - switch ( fixup->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64PageOff12: - return !mustBeGOT; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPageOff12: - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12: - return true; -+#endif - case ld::Fixup::kindSetTargetAddress: - f = fixup; - do { - ++f; - } while ( ! f->lastInCluster() ); - switch (f->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64PageOff12: - return !mustBeGOT; - case ld::Fixup::kindStoreARM64GOTLoadPageOff12: - case ld::Fixup::kindStoreARM64GOTLeaPageOff12: - return true; -+#endif - default: - break; - } -@@ -1318,7 +1331,9 @@ - std::map<uint32_t, const Fixup*> usedByHints; - for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) { - uint8_t* fixUpLocation = &buffer[fit->offsetInAtom]; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 lohExtra; -+#endif - switch ( (ld::Fixup::Kind)(fit->kind) ) { - case ld::Fixup::kindNone: - case ld::Fixup::kindNoneFollowOn: -@@ -1580,6 +1595,7 @@ - break; - case ld::Fixup::kindLinkerOptimizationHint: - // expand table of address/offsets used by hints -+#if SUPPORT_ARCH_arm64 - lohExtra.addend = fit->u.addend; - usedByHints[fit->offsetInAtom + (lohExtra.info.delta1 << 2)] = NULL; - if ( lohExtra.info.count > 0 ) -@@ -1588,6 +1604,7 @@ - usedByHints[fit->offsetInAtom + (lohExtra.info.delta3 << 2)] = NULL; - if ( lohExtra.info.count > 2 ) - usedByHints[fit->offsetInAtom + (lohExtra.info.delta4 << 2)] = NULL; -+#endif - break; - case ld::Fixup::kindStoreTargetAddressLittleEndian32: - accumulator = addressOf(state, fit, &toTarget); -@@ -2095,6 +2112,7 @@ - //uint8_t loadSize, destReg; - //uint32_t scaledOffset; - //uint32_t imm12; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 alt; - alt.addend = fit->u.addend; - setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA); -@@ -2453,6 +2471,7 @@ - fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress); - break; - } -+#endif - } - // apply hints pass 2 - for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) { -@@ -2460,6 +2479,7 @@ - continue; - InstructionInfo infoA; - InstructionInfo infoB; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 alt; - alt.addend = fit->u.addend; - setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA); -@@ -2491,6 +2511,7 @@ - } - break; - } -+#endif - } - } - #endif // SUPPORT_ARCH_arm64 -@@ -2505,6 +2526,7 @@ - for (uint8_t* p=from; p < to; ++p) - *p = 0x90; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( thumb ) { - for (uint8_t* p=from; p < to; p += 2) -@@ -2515,6 +2537,7 @@ - OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000); - } - break; -+#endif - default: - for (uint8_t* p=from; p < to; ++p) - *p = 0x00; -@@ -2843,7 +2866,11 @@ - - // in -r mode, clarify symbolTableNotInFinalLinkedImages - if ( _options.outputKind() == Options::kObjectFile ) { -- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0 ) { - // x86_64 .o files need labels on anonymous literal strings - if ( (sect->type() == ld::Section::typeCString) && (atom->combine() == ld::Atom::combineByNameAndContent) ) { - (const_cast<ld::Atom*>(atom))->setSymbolTableInclusion(ld::Atom::symbolTableIn); -@@ -4071,8 +4098,10 @@ - if ( _options.sharedRegionEligible() ) { - // <rdar://problem/13287063> when range checking, ignore high byte of arm64 addends - uint64_t checkAddend = addend; -+#if SUPPORT_ARCH_arm64 - if ( _options.architecture() == CPU_TYPE_ARM64 ) - checkAddend &= 0x0FFFFFFFFFFFFFFFULL; -+#endif - if ( checkAddend != 0 ) { - // make sure the addend does not cause the pointer to point outside the target's segment - // if it does, update_dyld_shared_cache will not be able to put this dylib into the shared cache -@@ -4279,12 +4308,17 @@ - - bool OutputFile::useExternalSectionReloc(const ld::Atom* atom, const ld::Atom* target, ld::Fixup* fixupWithTarget) - { -- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0) { - // x86_64 and ARM64 use external relocations for everthing that has a symbol - return ( target->symbolTableInclusion() != ld::Atom::symbolTableNotIn ); - } - - // <rdar://problem/9513487> support arm branch interworking in -r mode -+#if SUPPORT_ARCH_arm_any - if ( (_options.architecture() == CPU_TYPE_ARM) && (_options.outputKind() == Options::kObjectFile) ) { - if ( atom->isThumb() != target->isThumb() ) { - switch ( fixupWithTarget->kind ) { -@@ -4298,6 +4332,7 @@ - } - } - } -+#endif - - if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) { - if ( target->contentType() == ld::Atom::typeTLV ) -@@ -4365,7 +4400,11 @@ - bool minusTargetUsesExternalReloc = (minusTarget != NULL) && this->useExternalSectionReloc(atom, minusTarget, fixupWithMinusTarget); - - // in x86_64 and arm64 .o files an external reloc means the content contains just the addend -- if ( (_options.architecture() == CPU_TYPE_X86_64) ||(_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0 ) { - if ( targetUsesExternalReloc ) { - fixupWithTarget->contentAddendOnly = true; - fixupWithStore->contentAddendOnly = true; -Only in ld64-241.9/src/ld: OutputFile.o -diff -ur ld64-241.9/src/ld/Resolver.cpp ld64-241.9/src/ld/Resolver.cpp ---- ld64-241.9/src/ld/Resolver.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/Resolver.cpp 2015-01-22 20:30:28.000000000 +0100 -@@ -431,6 +431,7 @@ - // update cpu-sub-type - cpu_subtype_t nextObjectSubType = file.cpuSubType(); - switch ( _options.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( _options.subArchitecture() != nextObjectSubType ) { - if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) { -@@ -449,6 +450,7 @@ - } - } - break; -+#endif - - case CPU_TYPE_I386: - _internal.cpuSubType = CPU_SUBTYPE_I386_ALL; -diff -ur ld64-241.9/src/ld/parsers/archive_file.cpp ld64-241.9/src/ld/parsers/archive_file.cpp ---- ld64-241.9/src/ld/parsers/archive_file.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/parsers/archive_file.cpp 2015-01-22 05:57:03.000000000 +0100 -@@ -232,8 +232,12 @@ - - template <> cpu_type_t File<x86>::architecture() { return CPU_TYPE_I386; } - template <> cpu_type_t File<x86_64>::architecture() { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> cpu_type_t File<arm>::architecture() { return CPU_TYPE_ARM; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> cpu_type_t File<arm64>::architecture() { return CPU_TYPE_ARM64; } -+#endif - - - template <typename A> -diff -ur ld64-241.9/src/ld/parsers/macho_dylib_file.cpp ld64-241.9/src/ld/parsers/macho_dylib_file.cpp ---- ld64-241.9/src/ld/parsers/macho_dylib_file.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/parsers/macho_dylib_file.cpp 2015-01-22 06:07:53.000000000 +0100 -@@ -258,11 +258,15 @@ - bool File<A>::_s_logHashtable = false; - - template <> const char* File<x86_64>::objCInfoSegmentName() { return "__DATA"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* File<arm>::objCInfoSegmentName() { return "__DATA"; } -+#endif - template <typename A> const char* File<A>::objCInfoSegmentName() { return "__OBJC"; } - - template <> const char* File<x86_64>::objCInfoSectionName() { return "__objc_imageinfo"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* File<arm>::objCInfoSectionName() { return "__objc_imageinfo"; } -+#endif - template <typename A> const char* File<A>::objCInfoSectionName() { return "__image_info"; } - - template <typename A> -@@ -1020,6 +1024,7 @@ - } - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle) - { -@@ -1046,9 +1051,11 @@ - return false; - } - } -+#endif - - - -+#if SUPPORT_ARCH_arm64 - template <> - bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle) - { -@@ -1075,6 +1082,7 @@ - return false; - } - } -+#endif - - - bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult) -@@ -1090,17 +1098,21 @@ - *subResult = CPU_SUBTYPE_X86_ALL; - return true; - } -+#if SUPPORT_ARCH_arm_any - if ( Parser<arm>::validFile(fileContent, false) ) { - *result = CPU_TYPE_ARM; - const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#if SUPPORT_ARCH_arm64 - if ( Parser<arm64>::validFile(fileContent, false) ) { - *result = CPU_TYPE_ARM64; - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#endif - return false; - } - -@@ -1126,6 +1138,7 @@ - return "x86_64"; - } - -+#if SUPPORT_ARCH_arm_any - template <> - const char* Parser<arm>::fileKind(const uint8_t* fileContent) - { -@@ -1141,6 +1154,7 @@ - } - return "arm???"; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1166,9 +1180,11 @@ - if ( Parser<x86>::validFile(fileContent, true) ) { - return Parser<x86>::fileKind(fileContent); - } -+#if SUPPORT_ARCH_arm_any - if ( Parser<arm>::validFile(fileContent, true) ) { - return Parser<arm>::fileKind(fileContent); - } -+#endif - #if SUPPORT_ARCH_arm64 - if ( Parser<arm64>::validFile(fileContent, false) ) { - return Parser<arm64>::fileKind(fileContent); -diff -ur ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp ---- ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/parsers/macho_relocatable_file.cpp 2015-01-22 20:38:57.000000000 +0100 -@@ -867,6 +867,7 @@ - } - } - -+#if SUPPORT_ARCH_arm_any - template <> - void Atom<arm>::verifyAlignment(const macho_section<P>&) const - { -@@ -875,6 +876,7 @@ - warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path()); - } - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1262,6 +1264,7 @@ - return true; - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype) - { -@@ -1282,8 +1285,10 @@ - } - return true; - } -+#endif - - -+#if SUPPORT_ARCH_arm64 - template <> - bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype) - { -@@ -1296,6 +1301,7 @@ - return false; - return true; - } -+#endif - - - template <> -@@ -1320,6 +1326,7 @@ - return "x86_64"; - } - -+#if SUPPORT_ARCH_arm_any - template <> - const char* Parser<arm>::fileKind(const uint8_t* fileContent) - { -@@ -1335,6 +1342,7 @@ - } - return "arm???"; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1599,11 +1607,13 @@ - return false; - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr) - { - return addr & (-2); - } -+#endif - - template <typename A> - typename A::P::uint_t Parser<A>::realAddr(typename A::P::uint_t addr) -@@ -1867,8 +1877,12 @@ - - template <> uint8_t Parser<x86>::loadCommandSizeMask() { return 0x03; } - template <> uint8_t Parser<x86_64>::loadCommandSizeMask() { return 0x07; } -+#if SUPPORT_ARCH_arm_any - template <> uint8_t Parser<arm>::loadCommandSizeMask() { return 0x03; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> uint8_t Parser<arm64>::loadCommandSizeMask() { return 0x07; } -+#endif - - template <typename A> - bool Parser<A>::parseLoadCommands() -@@ -4065,12 +4079,14 @@ - return 1 + (this->_machOSection - parser.firstMachOSection()); - } - -+#if SUPPORT_ARCH_arm_any - // arm does not have zero cost exceptions - template <> - uint32_t CFISection<arm>::cfiCount(Parser<arm>& parser) - { - return 0; - } -+#endif - - template <typename A> - uint32_t CFISection<A>::cfiCount(Parser<A>& parser) -@@ -4198,6 +4214,7 @@ - - - -+#if SUPPORT_ARCH_arm_any - template <> - void CFISection<arm>::cfiParse(class Parser<arm>& parser, uint8_t* buffer, - libunwind::CFI_Atom_Info<CFISection<arm>::OAS>::CFI_Atom_Info cfiArray[], -@@ -4206,6 +4223,7 @@ - // arm does not use zero cost exceptions - assert(count == 0); - } -+#endif - - - -@@ -4310,8 +4328,12 @@ - - template <> bool CFISection<x86_64>::bigEndian() { return false; } - template <> bool CFISection<x86>::bigEndian() { return false; } -+#if SUPPORT_ARCH_arm_any - template <> bool CFISection<arm>::bigEndian() { return false; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> bool CFISection<arm64>::bigEndian() { return false; } -+#endif - - - template <> -@@ -5229,11 +5251,13 @@ - return ld::Fixup::kindStoreLittleEndian32; - } - -+#if SUPPORT_ARCH_arm_any - template <> - ld::Fixup::Kind NonLazyPointerSection<arm>::fixupKind() - { - return ld::Fixup::kindStoreLittleEndian32; - } -+#endif - - template <> - ld::Fixup::Kind NonLazyPointerSection<arm64>::fixupKind() -@@ -7346,10 +7370,14 @@ - return ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ); - case CPU_TYPE_I386: - return ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ); -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - return ( mach_o::relocatable::Parser<arm>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) ); -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - return ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) ); -+#endif - } - return false; - } -@@ -7370,17 +7398,21 @@ - *subResult = CPU_SUBTYPE_X86_ALL; - return true; - } -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - *result = CPU_TYPE_ARM; - const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, false, 0) ) { - *result = CPU_TYPE_ARM64; - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#endif - return false; - } - -@@ -7395,9 +7427,11 @@ - if ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ) { - return mach_o::relocatable::Parser<x86>::fileKind(fileContent); - } -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<arm>::fileKind(fileContent); - } -+#endif - return NULL; - } - -@@ -7409,9 +7443,11 @@ - if ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ) { - return mach_o::relocatable::Parser<x86_64>::hasObjC2Categories(fileContent); - } -+#if SUPPORT_ARCH_arm_any - else if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<arm>::hasObjC2Categories(fileContent); - } -+#endif - else if ( mach_o::relocatable::Parser<x86>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<x86>::hasObjC2Categories(fileContent); - } -diff -ur ld64-241.9/src/ld/passes/branch_island.cpp ld64-241.9/src/ld/passes/branch_island.cpp ---- ld64-241.9/src/ld/passes/branch_island.cpp 2014-09-11 00:24:46.000000000 +0200 -+++ ld64-241.9/src/ld/passes/branch_island.cpp 2015-01-22 06:23:52.000000000 +0100 -@@ -285,6 +285,7 @@ - static uint64_t textSizeWhenMightNeedBranchIslands(const Options& opts, bool seenThumbBranch) - { - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( ! seenThumbBranch ) - return 32000000; // ARM can branch +/- 32MB -@@ -293,6 +294,7 @@ - else - return 4000000; // thumb1 can branch +/- 4MB - break; -+#endif - } - assert(0 && "unexpected architecture"); - return 0x100000000LL; -@@ -302,6 +304,7 @@ - static uint64_t maxDistanceBetweenIslands(const Options& opts, bool seenThumbBranch) - { - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( ! seenThumbBranch ) - return 30*1024*1024; // 2MB of branch islands per 32MB -@@ -310,6 +313,7 @@ - else - return 3500000; // 0.5MB of branch islands per 4MB - break; -+#endif - } - assert(0 && "unexpected architecture"); - return 0x100000000LL; -@@ -654,8 +658,10 @@ - - // only ARM needs branch islands - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - break; -+#endif - default: - return; - } -diff -ur ld64-241.9/src/ld/passes/branch_shim.cpp ld64-241.9/src/ld/passes/branch_shim.cpp ---- ld64-241.9/src/ld/passes/branch_shim.cpp 2014-09-11 00:24:46.000000000 +0200 -+++ ld64-241.9/src/ld/passes/branch_shim.cpp 2015-01-22 06:33:01.000000000 +0100 -@@ -276,6 +276,9 @@ - // - void doPass(const Options& opts, ld::Internal& state) - { -+#if !SUPPORT_ARCH_arm_any -+ return; -+#else - // only make branch shims in final linked images - if ( opts.outputKind() == Options::kObjectFile ) - return; -@@ -386,6 +389,7 @@ - // append all new shims to end of __text - sect->atoms.insert(sect->atoms.end(), shims.begin(), shims.end()); - } -+#endif - } - - -diff -ur ld64-241.9/src/ld/passes/dtrace_dof.cpp ld64-241.9/src/ld/passes/dtrace_dof.cpp ---- ld64-241.9/src/ld/passes/dtrace_dof.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/ld/passes/dtrace_dof.cpp 2015-01-22 06:33:51.000000000 +0100 -@@ -179,8 +179,12 @@ - switch ( opts.architecture() ) { - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - storeKind = ld::Fixup::kindStoreLittleEndian32; - break; - default: -diff -ur ld64-241.9/src/ld/passes/stubs/stubs.cpp ld64-241.9/src/ld/passes/stubs/stubs.cpp ---- ld64-241.9/src/ld/passes/stubs/stubs.cpp 2014-09-11 00:24:46.000000000 +0200 -+++ ld64-241.9/src/ld/passes/stubs/stubs.cpp 2015-01-22 06:34:56.000000000 +0100 -@@ -324,9 +324,11 @@ - if ( _options.outputKind() != Options::kDynamicLibrary ) - throwf("resolver functions (%s) can only be used in dylibs", atom->name()); - if ( !_options.makeCompressedDyldInfo() ) { -+#if SUPPORT_ARCH_arm_any - if ( _options.architecture() == CPU_TYPE_ARM ) - throwf("resolver functions (%s) can only be used when targeting iOS 4.2 or later", atom->name()); - else -+#endif - throwf("resolver functions (%s) can only be used when targeting Mac OS X 10.6 or later", atom->name()); - } - stubFor[atom] = NULL; -@@ -354,6 +356,7 @@ - throw "symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o"; - - // disable arm close stubs in some cases -+#if SUPPORT_ARCH_arm_any - if ( _architecture == CPU_TYPE_ARM ) { - if ( codeSize > 4*1024*1024 ) - _largeText = true; -@@ -377,6 +380,7 @@ - } - } - } -+#endif - - // make stub atoms - for (std::map<const ld::Atom*,ld::Atom*>::iterator it = stubFor.begin(); it != stubFor.end(); ++it) { -diff -ur ld64-241.9/src/other/ObjectDump.cpp ld64-241.9/src/other/ObjectDump.cpp ---- ld64-241.9/src/other/ObjectDump.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/other/ObjectDump.cpp 2015-01-22 05:32:46.000000000 +0100 -@@ -806,6 +806,7 @@ - case ld::Fixup::kindStoreThumbHigh16: - printf(", then store high-16 in Thumb movt"); - break; -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64Branch26: - printf(", then store as ARM64 26-bit pcrel branch"); - break; -@@ -845,6 +846,7 @@ - case ld::Fixup::kindStoreARM64PCRelToGOT: - printf(", then store as 32-bit delta to GOT entry"); - break; -+#endif - case ld::Fixup::kindDtraceExtra: - printf("dtrace static probe extra info"); - break; -@@ -989,6 +991,7 @@ - case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64: - printf("tlv template offset of %s", referenceTargetAtomName(ref)); - break; -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64Branch26: - printf("ARM64 store 26-bit pcrel branch to %s", referenceTargetAtomName(ref)); - break; -@@ -1022,6 +1025,7 @@ - case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadNowLeaPageOff12: - printf("ARM64 store 12-bit page offset of lea for TLV of %s", referenceTargetAtomName(ref)); - break; -+#endif - //default: - // printf("unknown fixup"); - // break; -diff -ur ld64-241.9/src/other/rebase.cpp ld64-241.9/src/other/rebase.cpp ---- ld64-241.9/src/other/rebase.cpp 2014-09-11 00:24:46.000000000 +0200 -+++ ld64-241.9/src/other/rebase.cpp 2015-01-22 05:46:29.000000000 +0100 -@@ -160,9 +160,11 @@ - case CPU_TYPE_X86_64: - fRebasers.push_back(new Rebaser<x86_64>(&p[fileOffset])); - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - fRebasers.push_back(new Rebaser<arm>(&p[fileOffset])); - break; -+#endif - default: - throw "unknown file format"; - } -@@ -186,9 +188,11 @@ - else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC_64) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_X86_64)) { - fRebasers.push_back(new Rebaser<x86_64>(mh)); - } -+#if SUPPORT_ARCH_arm_any - else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_ARM)) { - fRebasers.push_back(new Rebaser<arm>(mh)); - } -+#endif - else { - throw "unknown file format"; - } -@@ -236,7 +240,9 @@ - template <> cpu_type_t Rebaser<ppc64>::getArchitecture() const { return CPU_TYPE_POWERPC64; } - template <> cpu_type_t Rebaser<x86>::getArchitecture() const { return CPU_TYPE_I386; } - template <> cpu_type_t Rebaser<x86_64>::getArchitecture() const { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> cpu_type_t Rebaser<arm>::getArchitecture() const { return CPU_TYPE_ARM; } -+#endif - - template <typename A> - uint64_t Rebaser<A>::getBaseAddress() const -@@ -875,8 +881,10 @@ - return "i386"; - case CPU_TYPE_X86_64: - return "x86_64"; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - return "arm"; -+#endif - } - return "unknown"; - } -@@ -969,6 +977,7 @@ - else if ( arch == CPU_TYPE_X86_64 ) { - return 0x200000000ULL; - } -+#if SUPPORT_ARCH_arm_any - else if ( arch == CPU_TYPE_ARM ) { - // place dylibs below dyld - uint64_t topAddr = 0x2FE00000; -@@ -977,6 +986,7 @@ - throwf("total size of images (0x%X) does not fit below 0x2FE00000", totalSize); - return topAddr - totalSize; - } -+#endif - else - throw "unknown architecture"; - } -@@ -1043,7 +1053,9 @@ - onlyArchs.insert(CPU_TYPE_POWERPC64); - onlyArchs.insert(CPU_TYPE_I386); - onlyArchs.insert(CPU_TYPE_X86_64); -+#if SUPPORT_ARCH_arm_any - onlyArchs.insert(CPU_TYPE_ARM); -+#endif - } - - // scan files and collect sizes -diff -ur ld64-241.9/src/other/unwinddump.cpp ld64-241.9/src/other/unwinddump.cpp ---- ld64-241.9/src/other/unwinddump.cpp 2015-01-22 20:59:47.000000000 +0100 -+++ ld64-241.9/src/other/unwinddump.cpp 2015-01-22 05:45:28.000000000 +0100 -@@ -97,7 +97,9 @@ - - template <> const char* UnwindPrinter<x86>::archName() { return "i386"; } - template <> const char* UnwindPrinter<x86_64>::archName() { return "x86_64"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* UnwindPrinter<arm>::archName() { return "arm"; } -+#endif - #if SUPPORT_ARCH_arm64 - template <> const char* UnwindPrinter<arm64>::archName() { return "arm64"; } - #endif -@@ -1072,7 +1074,9 @@ - #if SUPPORT_ARCH_arm64 - onlyArchs.insert(CPU_TYPE_ARM64); - #endif -+#if SUPPORT_ARCH_arm_any - onlyArchs.insert(CPU_TYPE_ARM); -+#endif - } - - // process each file ---- ld64-241.9/src/other/machochecker.cpp 2015-01-23 01:54:12.000000000 +0100 -+++ ld64-241.9/src/other/machochecker.cpp 2015-01-23 01:57:11.000000000 +0100 -@@ -252,6 +252,7 @@ - return false; - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool MachOChecker<arm>::validFile(const uint8_t* fileContent) - { -@@ -269,6 +270,7 @@ - } - return false; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -294,7 +296,9 @@ - template <> uint8_t MachOChecker<ppc64>::loadCommandSizeMask() { return 0x07; } - template <> uint8_t MachOChecker<x86>::loadCommandSizeMask() { return 0x03; } - template <> uint8_t MachOChecker<x86_64>::loadCommandSizeMask() { return 0x07; } -+#if SUPPORT_ARCH_arm_any - template <> uint8_t MachOChecker<arm>::loadCommandSizeMask() { return 0x03; } -+#endif - #if SUPPORT_ARCH_arm64 - template <> uint8_t MachOChecker<arm64>::loadCommandSizeMask() { return 0x07; } - #endif -@@ -324,11 +328,13 @@ - return threadInfo->thread_register(7); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::getInitialStackPointer(const macho_thread_command<arm::P>* threadInfo) - { - return threadInfo->thread_register(13); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -362,11 +368,13 @@ - return threadInfo->thread_register(16); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::getEntryPoint(const macho_thread_command<arm::P>* threadInfo) - { - return threadInfo->thread_register(15); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1025,6 +1033,7 @@ - return fFirstWritableSegment->vmaddr(); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::relocBase() - { -@@ -1033,6 +1042,7 @@ - else - return fFirstSegment->vmaddr(); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> diff --git a/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch b/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch deleted file mode 100644 index f484111ab34b..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch +++ /dev/null @@ -1,644 +0,0 @@ -Allow to disable snapshot support because of missing Block API on OS X < 10.6. - ---- ld64-241.9/src/ld/InputFiles.cpp.orig 2015-01-16 15:26:31.000000000 -0800 -+++ ld64-241.9/src/ld/InputFiles.cpp 2015-01-16 15:26:54.000000000 -0800 -@@ -1144,7 +1144,9 @@ - case ld::File::Reloc: - { - ld::relocatable::File* reloc = (ld::relocatable::File*)file; -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordObjectFile(reloc->path()); -+#endif - if ( _options.dumpDependencyInfo() ) - _options.dumpDependency(Options::depObjectFile, reloc->path()); - } -@@ -1244,7 +1246,9 @@ - if ( dylibFile->justInTimeforEachAtom(name, handler) ) { - // we found a definition in this dylib - // done, unless it is a weak definition in which case we keep searching -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordDylibSymbol(dylibFile, name); -+#endif - if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) { - return true; - } -@@ -1258,7 +1262,9 @@ - if ( archiveFile->justInTimeDataOnlyforEachAtom(name, handler) ) { - if ( _options.traceArchives() ) - logArchive(archiveFile); -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordArchive(archiveFile->path()); -+#endif - // found data definition in static library, done - return true; - } -@@ -1267,7 +1273,9 @@ - if ( archiveFile->justInTimeforEachAtom(name, handler) ) { - if ( _options.traceArchives() ) - logArchive(archiveFile); -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordArchive(archiveFile->path()); -+#endif - // found definition in static library, done - return true; - } -@@ -1294,7 +1302,9 @@ - if ( dylibFile->justInTimeforEachAtom(name, handler) ) { - // we found a definition in this dylib - // done, unless it is a weak definition in which case we keep searching -+#ifdef SUPPORT_SNAPSHOTS - _options.snapshot().recordDylibSymbol(dylibFile, name); -+#endif - if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) { - return true; - } ---- ld64-241.9/src/ld/ld.cpp.orig 2015-01-16 15:26:32.000000000 -0800 -+++ ld64-241.9/src/ld/ld.cpp 2015-01-16 15:26:54.000000000 -0800 -@@ -1180,11 +1180,13 @@ - // implement assert() function to print out a backtrace before aborting - void __assert_rtn(const char* func, const char* file, int line, const char* failedexpr) - { -+#ifdef SUPPORT_SNAPSHOTS - Snapshot *snapshot = Snapshot::globalSnapshot; - - snapshot->setSnapshotMode(Snapshot::SNAPSHOT_DEBUG); - snapshot->createSnapshot(); - snapshot->recordAssertionMessage("Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line); -+#endif - - void* callStack[128]; - int depth = ::backtrace(callStack, 128); -@@ -1202,9 +1204,13 @@ - } - long offset = (uintptr_t)callStack[i] - (uintptr_t)info.dli_saddr; - fprintf(stderr, "%d %p %s + %ld\n", i, callStack[i], symboName, offset); -+#ifdef SUPPORT_SNAPSHOTS - snapshot->recordAssertionMessage("%d %p %s + %ld\n", i, callStack[i], symboName, offset); -+#endif - } -+#ifdef SUPPORT_SNAPSHOTS - fprintf(stderr, "A linker snapshot was created at:\n\t%s\n", snapshot->rootDir()); -+#endif - fprintf(stderr, "ld: Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line); - exit(1); - } ---- ld64-241.9/src/ld/Options.cpp.orig 2015-01-16 15:26:32.000000000 -0800 -+++ ld64-241.9/src/ld/Options.cpp 2015-01-16 15:27:26.000000000 -0800 -@@ -183,7 +183,11 @@ - fMarkAppExtensionSafe(false), fCheckAppExtensionSafe(false), fForceLoadSwiftLibs(false), - fDebugInfoStripping(kDebugInfoMinimal), fTraceOutputFile(NULL), - fMacVersionMin(ld::macVersionUnset), fIOSVersionMin(ld::iOSVersionUnset), -- fSaveTempFiles(false), fSnapshotRequested(false), fPipelineFifo(NULL), -+ fSaveTempFiles(false), -+#ifdef SUPPORT_SNAPSHOTS -+ fSnapshotRequested(false), -+#endif -+ fPipelineFifo(NULL), - fDependencyInfoPath(NULL), fDependencyFileDescriptor(-1) - { - this->checkForClassic(argc, argv); -@@ -589,7 +593,9 @@ - } - break; - } -+#ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordArch(fArchitectureName); -+#endif - // only use compressed LINKEDIT for: - // Mac OS X 10.6 or later - // iOS 3.1 or later -@@ -1908,8 +1914,10 @@ - // - void Options::parse(int argc, const char* argv[]) - { -+#ifdef SUPPORT_SNAPSHOTS - // Store the original args in the link snapshot. - fLinkSnapshot.recordRawArgs(argc, argv); -+#endif - - // pass one builds search list from -L and -F options - this->buildSearchPaths(argc, argv); -@@ -1922,17 +1930,21 @@ - const char* arg = argv[i]; - - if ( arg[0] == '-' ) { -+#ifdef SUPPORT_SNAPSHOTS - // by default, copy one arg to the snapshot link command, and do no file copying - int snapshotArgIndex = i; - int snapshotArgCount = -1; // -1 means compute count based on change in index - int snapshotFileArgIndex = -1; // -1 means no data file parameter to arg -+#endif - - // Since we don't care about the files passed, just the option names, we do this here. - if (fPrintOptions) - fprintf (stderr, "[Logging ld64 options]\t%s\n", arg); - - if ( (arg[1] == 'L') || (arg[1] == 'F') ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; // stripped out of link snapshot -+#endif - if (arg[2] == '\0') - ++i; - // previously handled by buildSearchPaths() -@@ -1979,12 +1991,16 @@ - fOutputKind = kKextBundle; - } - else if ( strcmp(arg, "-o") == 0 ) { -- snapshotArgCount = 0; - fOutputFile = argv[++i]; -+#ifdef SUPPORT_SNAPSHOTS -+ snapshotArgCount = 0; - fLinkSnapshot.setSnapshotName(fOutputFile); -+#endif - } - else if ( strncmp(arg, "-lazy-l", 7) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[7], true); - info.options.fLazyLoad = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -1992,13 +2008,17 @@ - fUsingLazyDylibLinking = true; - } - else if ( strcmp(arg, "-lto_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - fOverridePathlibLTO = argv[++i]; - if ( fOverridePathlibLTO == NULL ) - throw "missing argument to -lto_library"; - } - else if ( (arg[1] == 'l') && (strncmp(arg,"-lazy_",6) !=0) ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[2]); - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); -@@ -2006,8 +2026,10 @@ - // This causes a dylib to be weakly bound at - // link time. This corresponds to weak_import. - else if ( strncmp(arg, "-weak-l", 7) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[7]); - info.options.fWeakImport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2065,12 +2087,16 @@ - else if ( strcmp(arg, "-sectorder") == 0 ) { - if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) ) - throw "-sectorder missing <segment> <section> <file-path>"; -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 3; -+#endif - parseSectionOrderFile(argv[i+1], argv[i+2], argv[i+3]); - i += 3; - } - else if ( strcmp(arg, "-order_file") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - parseOrderFile(argv[++i], false); - } - else if ( strcmp(arg, "-order_file_statistics") == 0 ) { -@@ -2081,7 +2107,9 @@ - else if ( (strcmp(arg, "-sectcreate") == 0) || (strcmp(arg, "-segcreate") == 0) ) { - if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) ) - throw "-sectcreate missing <segment> <section> <file-path>"; -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 3; -+#endif - addSection(argv[i+1], argv[i+2], argv[i+3]); - i += 3; - } -@@ -2110,7 +2138,9 @@ - } - // Same as -@ from the FSF linker. - else if ( strcmp(arg, "-filelist") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - const char* path = argv[++i]; - if ( (path == NULL) || (path[0] == '-') ) - throw "-filelist missing <path>"; -@@ -2137,7 +2167,9 @@ - } - } - else if ( strcmp(arg, "-interposable_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - fInterposeMode = kInterposeSome; - loadExportFile(argv[++i], "-interposable_list", fInterposeList); - } -@@ -2146,14 +2178,18 @@ - fInterposeMode = kInterposeNone; - } - else if ( strcmp(arg, "-exported_symbols_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fExportMode == kDontExportSome ) - throw "can't use -exported_symbols_list and -unexported_symbols_list"; - fExportMode = kExportSome; - loadExportFile(argv[++i], "-exported_symbols_list", fExportSymbols); - } - else if ( strcmp(arg, "-unexported_symbols_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fExportMode == kExportSome ) - throw "can't use -unexported_symbols_list and -exported_symbols_list"; - fExportMode = kDontExportSome; -@@ -2172,14 +2208,18 @@ - fDontExportSymbols.insert(argv[++i]); - } - else if ( strcmp(arg, "-non_global_symbols_no_strip_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fLocalSymbolHandling == kLocalSymbolsSelectiveExclude ) - throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list"; - fLocalSymbolHandling = kLocalSymbolsSelectiveInclude; - loadExportFile(argv[++i], "-non_global_symbols_no_strip_list", fLocalSymbolsIncluded); - } - else if ( strcmp(arg, "-non_global_symbols_strip_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fLocalSymbolHandling == kLocalSymbolsSelectiveInclude ) - throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list"; - fLocalSymbolHandling = kLocalSymbolsSelectiveExclude; -@@ -2195,16 +2235,20 @@ - } - // Similar to -weak-l but uses the absolute path name to the library. - else if ( strcmp(arg, "-weak_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fWeakImport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-lazy_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fLazyLoad = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2212,22 +2256,28 @@ - fUsingLazyDylibLinking = true; - } - else if ( strcmp(arg, "-framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-weak_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fWeakImport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-lazy_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fLazyLoad = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2305,8 +2355,10 @@ - // This should probably be deprecated when we respect -L and -F - // when searching for libraries. - else if ( strcmp(arg, "-dylib_file") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // ignore for snapshot because a stub dylib will be created in the snapshot - snapshotArgCount = 0; -+#endif - addDylibOverride(argv[++i]); - } - // What to expand @executable_path to if found in dependent dylibs -@@ -2363,7 +2415,9 @@ - } - // ??? Deprecate when we get rid of basing at build time. - else if ( strcmp(arg, "-seg_addr_table") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - const char* name = argv[++i]; - if ( name == NULL ) - throw "-seg_addr_table missing argument"; -@@ -2427,7 +2481,9 @@ - i += 2; - } - else if ( strcmp(arg, "-bundle_loader") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - fBundleLoader = argv[++i]; - if ( (fBundleLoader == NULL) || (fBundleLoader[0] == '-') ) - throw "-bundle_loader missing <path>"; -@@ -2659,7 +2715,9 @@ - // previously handled by buildSearchPaths() - } - else if ( strcmp(arg, "-syslibroot") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - ++i; - // previously handled by buildSearchPaths() - } -@@ -2670,7 +2728,9 @@ - fUUIDMode = kUUIDRandom; - } - else if ( strcmp(arg, "-dtrace") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - const char* name = argv[++i]; - if ( name == NULL ) - throw "-dtrace missing argument"; -@@ -2693,7 +2753,9 @@ - fAliases.push_back(pair); - } - else if ( strcmp(arg, "-alias_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - parseAliasFile(argv[++i]); - } - else if ( strcmp(arg, "-save-temps") == 0 ) { -@@ -2724,48 +2786,60 @@ - fDisablePositionIndependentExecutable = true; - } - else if ( strncmp(arg, "-reexport-l", 11) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[11], true); - info.options.fReExport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-reexport_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fReExport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-reexport_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fReExport = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strncmp(arg, "-upward-l", 9) == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findLibrary(&arg[9], true); - info.options.fUpward = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-upward_library") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFile(argv[++i]); - info.options.fUpward = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); - addLibrary(info); - } - else if ( strcmp(arg, "-upward_framework") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - // SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now) - snapshotArgCount = 0; -+#endif - FileInfo info = findFramework(argv[++i]); - info.options.fUpward = true; - info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i); -@@ -2819,7 +2893,9 @@ - fMarkDeadStrippableDylib = true; - } - else if ( strcmp(arg, "-exported_symbols_order") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadSymbolOrderFile(argv[++i], fExportSymbolsOrder); - } - else if ( strcmp(arg, "-no_compact_linkedit") == 0 ) { -@@ -2911,11 +2987,15 @@ - fObjcCategoryMerging = false; - } - else if ( strcmp(arg, "-force_symbols_weak_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadExportFile(argv[++i], "-force_symbols_weak_list", fForceWeakSymbols); - } - else if ( strcmp(arg, "-force_symbols_not_weak_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadExportFile(argv[++i], "-force_symbols_not_weak_list", fForceNotWeakSymbols); - } - else if ( strcmp(arg, "-force_symbol_weak") == 0 ) { -@@ -2931,7 +3011,9 @@ - fForceNotWeakSymbols.insert(symbol); - } - else if ( strcmp(arg, "-reexported_symbols_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - if ( fExportMode == kExportSome ) - throw "can't use -exported_symbols_list and -reexported_symbols_list"; - loadExportFile(argv[++i], "-reexported_symbols_list", fReExportSymbols); -@@ -2947,6 +3029,7 @@ - else if ( strcmp(arg, "-page_align_data_atoms") == 0 ) { - fPageAlignDataAtoms = true; - } -+#ifdef SUPPORT_SNAPSHOTS - else if (strcmp(arg, "-debug_snapshot") == 0) { - fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG); - fSnapshotRequested = true; -@@ -2959,6 +3042,7 @@ - fLinkSnapshot.setSnapshotPath(path); - fSnapshotRequested = true; - } -+#endif - else if ( strcmp(arg, "-new_main") == 0 ) { - fEntryPointLoadCommandForceOn = true; - } -@@ -2993,7 +3077,9 @@ - fKextsUseStubs = true; - } - else if ( strcmp(argv[i], "-dependency_info") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotArgCount = 0; -+#endif - ++i; - // previously handled by buildSearchPaths() - } -@@ -3001,7 +3087,9 @@ - fExportDynamic = true; - } - else if ( strcmp(arg, "-force_symbols_coalesce_list") == 0 ) { -+#ifdef SUPPORT_SNAPSHOTS - snapshotFileArgIndex = 1; -+#endif - loadExportFile(argv[++i], "-force_symbols_coalesce_list", fForceCoalesceSymbols); - } - else if ( strcmp(arg, "-add_linker_option") == 0 ) { -@@ -3158,10 +3246,12 @@ - throwf("unknown option: %s", arg); - } - -+#ifdef SUPPORT_SNAPSHOTS - if (snapshotArgCount == -1) - snapshotArgCount = i-snapshotArgIndex+1; - if (snapshotArgCount > 0) - fLinkSnapshot.addSnapshotLinkArg(snapshotArgIndex, snapshotArgCount, snapshotFileArgIndex); -+#endif - } - else { - FileInfo info = findFile(arg); -@@ -3180,8 +3270,10 @@ - addLibrary(info); - } - -+#ifdef SUPPORT_SNAPSHOTS - if (fSnapshotRequested) - fLinkSnapshot.createSnapshot(); -+#endif - } - - -@@ -3452,6 +3544,7 @@ - if ( customDyldPath != NULL ) - fDyldInstallPath = customDyldPath; - -+#ifdef SUPPORT_SNAPSHOTS - const char* debugArchivePath = getenv("LD_DEBUG_SNAPSHOT"); - if (debugArchivePath != NULL) { - fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG); -@@ -3459,6 +3552,7 @@ - fLinkSnapshot.setSnapshotPath(debugArchivePath); - fSnapshotRequested = true; - } -+#endif - - const char* pipeFdString = getenv("LD_PIPELINE_FIFO"); - if (pipeFdString != NULL) { -@@ -4351,7 +4445,9 @@ - if ( strcmp(&lastSlash[1], subUmbrella) == 0 ) { - info.options.fReExport = true; - found = true; -+#ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordSubUmbrella(info.path); -+#endif - break; - } - } -@@ -4374,7 +4470,9 @@ - if ( strncmp(&lastSlash[1], subLibrary, dot-lastSlash-1) == 0 ) { - info.options.fReExport = true; - found = true; -+#ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordSubLibrary(info.path); -+#endif - break; - } - } ---- ld64-241.9/src/ld/Options.h.orig 2015-01-16 15:26:32.000000000 -0800 -+++ ld64-241.9/src/ld/Options.h 2015-01-16 15:26:54.000000000 -0800 -@@ -48,7 +48,9 @@ - extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2))); - extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2))); - -+#ifdef SUPPORT_SNAPSHOTS - class Snapshot; -+#endif - - class LibraryOptions - { -@@ -379,7 +381,9 @@ - bool forceWeakNonWildCard(const char* symbolName) const; - bool forceNotWeakNonWildcard(const char* symbolName) const; - bool forceCoalesce(const char* symbolName) const; -+#ifdef SUPPORT_SNAPSHOTS - Snapshot& snapshot() const { return fLinkSnapshot; } -+#endif - bool errorBecauseOfWarnings() const; - bool needsThreadLoadCommand() const { return fNeedsThreadLoadCommand; } - bool needsEntryPointLoadCommand() const { return fEntryPointLoadCommand; } -@@ -677,8 +681,10 @@ - std::vector<SymbolsMove> fSymbolsMovesCode; - std::vector<SymbolsMove> fSymbolsMovesZeroFill; - bool fSaveTempFiles; -+#ifdef SUPPORT_SNAPSHOTS - mutable Snapshot fLinkSnapshot; - bool fSnapshotRequested; -+#endif - const char* fPipelineFifo; - const char* fDependencyInfoPath; - mutable int fDependencyFileDescriptor; ---- ld64-241.9/src/ld/Snapshot.cpp.orig 2014-09-10 15:24:46.000000000 -0700 -+++ ld64-241.9/src/ld/Snapshot.cpp 2015-01-16 15:26:54.000000000 -0800 -@@ -6,6 +6,7 @@ - // Copyright (c) 2011 Apple Inc. All rights reserved. - // - -+#ifdef SUPPORT_SNAPSHOTS - #include <string.h> - #include <unistd.h> - #include <stdio.h> -@@ -536,3 +538,5 @@ - } - } - } -+ -+#endif /* SUPPORT_SNAPSHOTS */ ---- ld64-236.3/src/ld/Snapshot.h.orig 2015-01-23 07:59:55.000000000 +0100 -+++ ld64-236.3/src/ld/Snapshot.h 2015-01-23 07:58:14.000000000 +0100 -@@ -8,6 +8,8 @@ - - #ifndef ld64_Snapshot_h - #define ld64_Snapshot_h -+ -+#ifdef SUPPORT_SNAPSHOTS - #include <stdint.h> - #include <string.h> - #include <map> -@@ -151,3 +153,5 @@ - }; - - #endif -+ -+#endif diff --git a/sys-devel/binutils-apple/files/ld64-241.9-register-names.patch b/sys-devel/binutils-apple/files/ld64-241.9-register-names.patch deleted file mode 100644 index 6b855e5883bd..000000000000 --- a/sys-devel/binutils-apple/files/ld64-241.9-register-names.patch +++ /dev/null @@ -1,50 +0,0 @@ -Force use of old register names on old OS X (< 10.5). - -diff -ur ld64-241.9/src/ld/parsers/libunwind/Registers.hpp ld64-241.9/src/ld/parsers/libunwind/Registers.hpp ---- ld64-241.9/src/ld/parsers/libunwind/Registers.hpp 2014-09-11 00:24:46.000000000 +0200 -+++ ld64-241.9/src/ld/parsers/libunwind/Registers.hpp 2015-01-22 22:16:23.000000000 +0100 -@@ -40,6 +40,44 @@ - #include "libunwind.h" - #include "InternalMacros.h" - -+#include <AvailabilityMacros.h> -+ -+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 -+/* member names of i386_thread_state and x86_thread_state64 have changed and -+ * default of __DARWIN_UNIX03 activating those new names as well. Instead of -+ * defining __DARWIN_UNIX03 with all its unknown consequences, we use defines -+ * to make our source use the old names on an old system. */ -+ -+#define __esp esp -+#define __eip eip -+#define __ebp ebp -+#define __ebx ebx -+#define __ecx ecx -+#define __edx edx -+#define __esi esi -+#define __edi edi -+#define __esp esp -+#define __eax eax -+#define __rip rip -+#define __rsp rsp -+#define __rax rax -+#define __rdx rdx -+#define __rcx rcx -+#define __rbx rbx -+#define __rsi rsi -+#define __rdi rdi -+#define __rbp rbp -+#define __rsp rsp -+#define __r8 r8 -+#define __r9 r9 -+#define __r10 r10 -+#define __r11 r11 -+#define __r12 r12 -+#define __r13 r13 -+#define __r14 r14 -+#define __r15 r15 -+#endif -+ - namespace libunwind { - - diff --git a/sys-devel/binutils-apple/files/ld64-242-gcc.patch b/sys-devel/binutils-apple/files/ld64-242-gcc.patch deleted file mode 100644 index b6e1dbbbbe05..000000000000 --- a/sys-devel/binutils-apple/files/ld64-242-gcc.patch +++ /dev/null @@ -1,1038 +0,0 @@ -Provide c++11 headers from tr1 include directory and namespace. - -Work around weird namespacing bug in gcc-4.2.1 where class ld::Section -conflicts with template mach_o::relocatable::Section by renaming the latter to -MRFSection (could possibly be done using sed from ebuild or avoided by figuring -out, what's actually going on with those namespaces). - ---- ld64-242/src/ld/InputFiles.h.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/InputFiles.h 2015-08-03 01:11:57.000000000 +0200 -@@ -46,6 +46,14 @@ - #include <pthread.h> - #endif - -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else -+#include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif -+ - #include <vector> - - #include "Options.h" -@@ -112,7 +120,7 @@ - static void parseWorkerThread(InputFiles *inputFiles); - void startThread(void (*threadFunc)(InputFiles *)) const; - -- typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib; -+ typedef std::UNORDERED_MAP<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib; - - const Options& _options; - std::vector<ld::File*> _inputFiles; ---- ld64-242/src/ld/ld.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/ld.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -56,7 +56,13 @@ - #include <vector> - #include <list> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - #include <cxxabi.h> - - #include "Options.h" -@@ -153,7 +159,7 @@ - struct SectionEquals { - bool operator()(const ld::Section* left, const ld::Section* right) const; - }; -- typedef std::unordered_map<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut; -+ typedef std::UNORDERED_MAP<const ld::Section*, FinalSection*, SectionHash, SectionEquals> SectionInToOut; - - - SectionInToOut _sectionInToFinalMap; ---- ld64-242/src/ld/ld.hpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/ld.hpp 2015-08-03 01:11:57.000000000 +0200 -@@ -32,7 +32,13 @@ - #include <assert.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "configure.h" - -@@ -822,7 +828,7 @@ - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - --typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -+typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; - - class Internal - { ---- ld64-242/src/ld/LinkEditClassic.hpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/LinkEditClassic.hpp 2015-08-03 01:11:57.000000000 +0200 -@@ -31,8 +31,13 @@ - #include <limits.h> - #include <unistd.h> - --#include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #if !defined(SET_COMM_ALIGN) - /* missing on < 10.5 */ -@@ -98,7 +103,7 @@ - - private: - enum { kBufferSize = 0x01000000 }; -- typedef std::unordered_map<const char*, int32_t, CStringHash, CStringEquals> StringToOffset; -+ typedef std::UNORDERED_MAP<const char*, int32_t, CStringHash, CStringEquals> StringToOffset; - - const uint32_t _pointerSize; - std::vector<char*> _fullBuffers; ---- ld64-242/src/ld/Options.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/Options.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -4743,7 +4743,7 @@ - - // make sure all required exported symbols exist - std::vector<const char*> impliedExports; -- for (NameSet::iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) { -+ for (NameSet::const_iterator it=fExportSymbols.regularBegin(); it != fExportSymbols.regularEnd(); ++it) { - const char* name = *it; - const int len = strlen(name); - if ( (strcmp(&name[len-3], ".eh") == 0) || (strncmp(name, ".objc_category_name_", 20) == 0) ) { -@@ -4775,7 +4775,7 @@ - } - - // make sure all required re-exported symbols exist -- for (NameSet::iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) { -+ for (NameSet::const_iterator it=fReExportSymbols.regularBegin(); it != fReExportSymbols.regularEnd(); ++it) { - fInitialUndefines.push_back(*it); - } - ---- ld64-242/src/ld/Options.h.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/Options.h 2015-08-03 01:11:57.000000000 +0200 -@@ -30,8 +30,17 @@ - #include <mach/machine.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "ld.hpp" - #include "Snapshot.h" -@@ -401,8 +410,8 @@ - bool moveRwSymbol(const char* symName, const char* filePath, const char*& seg, bool& wildCardMatch) const; - - private: -- typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder; -- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet; -+ typedef std::UNORDERED_MAP<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder; -+ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> NameSet; - enum ExportMode { kExportDefault, kExportSome, kDontExportSome }; - enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives }; - enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome }; -@@ -415,8 +424,8 @@ - bool containsNonWildcard(const char*) const; - bool empty() const { return fRegular.empty() && fWildCard.empty(); } - bool hasWildCards() const { return !fWildCard.empty(); } -- NameSet::iterator regularBegin() const { return fRegular.begin(); } -- NameSet::iterator regularEnd() const { return fRegular.end(); } -+ NameSet::const_iterator regularBegin() const { return fRegular.begin(); } -+ NameSet::const_iterator regularEnd() const { return fRegular.end(); } - void remove(const NameSet&); - private: - static bool hasWildCards(const char*); ---- ld64-242/src/ld/OutputFile.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/OutputFile.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -50,7 +50,13 @@ - #include <vector> - #include <list> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include <CommonCrypto/CommonDigest.h> - #include <AvailabilityMacros.h> -@@ -4800,7 +4806,7 @@ - const char* filename = NULL; - bool wroteStartSO = false; - state.stabs.reserve(atomsNeedingDebugNotes.size()*4); -- std::unordered_set<const char*, CStringHash, CStringEquals> seenFiles; -+ std::UNORDERED_SET<const char*, CStringHash, CStringEquals> seenFiles; - for (std::vector<const ld::Atom*>::iterator it=atomsNeedingDebugNotes.begin(); it != atomsNeedingDebugNotes.end(); it++) { - const ld::Atom* atom = *it; - const ld::File* atomFile = atom->file(); ---- ld64-242/src/ld/parsers/archive_file.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/parsers/archive_file.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -33,7 +33,13 @@ - #include <set> - #include <map> - #include <algorithm> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "MachOFileAbstraction.hpp" - #include "Architectures.hpp" -@@ -116,7 +122,7 @@ - struct MemberState { ld::relocatable::File* file; const Entry *entry; bool logged; bool loaded; uint32_t index;}; - bool loadMember(MemberState& state, ld::File::AtomHandler& handler, const char *format, ...) const; - -- typedef std::unordered_map<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap; -+ typedef std::UNORDERED_MAP<const char*, const struct ranlib*, ld::CStringHash, ld::CStringEquals> NameToEntryMap; - - typedef typename A::P P; - typedef typename A::P::E E; ---- ld64-242/src/ld/parsers/lto_file.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/parsers/lto_file.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -33,8 +33,17 @@ - #include <pthread.h> - #include <mach-o/dyld.h> - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "MachOFileAbstraction.hpp" - #include "Architectures.hpp" -@@ -218,8 +227,8 @@ - static void ltoDiagnosticHandler(lto_codegen_diagnostic_severity_t, const char*, void*); - #endif - -- typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -- typedef std::unordered_map<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom; -+ typedef std::UNORDERED_SET<const char*, ld::CStringHash, ld::CStringEquals> CStringSet; -+ typedef std::UNORDERED_MAP<const char*, Atom*, ld::CStringHash, ld::CStringEquals> CStringToAtom; - - class AtomSyncer : public ld::File::AtomHandler { - public: ---- ld64-242/src/ld/parsers/macho_dylib_file.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/parsers/macho_dylib_file.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -34,8 +34,17 @@ - #include <vector> - #include <set> - #include <algorithm> --#include <unordered_map> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "Architectures.hpp" - #include "MachOFileAbstraction.hpp" -@@ -193,8 +202,8 @@ - }; - }; - struct AtomAndWeak { ld::Atom* atom; bool weakDef; bool tlv; pint_t address; }; -- typedef std::unordered_map<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap; -- typedef std::unordered_set<const char*, CStringHash, ld::CStringEquals> NameSet; -+ typedef std::UNORDERED_MAP<const char*, AtomAndWeak, ld::CStringHash, ld::CStringEquals> NameToAtomMap; -+ typedef std::UNORDERED_SET<const char*, CStringHash, ld::CStringEquals> NameSet; - - struct Dependent { const char* path; File<A>* dylib; bool reExport; }; - -@@ -566,14 +575,18 @@ - if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u toc entries for %s\n", dynamicInfo->nextdefsym(), this->path()); - const macho_nlist<P>* start = &symbolTable[dynamicInfo->iextdefsym()]; - const macho_nlist<P>* end = &start[dynamicInfo->nextdefsym()]; -+#ifndef __GLIBCXX__ - _atoms.reserve(dynamicInfo->nextdefsym()); // set initial bucket count -+#endif - for (const macho_nlist<P>* sym=start; sym < end; ++sym) { - this->addSymbol(&strings[sym->n_strx()], (sym->n_desc() & N_WEAK_DEF) != 0, false, sym->n_value()); - } - } - else { - int32_t count = dynamicInfo->ntoc(); -+#ifndef __GLIBCXX__ - _atoms.reserve(count); // set initial bucket count -+#endif - if ( _s_logHashtable ) fprintf(stderr, "ld: building hashtable of %u entries for %s\n", count, this->path()); - const struct dylib_table_of_contents* toc = (dylib_table_of_contents*)(fileContent + dynamicInfo->tocoff()); - for (int32_t i = 0; i < count; ++i) { ---- ld64-242/src/ld/parsers/macho_relocatable_file.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/parsers/macho_relocatable_file.cpp 2015-08-03 01:12:27.000000000 +0200 -@@ -66,7 +66,7 @@ - // forward reference - template <typename A> class Parser; - template <typename A> class Atom; --template <typename A> class Section; -+template <typename A> class MRFSection; - template <typename A> class CFISection; - template <typename A> class CUSection; - -@@ -106,14 +106,14 @@ - const uint8_t* fileContent() { return _fileContent; } - private: - friend class Atom<A>; -- friend class Section<A>; -+ friend class MRFSection<A>; - friend class Parser<A>; - friend class CFISection<A>::OAS; - - typedef typename A::P P; - - const uint8_t* _fileContent; -- Section<A>** _sectionsArray; -+ MRFSection<A>** _sectionsArray; - uint8_t* _atomsArray; - uint8_t* _aliasAtomsArray; - uint32_t _sectionsArrayCount; -@@ -138,14 +138,14 @@ - - - template <typename A> --class Section : public ld::Section -+class MRFSection : public ld::Section - { - public: - typedef typename A::P::uint_t pint_t; - typedef typename A::P P; - typedef typename A::P::E E; - -- virtual ~Section() { } -+ virtual ~MRFSection() { } - class File<A>& file() const { return _file; } - const macho_section<P>* machoSection() const { return _machOSection; } - uint32_t sectionNum(class Parser<A>&) const; -@@ -169,10 +169,10 @@ - static const char* makeSectionName(const macho_section<typename A::P>* s); - - protected: -- Section(File<A>& f, const macho_section<typename A::P>* s) -+ MRFSection(File<A>& f, const macho_section<typename A::P>* s) - : ld::Section(makeSegmentName(s), makeSectionName(s), sectionType(s)), - _file(f), _machOSection(s), _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { } -- Section(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false) -+ MRFSection(File<A>& f, const char* segName, const char* sectName, ld::Section::Type t, bool hidden=false) - : ld::Section(segName, sectName, t, hidden), _file(f), _machOSection(NULL), - _beginAtoms(NULL), _endAtoms(NULL), _hasAliases(false) { } - -@@ -196,11 +196,11 @@ - - - template <typename A> --class CFISection : public Section<A> -+class CFISection : public MRFSection<A> - { - public: - CFISection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - uint32_t cfiCount(Parser<A>& parser); - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeCFI; } -@@ -260,11 +260,11 @@ - - - template <typename A> --class CUSection : public Section<A> -+class CUSection : public MRFSection<A> - { - public: - CUSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - - typedef typename A::P::uint_t pint_t; - typedef typename A::P P; -@@ -301,11 +301,11 @@ - - - template <typename A> --class TentativeDefinitionSection : public Section<A> -+class TentativeDefinitionSection : public MRFSection<A> - { - public: - TentativeDefinitionSection(Parser<A>& parser, File<A>& f) -- : Section<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {} -+ : MRFSection<A>(f, "__DATA", "__comm/tent", ld::Section::typeTentativeDefs) {} - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeZeroFill; } - virtual bool addFollowOnFixups() const { return false; } -@@ -323,11 +323,11 @@ - - - template <typename A> --class AbsoluteSymbolSection : public Section<A> -+class AbsoluteSymbolSection : public MRFSection<A> - { - public: - AbsoluteSymbolSection(Parser<A>& parser, File<A>& f) -- : Section<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {} -+ : MRFSection<A>(f, "__DATA", "__abs", ld::Section::typeAbsoluteSymbols, true) {} - - virtual ld::Atom::ContentType contentType() { return ld::Atom::typeUnclassified; } - virtual bool dontDeadStrip() { return false; } -@@ -349,7 +349,7 @@ - - - template <typename A> --class SymboledSection : public Section<A> -+class SymboledSection : public MRFSection<A> - { - public: - SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s); -@@ -381,11 +381,11 @@ - - - template <typename A> --class ImplicitSizeSection : public Section<A> -+class ImplicitSizeSection : public MRFSection<A> - { - public: - ImplicitSizeSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s) { } -+ : MRFSection<A>(f, s) { } - virtual uint32_t computeAtomCount(class Parser<A>& parser, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&); - virtual uint32_t appendAtoms(class Parser<A>& parser, uint8_t* buffer, struct Parser<A>::LabelAndCFIBreakIterator& it, const struct Parser<A>::CFI_CU_InfoArrays&); - protected: -@@ -722,8 +722,8 @@ - - public: - // methods for all atoms from mach-o object file -- Section<A>& sect() const { return (Section<A>&)section(); } -- File<A>& machofile() const { return ((Section<A>*)(this->_section))->file(); } -+ MRFSection<A>& sect() const { return (MRFSection<A>&)section(); } -+ File<A>& machofile() const { return ((MRFSection<A>*)(this->_section))->file(); } - void setFixupsRange(uint32_t s, uint32_t c); - void setUnwindInfoRange(uint32_t s, uint32_t c); - void extendUnwindInfoRange(); -@@ -740,7 +740,7 @@ - typedef typename A::P::E E; - typedef typename A::P::uint_t pint_t; - // constuct via all attributes -- Atom(Section<A>& sct, const char* nm, pint_t addr, uint64_t sz, -+ Atom(MRFSection<A>& sct, const char* nm, pint_t addr, uint64_t sz, - ld::Atom::Definition d, ld::Atom::Combine c, ld::Atom::Scope s, - ld::Atom::ContentType ct, ld::Atom::SymbolTableInclusion i, - bool dds, bool thumb, bool al, ld::Atom::Alignment a) -@@ -750,7 +750,7 @@ - _unwindInfoStartIndex(0), _fixupsCount(0), - _lineInfoCount(0), _unwindInfoCount(0) { } - // construct via symbol table entry -- Atom(Section<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym, -+ Atom(MRFSection<A>& sct, Parser<A>& parser, const macho_nlist<P>& sym, - uint64_t sz, bool alias=false) - : ld::Atom((ld::Section&)sct, parser.definitionFromSymbol(sym), - parser.combineFromSymbol(sym), parser.scopeFromSymbol(sym), -@@ -773,7 +773,7 @@ - - private: - friend class Parser<A>; -- friend class Section<A>; -+ friend class MRFSection<A>; - friend class CStringSection<A>; - friend class AbsoluteSymbolSection<A>; - -@@ -1040,8 +1040,8 @@ - uint32_t undefinedStartIndex() { return _undefinedStartIndex; } - uint32_t undefinedEndIndex() { return _undefinedEndIndex; } - void addFixup(FixupInAtom f) { _allFixups.push_back(f); } -- Section<A>* sectionForNum(unsigned int sectNum); -- Section<A>* sectionForAddress(pint_t addr); -+ MRFSection<A>* sectionForNum(unsigned int sectNum); -+ MRFSection<A>* sectionForAddress(pint_t addr); - Atom<A>* findAtomByAddress(pint_t addr); - Atom<A>* findAtomByAddressOrNullIfStub(pint_t addr); - Atom<A>* findAtomByAddressOrLocalTargetOfStub(pint_t addr, uint32_t* offsetInAtom); -@@ -1084,7 +1084,7 @@ - : sortedSymbolIndexes(ssa), sortedSymbolCount(ssc), cfiStartsArray(cfisa), - cfiStartsCount(cfisc), fileHasOverlappingSymbols(ols), - newSection(false), cfiIndex(0), symIndex(0) {} -- bool next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, -+ bool next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, - pint_t* addr, pint_t* size, const macho_nlist<P>** sym); - pint_t peek(Parser<A>& parser, pint_t startAddr, pint_t endAddr); - void beginSection() { newSection = true; symIndex = 0; } -@@ -1113,7 +1113,7 @@ - - - private: -- friend class Section<A>; -+ friend class MRFSection<A>; - - enum SectionType { sectionTypeIgnore, sectionTypeLiteral4, sectionTypeLiteral8, sectionTypeLiteral16, - sectionTypeNonLazy, sectionTypeCFI, sectionTypeCString, sectionTypeCStringPointer, -@@ -1465,7 +1465,7 @@ - // was becuase of a label, the symbol). Returns false when no more chunks. - // - template <typename A> --bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const Section<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, -+bool Parser<A>::LabelAndCFIBreakIterator::next(Parser<A>& parser, const MRFSection<A>& sect, uint32_t sectNum, pint_t startAddr, pint_t endAddr, - pint_t* addr, pint_t* size, const macho_nlist<P>** symbol) - { - // may not be a label on start of section, but need atom demarcation there -@@ -1618,7 +1618,7 @@ - - #if SUPPORT_ARCH_arm_any - template <> --typename arm::P::uint_t Parser<arm>::realAddr(typename arm::P::uint_t addr) -+arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr) - { - return addr & (-2); - } -@@ -1667,7 +1667,7 @@ - uint32_t sortedSymbolIndexes[_symbolsInSections]; - this->makeSortedSymbolsArray(sortedSymbolIndexes, sortedSectionIndexes); - -- // allocate Section<A> object for each mach-o section -+ // allocate MRFSection<A> object for each mach-o section - makeSections(); - - // if it exists, do special early parsing of __compact_unwind section -@@ -1764,7 +1764,7 @@ - #endif - } - -- Section<A>** sections = _file->_sectionsArray; -+ MRFSection<A>** sections = _file->_sectionsArray; - uint32_t sectionsCount = _file->_sectionsArrayCount; - - // figure out how many atoms will be allocated and allocate -@@ -2331,11 +2331,11 @@ - _file->_swiftVersion = ((flags >> 8) & 0xFF); - if ( sect->size() > 8 ) { - warning("section %s/%s has unexpectedly large size %llu in %s", -- sect->segname(), Section<A>::makeSectionName(sect), sect->size(), _file->path()); -+ sect->segname(), MRFSection<A>::makeSectionName(sect), sect->size(), _file->path()); - } - } - else { -- warning("can't parse %s/%s section in %s", sect->segname(), Section<A>::makeSectionName(sect), _file->path()); -+ warning("can't parse %s/%s section in %s", sect->segname(), MRFSection<A>::makeSectionName(sect), _file->path()); - } - continue; - } -@@ -2431,24 +2431,24 @@ - // sort by address (mach-o object files don't aways have sections sorted) - ::qsort(machOSects, count, sizeof(MachOSectionAndSectionClass<P>), MachOSectionAndSectionClass<P>::sorter); - -- // we will synthesize a dummy Section<A> object for tentative definitions -+ // we will synthesize a dummy MRFSection<A> object for tentative definitions - if ( _tentativeDefinitionCount > 0 ) { - totalSectionsSize += sizeof(TentativeDefinitionSection<A>); - machOSects[count++].type = sectionTypeTentativeDefinitions; - } - -- // we will synthesize a dummy Section<A> object for Absolute symbols -+ // we will synthesize a dummy MRFSection<A> object for Absolute symbols - if ( _absoluteSymbolCount > 0 ) { - totalSectionsSize += sizeof(AbsoluteSymbolSection<A>); - machOSects[count++].type = sectionTypeAbsoluteSymbols; - } - - // allocate one block for all Section objects as well as pointers to each -- uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(Section<A>*)]; -- _file->_sectionsArray = (Section<A>**)space; -+ uint8_t* space = new uint8_t[totalSectionsSize+count*sizeof(MRFSection<A>*)]; -+ _file->_sectionsArray = (MRFSection<A>**)space; - _file->_sectionsArrayCount = count; -- Section<A>** objects = _file->_sectionsArray; -- space += count*sizeof(Section<A>*); -+ MRFSection<A>** objects = _file->_sectionsArray; -+ space += count*sizeof(MRFSection<A>*); - for (uint32_t i=0; i < count; ++i) { - switch ( machOSects[i].type ) { - case sectionTypeIgnore: -@@ -2536,7 +2536,7 @@ - - - template <typename A> --Section<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr) -+MRFSection<A>* Parser<A>::sectionForAddress(typename A::P::uint_t addr) - { - for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) { - const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection(); -@@ -2563,7 +2563,7 @@ - } - - template <typename A> --Section<A>* Parser<A>::sectionForNum(unsigned int num) -+MRFSection<A>* Parser<A>::sectionForNum(unsigned int num) - { - for (uint32_t i=0; i < _file->_sectionsArrayCount; ++i ) { - const macho_section<typename A::P>* sect = _file->_sectionsArray[i]->machoSection(); -@@ -2579,7 +2579,7 @@ - template <typename A> - Atom<A>* Parser<A>::findAtomByAddress(pint_t addr) - { -- Section<A>* section = this->sectionForAddress(addr); -+ MRFSection<A>* section = this->sectionForAddress(addr); - return section->findAtomByAddress(addr); - } - -@@ -2636,7 +2636,7 @@ - target.addend = 0; - return; - } -- Section<A>* section = this->sectionForAddress(addr); -+ MRFSection<A>* section = this->sectionForAddress(addr); - target.atom = section->findAtomByAddress(addr); - target.addend = addr - target.atom->_objAddress; - target.weakImport = false; -@@ -2684,7 +2684,7 @@ - } - return; - } -- Section<A>* section = this->sectionForNum(sectNum); -+ MRFSection<A>* section = this->sectionForNum(sectNum); - target.atom = section->findAtomByAddress(addr); - if ( target.atom == NULL ) { - typedef typename A::P::sint_t sint_t; -@@ -3892,7 +3892,7 @@ - } - - template <typename A> --const char* Section<A>::makeSegmentName(const macho_section<typename A::P>* sect) -+const char* MRFSection<A>::makeSegmentName(const macho_section<typename A::P>* sect) - { - // mach-o section record only has room for 16-byte seg/sect names - // so a 16-byte name has no trailing zero -@@ -3905,7 +3905,7 @@ - } - - template <typename A> --const char* Section<A>::makeSectionName(const macho_section<typename A::P>* sect) -+const char* MRFSection<A>::makeSectionName(const macho_section<typename A::P>* sect) - { - const char* name = sect->sectname(); - if ( strlen(name) < 16 ) -@@ -3939,13 +3939,13 @@ - } - - template <typename A> --bool Section<A>::readable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::readable(const macho_section<typename A::P>* sect) - { - return true; - } - - template <typename A> --bool Section<A>::writable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::writable(const macho_section<typename A::P>* sect) - { - // mach-o .o files do not contain segment permissions - // we just know TEXT is special -@@ -3953,7 +3953,7 @@ - } - - template <typename A> --bool Section<A>::exectuable(const macho_section<typename A::P>* sect) -+bool MRFSection<A>::exectuable(const macho_section<typename A::P>* sect) - { - // mach-o .o files do not contain segment permissions - // we just know TEXT is special -@@ -3962,7 +3962,7 @@ - - - template <typename A> --ld::Section::Type Section<A>::sectionType(const macho_section<typename A::P>* sect) -+ld::Section::Type MRFSection<A>::sectionType(const macho_section<typename A::P>* sect) - { - switch ( sect->flags() & SECTION_TYPE ) { - case S_ZEROFILL: -@@ -4040,7 +4040,7 @@ - - - template <typename A> --Atom<A>* Section<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end) -+Atom<A>* MRFSection<A>::findContentAtomByAddress(pint_t addr, class Atom<A>* start, class Atom<A>* end) - { - // do a binary search of atom array - uint32_t atomCount = end - start; -@@ -4072,7 +4072,7 @@ - } - - template <typename A> --ld::Atom::Alignment Section<A>::alignmentForAddress(pint_t addr) -+ld::Atom::Alignment MRFSection<A>::alignmentForAddress(pint_t addr) - { - const uint32_t sectionAlignment = this->_machOSection->align(); - uint32_t modulus = (addr % (1 << sectionAlignment)); -@@ -4082,7 +4082,7 @@ - } - - template <typename A> --uint32_t Section<A>::sectionNum(class Parser<A>& parser) const -+uint32_t MRFSection<A>::sectionNum(class Parser<A>& parser) const - { - if ( _machOSection == NULL ) - return 0; -@@ -4727,7 +4727,7 @@ - // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t nlPointerAddr = *content; -- Section<x86>* nlSection = parser.sectionForAddress(nlPointerAddr); -+ MRFSection<x86>* nlSection = parser.sectionForAddress(nlPointerAddr); - if ( nlSection->type() == ld::Section::typeCode ) { - // personality function is defined in this .o file, so this is a direct reference to it - // atoms may not be constructed yet, so scan symbol table for labels -@@ -4754,7 +4754,7 @@ - else { - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t personalityAddr = *content; -- Section<arm64>* personalitySection = parser.sectionForAddress(personalityAddr); -+ MRFSection<arm64>* personalitySection = parser.sectionForAddress(personalityAddr); - assert((personalitySection->type() == ld::Section::typeCode) && "personality column in __compact_unwind section is not pointer to function"); - // atoms may not be constructed yet, so scan symbol table for labels - const char* name = parser.scanSymbolTableForAddress(personalityAddr); -@@ -4776,7 +4776,7 @@ - // support __LD, __compact_unwind personality entries which are pointer to personality non-lazy pointer - const pint_t* content = (pint_t*)(this->file().fileContent() + this->_machOSection->offset() + reloc->r_address()); - pint_t nlPointerAddr = *content; -- Section<arm>* nlSection = parser.sectionForAddress(nlPointerAddr); -+ MRFSection<arm>* nlSection = parser.sectionForAddress(nlPointerAddr); - if ( nlSection->type() == ld::Section::typeCode ) { - // personality function is defined in this .o file, so this is a direct reference to it - // atoms may not be constructed yet, so scan symbol table for labels -@@ -4937,7 +4937,7 @@ - - template <typename A> - SymboledSection<A>::SymboledSection(Parser<A>& parser, File<A>& f, const macho_section<typename A::P>* s) -- : Section<A>(f, s), _type(ld::Atom::typeUnclassified) -+ : MRFSection<A>(f, s), _type(ld::Atom::typeUnclassified) - { - switch ( s->flags() & SECTION_TYPE ) { - case S_ZEROFILL: -@@ -4983,7 +4983,7 @@ - if ( ! this->_file.canScatterAtoms() ) - return true; - // call inherited -- return Section<A>::dontDeadStrip(); -+ return MRFSection<A>::dontDeadStrip(); - } - return false; - } -@@ -5847,7 +5847,7 @@ - - - template <> --uint32_t Section<x86_64>::x86_64PcRelOffset(uint8_t r_type) -+uint32_t MRFSection<x86_64>::x86_64PcRelOffset(uint8_t r_type) - { - switch ( r_type ) { - case X86_64_RELOC_SIGNED: -@@ -5864,7 +5864,7 @@ - - - template <> --bool Section<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<x86_64>::addRelocFixup(class Parser<x86_64>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - uint64_t srcAddr = sect->addr() + reloc->r_address(); -@@ -6071,7 +6071,7 @@ - - - template <> --bool Section<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<x86>::addRelocFixup(class Parser<x86>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - uint32_t srcAddr; -@@ -6312,7 +6312,7 @@ - - #if SUPPORT_ARCH_arm_any - template <> --bool Section<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<arm>::addRelocFixup(class Parser<arm>& parser, const macho_relocation_info<P>* reloc) - { - const macho_section<P>* sect = this->machoSection(); - bool result = false; -@@ -6779,7 +6779,7 @@ - - #if SUPPORT_ARCH_arm64 - template <> --bool Section<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc) -+bool MRFSection<arm64>::addRelocFixup(class Parser<arm64>& parser, const macho_relocation_info<P>* reloc) - { - bool result = false; - Parser<arm64>::SourceLocation src; -@@ -7177,7 +7177,7 @@ - - #if SUPPORT_ARCH_arm64 - template <> --void Section<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) { -+void MRFSection<arm64>::addLOH(class Parser<arm64>& parser, int kind, int count, const uint64_t addrs[]) { - switch (kind) { - case LOH_ARM64_ADRP_ADRP: - case LOH_ARM64_ADRP_LDR: -@@ -7232,18 +7232,18 @@ - extra.info.delta2 = (count > 1) ? ((addrs[1] - lowestAddress) >> 2) : 0; - extra.info.delta3 = (count > 2) ? ((addrs[2] - lowestAddress) >> 2) : 0; - extra.info.delta4 = (count > 3) ? ((addrs[3] - lowestAddress) >> 2) : 0; -- typename Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress()); -+ Parser<arm64>::SourceLocation src(inAtom, lowestAddress- inAtom->objectAddress()); - parser.addFixup(src, ld::Fixup::k1of1, ld::Fixup::kindLinkerOptimizationHint, extra.addend); - } - #endif - - template <typename A> --void Section<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) { -+void MRFSection<A>::addLOH(class Parser<A>& parser, int kind, int count, const uint64_t addrs[]) { - - } - - template <typename A> --void Section<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&) -+void MRFSection<A>::makeFixups(class Parser<A>& parser, const struct Parser<A>::CFI_CU_InfoArrays&) - { - const macho_section<P>* sect = this->machoSection(); - const macho_relocation_info<P>* relocs = (macho_relocation_info<P>*)(file().fileContent() + sect->reloff()); -@@ -7254,7 +7254,7 @@ - ++r; // skip next - } - catch (const char* msg) { -- throwf("in section %s,%s reloc %u: %s", sect->segname(), Section<A>::makeSectionName(sect), r, msg); -+ throwf("in section %s,%s reloc %u: %s", sect->segname(), MRFSection<A>::makeSectionName(sect), r, msg); - } - } - -@@ -7280,7 +7280,7 @@ - } - if ( !this->_altEntries.empty() && !this->addFollowOnFixups() ) { - if ( _altEntries.count(_beginAtoms) != 0 ) -- warning("N_ALT_ENTRY bit set on first atom in section %s/%s", sect->segname(), Section<A>::makeSectionName(sect)); -+ warning("N_ALT_ENTRY bit set on first atom in section %s/%s", sect->segname(), MRFSection<A>::makeSectionName(sect)); - - Atom<A>* end = &_endAtoms[-1]; - for(Atom<A>* p = _beginAtoms; p < end; ++p) { ---- ld64-242/src/ld/passes/dtrace_dof.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/passes/dtrace_dof.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -30,8 +30,17 @@ - - #include <vector> - #include <map> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#include <tr1/unordered_set> -+#define UNORDERED_MAP tr1::unordered_map -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_map> - #include <unordered_set> -+#define UNORDERED_MAP unordered_map -+#define UNORDERED_SET unordered_set -+#endif - - #include "ld.hpp" - #include "MachOFileAbstraction.hpp" -@@ -111,8 +120,8 @@ - uint32_t offset; - const char* probeName; - }; --typedef std::unordered_map<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes; --typedef std::unordered_set<const char*, CStringHash, CStringEquals> CStringSet; -+typedef std::UNORDERED_MAP<const char*, std::vector<DTraceProbeInfo>, CStringHash, CStringEquals> ProviderToProbes; -+typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> CStringSet; - - - ---- ld64-242/src/ld/passes/order.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/passes/order.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -32,7 +32,13 @@ - #include <vector> - #include <map> - #include <set> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "ld.hpp" - #include "order.h" -@@ -85,7 +91,7 @@ - ld::Internal& _state; - }; - -- typedef std::unordered_map<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom; -+ typedef std::UNORDERED_MAP<const char*, const ld::Atom*, CStringHash, CStringEquals> NameToAtom; - - typedef std::map<const ld::Atom*, const ld::Atom*> AtomToAtom; - ---- ld64-242/src/ld/Resolver.h.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/Resolver.h 2015-08-03 01:11:57.000000000 +0200 -@@ -42,7 +42,13 @@ - #include <mach-o/dyld.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -105,7 +111,7 @@ - void doLinkerOption(const std::vector<const char*>& linkerOption, const char* fileName); - void dumpAtoms(); - -- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet; -+ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet; - - class NotLive { - public: ---- ld64-242/src/ld/SymbolTable.h.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/ld/SymbolTable.h 2015-08-03 01:11:57.000000000 +0200 -@@ -42,7 +42,13 @@ - #include <mach-o/dyld.h> - - #include <vector> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_map> -+#define UNORDERED_MAP tr1::unordered_map -+#else - #include <unordered_map> -+#define UNORDERED_MAP unordered_map -+#endif - - #include "Options.h" - #include "ld.hpp" -@@ -57,38 +63,38 @@ - typedef uint32_t IndirectBindingSlot; - - private: -- typedef std::unordered_map<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot; -+ typedef std::UNORDERED_MAP<const char*, IndirectBindingSlot, CStringHash, CStringEquals> NameToSlot; - - class ContentFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ContentFuncs, ContentFuncs> ContentToSlot; - - class ReferencesHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, ReferencesHashFuncs, ReferencesHashFuncs> ReferencesToSlot; - - class CStringHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, CStringHashFuncs, CStringHashFuncs> CStringToSlot; - - class UTF16StringHashFuncs { - public: - size_t operator()(const ld::Atom*) const; - bool operator()(const ld::Atom* left, const ld::Atom* right) const; - }; -- typedef std::unordered_map<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot; -+ typedef std::UNORDERED_MAP<const ld::Atom*, IndirectBindingSlot, UTF16StringHashFuncs, UTF16StringHashFuncs> UTF16StringToSlot; - - typedef std::map<IndirectBindingSlot, const char*> SlotToName; -- typedef std::unordered_map<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap; -+ typedef std::UNORDERED_MAP<const char*, CStringToSlot*, CStringHash, CStringEquals> NameToMap; - - typedef std::vector<const ld::Atom *> DuplicatedSymbolAtomList; - typedef std::map<const char *, DuplicatedSymbolAtomList * > DuplicateSymbols; ---- ld64-242/src/other/dyldinfo.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/other/dyldinfo.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -33,7 +33,6 @@ - - #include <vector> - #include <set> --#include <unordered_set> - - #include "configure.h" - #include "MachOFileAbstraction.hpp" ---- ld64-242/src/other/machochecker.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/other/machochecker.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -33,7 +33,13 @@ - - #include <vector> - #include <set> -+#ifdef __GLIBCXX__ -+#include <tr1/unordered_set> -+#define UNORDERED_SET tr1::unordered_set -+#else - #include <unordered_set> -+#define UNORDERED_SET unordered_set -+#endif - - #include "configure.h" - -@@ -124,7 +130,7 @@ - bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } - }; - -- typedef std::unordered_set<const char*, CStringHash, CStringEquals> StringSet; -+ typedef std::UNORDERED_SET<const char*, CStringHash, CStringEquals> StringSet; - - MachOChecker(const uint8_t* fileContent, uint32_t fileLength, const char* path); - void checkMachHeader(); ---- ld64-242/src/other/unwinddump.cpp.gcc 2015-08-03 01:11:48.000000000 +0200 -+++ ld64-242/src/other/unwinddump.cpp 2015-08-03 01:11:57.000000000 +0200 -@@ -33,7 +33,6 @@ - - #include <vector> - #include <set> --#include <unordered_set> - - #include "configure.h" - #include "MachOFileAbstraction.hpp" diff --git a/sys-devel/binutils-apple/files/ld64-242-noarm.patch b/sys-devel/binutils-apple/files/ld64-242-noarm.patch deleted file mode 100644 index adfae99ffef8..000000000000 --- a/sys-devel/binutils-apple/files/ld64-242-noarm.patch +++ /dev/null @@ -1,1255 +0,0 @@ -Fully conditionalise arm support so it can be disabled on 10.4. - ---- ld64-242/src/ld/HeaderAndLoadCommands.hpp.noarm 2014-05-08 03:38:16.000000000 +0200 -+++ ld64-242/src/ld/HeaderAndLoadCommands.hpp 2015-08-03 01:09:13.000000000 +0200 -@@ -607,8 +607,12 @@ - - template <> uint32_t HeaderAndLoadCommandsAtom<x86>::cpuType() const { return CPU_TYPE_I386; } - template <> uint32_t HeaderAndLoadCommandsAtom<x86_64>::cpuType() const { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> uint32_t HeaderAndLoadCommandsAtom<arm>::cpuType() const { return CPU_TYPE_ARM; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuType() const { return CPU_TYPE_ARM64; } -+#endif - - - -@@ -627,17 +631,21 @@ - return _state.cpuSubType; - } - -+#if SUPPORT_ARCH_arm_any - template <> - uint32_t HeaderAndLoadCommandsAtom<arm>::cpuSubType() const - { - return _state.cpuSubType; - } -+#endif - -+#if SUPPORT_ARCH_arm64 - template <> - uint32_t HeaderAndLoadCommandsAtom<arm64>::cpuSubType() const - { - return CPU_SUBTYPE_ARM64_ALL; - } -+#endif - - - ---- ld64-242/src/ld/LinkEdit.hpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/LinkEdit.hpp 2015-08-03 01:09:13.000000000 +0200 -@@ -1595,6 +1595,7 @@ - for (ld::Fixup::iterator fit = atom->fixupsBegin(); fit != atom->fixupsEnd(); ++fit) { - if ( fit->kind != ld::Fixup::kindLinkerOptimizationHint) - continue; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 extra; - extra.addend = fit->u.addend; - _encodedData.append_uleb128(extra.info.kind); -@@ -1606,6 +1607,7 @@ - _encodedData.append_uleb128((extra.info.delta3 << 2) + fit->offsetInAtom + address); - if ( extra.info.count > 2 ) - _encodedData.append_uleb128((extra.info.delta4 << 2) + fit->offsetInAtom + address); -+#endif - } - } - } ---- ld64-242/src/ld/Options.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/Options.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -579,8 +579,13 @@ - #endif - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif -+#if SUPPORT_ARCH_arm_any || SUPPORT_ARCH_arm64 - if ( (fMacVersionMin == ld::macVersionUnset) && (fIOSVersionMin == ld::iOSVersionUnset) && (fOutputKind != Options::kObjectFile) ) { - #if defined(DEFAULT_IPHONEOS_MIN_VERSION) - warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION); -@@ -591,6 +596,7 @@ - #endif - } - break; -+#endif - } - #ifdef SUPPORT_SNAPSHOTS - fLinkSnapshot.recordArch(fArchitectureName); -@@ -1687,9 +1693,11 @@ - symbolStart = NULL; - } - else if ( strncmp(symbolStart, "arm:", 4) == 0 ) { -+#if SUPPORT_ARCH_arm_any - if ( fArchitecture == CPU_TYPE_ARM ) - symbolStart = &symbolStart[4]; - else -+#endif - symbolStart = NULL; - } - if ( symbolStart != NULL ) { -@@ -3672,6 +3680,7 @@ - #endif - } - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) { - #if defined(DEFAULT_IPHONEOS_MIN_VERSION) -@@ -3683,6 +3692,7 @@ - #endif - } - break; -+#endif - default: - // architecture will be infered later by examining .o files - break; -@@ -3705,12 +3715,14 @@ - fMacVersionMin = ld::mac10_4; - } - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - if ( fIOSVersionMin < ld::iOS_7_0 ) { - //warning("-mios_version_min should be 7.0 or later for arm64"); - fIOSVersionMin = ld::iOS_7_0; - } - break; -+#endif - } - - // default to adding functions start for dynamic code, static code must opt-in -@@ -3750,6 +3762,7 @@ - fAllowTextRelocs = true; - fUndefinedTreatment = kUndefinedDynamicLookup; - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - // arm64 uses new MH_KEXT_BUNDLE type - fMakeCompressedDyldInfo = false; -@@ -3758,6 +3771,8 @@ - fKextsUseStubs = true; - fUndefinedTreatment = kUndefinedDynamicLookup; - break; -+#endif -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fIOSVersionMin >= ld::iOS_5_0 ) { - // iOS 5.0 and later use new MH_KEXT_BUNDLE type -@@ -3769,6 +3784,7 @@ - fUndefinedTreatment = kUndefinedDynamicLookup; - break; - } -+#endif - // else use object file - case CPU_TYPE_I386: - // use .o files -@@ -3821,6 +3837,7 @@ - if ( fSplitSegs && (fBaseWritableAddress-fBaseAddress != 0x10000000) ) - fBaseWritableAddress = fBaseAddress + 0x10000000; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fOutputKind != Options::kDynamicLibrary ) { - fSplitSegs = false; -@@ -3831,6 +3848,7 @@ - fBaseWritableAddress = fBaseAddress + 0x08000000; - } - break; -+#endif - default: - fSplitSegs = false; - fBaseAddress = 0; -@@ -3845,6 +3863,7 @@ - break; - case CPU_TYPE_X86_64: - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - switch ( fOutputKind ) { - case Options::kDynamicExecutable: -@@ -3867,6 +3886,7 @@ - fBaseAddress = 0; - } - break; -+#endif - } - - // <rdar://problem/6138961> -r implies no prebinding for all architectures -@@ -3912,6 +3932,7 @@ - case CPU_TYPE_X86_64: - fPrebind = false; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - switch ( fOutputKind ) { - case Options::kDynamicExecutable: -@@ -3929,6 +3950,7 @@ - break; - } - break; -+#endif - } - } - -@@ -3955,10 +3977,12 @@ - case CPU_TYPE_I386: - if ( fIOSVersionMin != ld::iOSVersionUnset ) // simulator never needs modules - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fPrebind ) - fNeedsModuleTable = true; // redo_prebinding requires a module table - break; -+#endif - } - } - -@@ -3974,7 +3998,9 @@ - switch ( fArchitecture ) { - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - switch ( fOutputKind ) { - case Options::kObjectFile: - case Options::kStaticExecutable: -@@ -4037,7 +4063,15 @@ - fEncryptable = false; - break; - } -- if ( (fArchitecture != CPU_TYPE_ARM) && (fArchitecture != CPU_TYPE_ARM64) ) -+ if ( -+#if SUPPORT_ARCH_arm_any -+ (fArchitecture != CPU_TYPE_ARM) && -+#endif -+#if SUPPORT_ARCH_arm64 -+ (fArchitecture != CPU_TYPE_ARM64) && -+#endif -+ 1 -+ ) - fEncryptable = false; - - // don't move inits in dyld because dyld wants certain -@@ -4089,11 +4123,15 @@ - - // only ARM and x86_64 enforces that cpu-sub-types must match - switch ( fArchitecture ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - case CPU_TYPE_X86_64: - break; - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - fAllowCpuSubtypeMismatches = true; - break; - } -@@ -4139,6 +4177,7 @@ - fPositionIndependentExecutable = true; - } - -+#if SUPPORT_ARCH_arm_any - // armv7 for iOS4.3 defaults to PIE - if ( (fArchitecture == CPU_TYPE_ARM) - && fArchSupportsThumb2 -@@ -4146,6 +4185,7 @@ - && (fIOSVersionMin >= ld::iOS_4_3) ) { - fPositionIndependentExecutable = true; - } -+#endif - - // Simulator defaults to PIE - if ( fTargetIOSSimulator && (fOutputKind == kDynamicExecutable) ) -@@ -4155,10 +4195,12 @@ - if ( fDisablePositionIndependentExecutable ) - fPositionIndependentExecutable = false; - -+#if SUPPORT_ARCH_arm64 - // arm64 is always PIE - if ( (fArchitecture == CPU_TYPE_ARM64) && (fOutputKind == kDynamicExecutable) ) { - fPositionIndependentExecutable = true; - } -+#endif - - // set fOutputSlidable - switch ( fOutputKind ) { -@@ -4184,9 +4226,11 @@ - if ( fMacVersionMin >= ld::mac10_7 ) { - fTLVSupport = true; - } -+#if SUPPORT_ARCH_arm64 - else if ( (fArchitecture == CPU_TYPE_ARM64) && (fIOSVersionMin >= ld::iOS_8_0) ) { - fTLVSupport = true; - } -+#endif - - // default to adding version load command for dynamic code, static code must opt-in - switch ( fOutputKind ) { -@@ -4524,12 +4568,16 @@ - if ( fStackAddr != 0 ) { - switch (fArchitecture) { - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - if ( fStackAddr > 0xFFFFFFFFULL ) - throw "-stack_addr must be < 4G for 32-bit processes"; - break; - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - break; - } - if ( (fStackAddr & -4096) != fStackAddr ) -@@ -4550,6 +4598,7 @@ - if ( (fStackAddr > 0xB0000000ULL) && ((fStackAddr-fStackSize) < 0xB0000000ULL) ) - warning("custom stack placement overlaps and will disable shared region"); - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( fStackSize > 0x2F000000 ) - throw "-stack_size must be < 752MB"; -@@ -4558,11 +4607,13 @@ - if ( fStackAddr > 0x30000000ULL) - throw "-stack_addr must be < 0x30000000 for arm"; - break; -+#endif - case CPU_TYPE_X86_64: - if ( fStackAddr == 0 ) { - fStackAddr = 0x00007FFF5C000000ULL; - } - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - if ( fStackSize > 0x20000000 ) - throw "-stack_size must be < 512MB"; -@@ -4570,6 +4621,7 @@ - fStackAddr = 0x120000000ULL; - } - break; -+#endif - } - if ( (fStackSize & -4096) != fStackSize ) - throw "-stack_size must be multiples of 4K"; -@@ -4679,8 +4731,12 @@ - alterObjC1ClassNamesToObjC2 = true; - break; - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - alterObjC1ClassNamesToObjC2 = true; - break; - } -@@ -4772,11 +4828,15 @@ - // zero page size not specified on command line, set default - switch (fArchitecture) { - case CPU_TYPE_I386: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif - // first 4KB for 32-bit architectures - fZeroPageSize = 0x1000; - break; -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - case CPU_TYPE_X86_64: - // first 4GB for x86_64 on all OS's - fZeroPageSize = 0x100000000ULL; -@@ -4878,9 +4938,11 @@ - - // -force_cpusubtype_ALL is not supported for ARM - if ( fForceSubtypeAll ) { -+#if SUPPORT_ARCH_arm_any - if ( fArchitecture == CPU_TYPE_ARM ) { - warning("-force_cpusubtype_ALL will become unsupported for ARM architectures"); - } -+#endif - } - - // -reexported_symbols_list can only be used with -dynamiclib ---- ld64-242/src/ld/OutputFile.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/OutputFile.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -631,7 +631,12 @@ - // is encoded in mach-o the same as: - // .long _foo + 0x40000000 - // so if _foo lays out to 0xC0000100, the first is ok, but the second is not. -- if ( (_options.architecture() == CPU_TYPE_ARM) || (_options.architecture() == CPU_TYPE_I386) ) { -+ if ( -+#if SUPPORT_ARCH_arm_any -+ (_options.architecture() == CPU_TYPE_ARM) || -+#endif -+ (_options.architecture() == CPU_TYPE_I386) || -+ 0) { - // Unlikely userland code does funky stuff like this, so warn for them, but not warn for -preload or -static - if ( (_options.outputKind() != Options::kPreload) && (_options.outputKind() != Options::kStaticExecutable) ) { - warning("32-bit absolute address out of range (0x%08llX max is 4GB): from %s + 0x%08X (0x%08llX) to 0x%08llX", -@@ -1235,22 +1240,26 @@ - return false; - const ld::Fixup* f; - switch ( fixup->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64Page21: - return !mustBeGOT; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPage21: - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPage21: - return true; -+#endif - case ld::Fixup::kindSetTargetAddress: - f = fixup; - do { - ++f; - } while ( ! f->lastInCluster() ); - switch (f->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64Page21: - return !mustBeGOT; - case ld::Fixup::kindStoreARM64GOTLoadPage21: - case ld::Fixup::kindStoreARM64GOTLeaPage21: - return true; -+#endif - default: - break; - } -@@ -1267,22 +1276,26 @@ - return false; - const ld::Fixup* f; - switch ( fixup->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64PageOff12: - return !mustBeGOT; - case ld::Fixup::kindStoreTargetAddressARM64GOTLoadPageOff12: - case ld::Fixup::kindStoreTargetAddressARM64GOTLeaPageOff12: - return true; -+#endif - case ld::Fixup::kindSetTargetAddress: - f = fixup; - do { - ++f; - } while ( ! f->lastInCluster() ); - switch (f->kind ) { -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64PageOff12: - return !mustBeGOT; - case ld::Fixup::kindStoreARM64GOTLoadPageOff12: - case ld::Fixup::kindStoreARM64GOTLeaPageOff12: - return true; -+#endif - default: - break; - } -@@ -1318,7 +1331,9 @@ - std::map<uint32_t, const Fixup*> usedByHints; - for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) { - uint8_t* fixUpLocation = &buffer[fit->offsetInAtom]; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 lohExtra; -+#endif - switch ( (ld::Fixup::Kind)(fit->kind) ) { - case ld::Fixup::kindNone: - case ld::Fixup::kindNoneFollowOn: -@@ -1580,6 +1595,7 @@ - break; - case ld::Fixup::kindLinkerOptimizationHint: - // expand table of address/offsets used by hints -+#if SUPPORT_ARCH_arm64 - lohExtra.addend = fit->u.addend; - usedByHints[fit->offsetInAtom + (lohExtra.info.delta1 << 2)] = NULL; - if ( lohExtra.info.count > 0 ) -@@ -1588,6 +1604,7 @@ - usedByHints[fit->offsetInAtom + (lohExtra.info.delta3 << 2)] = NULL; - if ( lohExtra.info.count > 2 ) - usedByHints[fit->offsetInAtom + (lohExtra.info.delta4 << 2)] = NULL; -+#endif - break; - case ld::Fixup::kindStoreTargetAddressLittleEndian32: - accumulator = addressOf(state, fit, &toTarget); -@@ -2095,6 +2112,7 @@ - //uint8_t loadSize, destReg; - //uint32_t scaledOffset; - //uint32_t imm12; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 alt; - alt.addend = fit->u.addend; - setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA); -@@ -2453,6 +2471,7 @@ - fprintf(stderr, "unknown hint kind %d alt.info.kind at 0x%08llX\n", alt.info.kind, infoA.instructionAddress); - break; - } -+#endif - } - // apply hints pass 2 - for (ld::Fixup::iterator fit = atom->fixupsBegin(), end=atom->fixupsEnd(); fit != end; ++fit) { -@@ -2460,6 +2479,7 @@ - continue; - InstructionInfo infoA; - InstructionInfo infoB; -+#if SUPPORT_ARCH_arm64 - ld::Fixup::LOH_arm64 alt; - alt.addend = fit->u.addend; - setInfo(state, atom, buffer, usedByHints, fit->offsetInAtom, (alt.info.delta1 << 2), &infoA); -@@ -2491,6 +2511,7 @@ - } - break; - } -+#endif - } - } - #endif // SUPPORT_ARCH_arm64 -@@ -2505,6 +2526,7 @@ - for (uint8_t* p=from; p < to; ++p) - *p = 0x90; - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( thumb ) { - for (uint8_t* p=from; p < to; p += 2) -@@ -2515,6 +2537,7 @@ - OSWriteLittleInt32((uint32_t*)p, 0, 0xe1a00000); - } - break; -+#endif - default: - for (uint8_t* p=from; p < to; ++p) - *p = 0x00; -@@ -2843,7 +2866,11 @@ - - // in -r mode, clarify symbolTableNotInFinalLinkedImages - if ( _options.outputKind() == Options::kObjectFile ) { -- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0 ) { - // x86_64 .o files need labels on anonymous literal strings - if ( (sect->type() == ld::Section::typeCString) && (atom->combine() == ld::Atom::combineByNameAndContent) ) { - (const_cast<ld::Atom*>(atom))->setSymbolTableInclusion(ld::Atom::symbolTableIn); -@@ -4071,8 +4098,10 @@ - if ( _options.sharedRegionEligible() ) { - // <rdar://problem/13287063> when range checking, ignore high byte of arm64 addends - uint64_t checkAddend = addend; -+#if SUPPORT_ARCH_arm64 - if ( _options.architecture() == CPU_TYPE_ARM64 ) - checkAddend &= 0x0FFFFFFFFFFFFFFFULL; -+#endif - if ( checkAddend != 0 ) { - // make sure the addend does not cause the pointer to point outside the target's segment - // if it does, update_dyld_shared_cache will not be able to put this dylib into the shared cache -@@ -4279,12 +4308,17 @@ - - bool OutputFile::useExternalSectionReloc(const ld::Atom* atom, const ld::Atom* target, ld::Fixup* fixupWithTarget) - { -- if ( (_options.architecture() == CPU_TYPE_X86_64) || (_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0) { - // x86_64 and ARM64 use external relocations for everthing that has a symbol - return ( target->symbolTableInclusion() != ld::Atom::symbolTableNotIn ); - } - - // <rdar://problem/9513487> support arm branch interworking in -r mode -+#if SUPPORT_ARCH_arm_any - if ( (_options.architecture() == CPU_TYPE_ARM) && (_options.outputKind() == Options::kObjectFile) ) { - if ( atom->isThumb() != target->isThumb() ) { - switch ( fixupWithTarget->kind ) { -@@ -4298,6 +4332,7 @@ - } - } - } -+#endif - - if ( (_options.architecture() == CPU_TYPE_I386) && (_options.outputKind() == Options::kObjectFile) ) { - if ( target->contentType() == ld::Atom::typeTLV ) -@@ -4365,7 +4400,11 @@ - bool minusTargetUsesExternalReloc = (minusTarget != NULL) && this->useExternalSectionReloc(atom, minusTarget, fixupWithMinusTarget); - - // in x86_64 and arm64 .o files an external reloc means the content contains just the addend -- if ( (_options.architecture() == CPU_TYPE_X86_64) ||(_options.architecture() == CPU_TYPE_ARM64) ) { -+ if ( (_options.architecture() == CPU_TYPE_X86_64) || -+#if SUPPORT_ARCH_arm64 -+ (_options.architecture() == CPU_TYPE_ARM64) || -+#endif -+ 0 ) { - if ( targetUsesExternalReloc ) { - fixupWithTarget->contentAddendOnly = true; - fixupWithStore->contentAddendOnly = true; ---- ld64-242/src/ld/parsers/archive_file.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/parsers/archive_file.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -232,8 +232,12 @@ - - template <> cpu_type_t File<x86>::architecture() { return CPU_TYPE_I386; } - template <> cpu_type_t File<x86_64>::architecture() { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> cpu_type_t File<arm>::architecture() { return CPU_TYPE_ARM; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> cpu_type_t File<arm64>::architecture() { return CPU_TYPE_ARM64; } -+#endif - - - template <typename A> ---- ld64-242/src/ld/parsers/macho_dylib_file.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/parsers/macho_dylib_file.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -258,11 +258,15 @@ - bool File<A>::_s_logHashtable = false; - - template <> const char* File<x86_64>::objCInfoSegmentName() { return "__DATA"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* File<arm>::objCInfoSegmentName() { return "__DATA"; } -+#endif - template <typename A> const char* File<A>::objCInfoSegmentName() { return "__OBJC"; } - - template <> const char* File<x86_64>::objCInfoSectionName() { return "__objc_imageinfo"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* File<arm>::objCInfoSectionName() { return "__objc_imageinfo"; } -+#endif - template <typename A> const char* File<A>::objCInfoSectionName() { return "__image_info"; } - - template <typename A> -@@ -1020,6 +1024,7 @@ - } - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool Parser<arm>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle) - { -@@ -1046,9 +1051,11 @@ - return false; - } - } -+#endif - - - -+#if SUPPORT_ARCH_arm64 - template <> - bool Parser<arm64>::validFile(const uint8_t* fileContent, bool executableOrDyliborBundle) - { -@@ -1075,6 +1082,7 @@ - return false; - } - } -+#endif - - - bool isDylibFile(const uint8_t* fileContent, cpu_type_t* result, cpu_subtype_t* subResult) -@@ -1090,17 +1098,21 @@ - *subResult = CPU_SUBTYPE_X86_ALL; - return true; - } -+#if SUPPORT_ARCH_arm_any - if ( Parser<arm>::validFile(fileContent, false) ) { - *result = CPU_TYPE_ARM; - const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#if SUPPORT_ARCH_arm64 - if ( Parser<arm64>::validFile(fileContent, false) ) { - *result = CPU_TYPE_ARM64; - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#endif - return false; - } - -@@ -1126,6 +1138,7 @@ - return "x86_64"; - } - -+#if SUPPORT_ARCH_arm_any - template <> - const char* Parser<arm>::fileKind(const uint8_t* fileContent) - { -@@ -1141,6 +1154,7 @@ - } - return "arm???"; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1166,9 +1180,11 @@ - if ( Parser<x86>::validFile(fileContent, true) ) { - return Parser<x86>::fileKind(fileContent); - } -+#if SUPPORT_ARCH_arm_any - if ( Parser<arm>::validFile(fileContent, true) ) { - return Parser<arm>::fileKind(fileContent); - } -+#endif - #if SUPPORT_ARCH_arm64 - if ( Parser<arm64>::validFile(fileContent, false) ) { - return Parser<arm64>::fileKind(fileContent); ---- ld64-242/src/ld/parsers/macho_relocatable_file.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/parsers/macho_relocatable_file.cpp 2015-08-03 01:10:52.000000000 +0200 -@@ -870,6 +870,7 @@ - } - } - -+#if SUPPORT_ARCH_arm_any - template <> - void Atom<arm>::verifyAlignment(const macho_section<P>&) const - { -@@ -878,6 +879,7 @@ - warning("ARM function not 4-byte aligned: %s from %s", this->name(), this->file()->path()); - } - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1267,6 +1269,7 @@ - return true; - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool Parser<arm>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype) - { -@@ -1287,8 +1290,10 @@ - } - return true; - } -+#endif - - -+#if SUPPORT_ARCH_arm64 - template <> - bool Parser<arm64>::validFile(const uint8_t* fileContent, bool subtypeMustMatch, cpu_subtype_t subtype) - { -@@ -1301,6 +1306,7 @@ - return false; - return true; - } -+#endif - - - template <> -@@ -1325,6 +1331,7 @@ - return "x86_64"; - } - -+#if SUPPORT_ARCH_arm_any - template <> - const char* Parser<arm>::fileKind(const uint8_t* fileContent) - { -@@ -1340,6 +1347,7 @@ - } - return "arm???"; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1604,11 +1612,13 @@ - return false; - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t Parser<arm>::realAddr(arm::P::uint_t addr) - { - return addr & (-2); - } -+#endif - - template <typename A> - typename A::P::uint_t Parser<A>::realAddr(typename A::P::uint_t addr) -@@ -1874,8 +1884,12 @@ - - template <> uint8_t Parser<x86>::loadCommandSizeMask() { return 0x03; } - template <> uint8_t Parser<x86_64>::loadCommandSizeMask() { return 0x07; } -+#if SUPPORT_ARCH_arm_any - template <> uint8_t Parser<arm>::loadCommandSizeMask() { return 0x03; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> uint8_t Parser<arm64>::loadCommandSizeMask() { return 0x07; } -+#endif - - template <typename A> - bool Parser<A>::parseLoadCommands() -@@ -4072,6 +4086,7 @@ - return 1 + (this->_machOSection - parser.firstMachOSection()); - } - -+#if SUPPORT_ARCH_arm_any - // arm does not have zero cost exceptions - template <> - uint32_t CFISection<arm>::cfiCount(Parser<arm>& parser) -@@ -4084,6 +4099,7 @@ - } - return 0; - } -+#endif - - template <typename A> - uint32_t CFISection<A>::cfiCount(Parser<A>& parser) -@@ -4211,6 +4227,7 @@ - - - -+#if SUPPORT_ARCH_arm_any - template <> - void CFISection<arm>::cfiParse(class Parser<arm>& parser, uint8_t* buffer, - libunwind::CFI_Atom_Info<CFISection<arm>::OAS>::CFI_Atom_Info cfiArray[], -@@ -4233,6 +4250,7 @@ - if ( msg != NULL ) - throwf("malformed __eh_frame section: %s", msg); - } -+#endif - - - -@@ -4337,8 +4355,12 @@ - - template <> bool CFISection<x86_64>::bigEndian() { return false; } - template <> bool CFISection<x86>::bigEndian() { return false; } -+#if SUPPORT_ARCH_arm_any - template <> bool CFISection<arm>::bigEndian() { return false; } -+#endif -+#if SUPPORT_ARCH_arm64 - template <> bool CFISection<arm64>::bigEndian() { return false; } -+#endif - - - template <> -@@ -4412,6 +4434,7 @@ - } - #endif - -+#if SUPPORT_ARCH_arm_any - template <> - void CFISection<arm>::addCiePersonalityFixups(class Parser<arm>& parser, const CFI_Atom_Info* cieInfo) - { -@@ -4433,7 +4456,7 @@ - throwf("unsupported address encoding (%02X) of personality function in CIE", personalityEncoding); - } - } -- -+#endif - - - template <typename A> -@@ -5324,11 +5347,13 @@ - return ld::Fixup::kindStoreLittleEndian32; - } - -+#if SUPPORT_ARCH_arm_any - template <> - ld::Fixup::Kind NonLazyPointerSection<arm>::fixupKind() - { - return ld::Fixup::kindStoreLittleEndian32; - } -+#endif - - template <> - ld::Fixup::Kind NonLazyPointerSection<arm64>::fixupKind() -@@ -7440,10 +7465,14 @@ - return ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ); - case CPU_TYPE_I386: - return ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ); -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - return ( mach_o::relocatable::Parser<arm>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) ); -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: - return ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, opts.objSubtypeMustMatch, opts.subType) ); -+#endif - } - return false; - } -@@ -7464,17 +7493,21 @@ - *subResult = CPU_SUBTYPE_X86_ALL; - return true; - } -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - *result = CPU_TYPE_ARM; - const macho_header<Pointer32<LittleEndian> >* header = (const macho_header<Pointer32<LittleEndian> >*)fileContent; - *subResult = header->cpusubtype(); - return true; - } -+#endif -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm64>::validFile(fileContent, false, 0) ) { - *result = CPU_TYPE_ARM64; - *subResult = CPU_SUBTYPE_ARM64_ALL; - return true; - } -+#endif - return false; - } - -@@ -7489,9 +7522,11 @@ - if ( mach_o::relocatable::Parser<x86>::validFile(fileContent) ) { - return mach_o::relocatable::Parser<x86>::fileKind(fileContent); - } -+#if SUPPORT_ARCH_arm_any - if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<arm>::fileKind(fileContent); - } -+#endif - return NULL; - } - -@@ -7503,9 +7538,11 @@ - if ( mach_o::relocatable::Parser<x86_64>::validFile(fileContent) ) { - return mach_o::relocatable::Parser<x86_64>::hasObjC2Categories(fileContent); - } -+#if SUPPORT_ARCH_arm_any - else if ( mach_o::relocatable::Parser<arm>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<arm>::hasObjC2Categories(fileContent); - } -+#endif - else if ( mach_o::relocatable::Parser<x86>::validFile(fileContent, false, 0) ) { - return mach_o::relocatable::Parser<x86>::hasObjC2Categories(fileContent); - } ---- ld64-242/src/ld/passes/branch_island.cpp.noarm 2014-03-19 23:50:50.000000000 +0100 -+++ ld64-242/src/ld/passes/branch_island.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -285,6 +285,7 @@ - static uint64_t textSizeWhenMightNeedBranchIslands(const Options& opts, bool seenThumbBranch) - { - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( ! seenThumbBranch ) - return 32000000; // ARM can branch +/- 32MB -@@ -293,6 +294,7 @@ - else - return 4000000; // thumb1 can branch +/- 4MB - break; -+#endif - } - assert(0 && "unexpected architecture"); - return 0x100000000LL; -@@ -302,6 +304,7 @@ - static uint64_t maxDistanceBetweenIslands(const Options& opts, bool seenThumbBranch) - { - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( ! seenThumbBranch ) - return 30*1024*1024; // 2MB of branch islands per 32MB -@@ -310,6 +313,7 @@ - else - return 3500000; // 0.5MB of branch islands per 4MB - break; -+#endif - } - assert(0 && "unexpected architecture"); - return 0x100000000LL; -@@ -654,8 +658,10 @@ - - // only ARM needs branch islands - switch ( opts.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - break; -+#endif - default: - return; - } ---- ld64-242/src/ld/passes/branch_shim.cpp.noarm 2013-03-08 00:10:19.000000000 +0100 -+++ ld64-242/src/ld/passes/branch_shim.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -276,6 +276,9 @@ - // - void doPass(const Options& opts, ld::Internal& state) - { -+#if !SUPPORT_ARCH_arm_any -+ return; -+#else - // only make branch shims in final linked images - if ( opts.outputKind() == Options::kObjectFile ) - return; -@@ -386,6 +389,7 @@ - // append all new shims to end of __text - sect->atoms.insert(sect->atoms.end(), shims.begin(), shims.end()); - } -+#endif - } - - ---- ld64-242/src/ld/passes/dtrace_dof.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/ld/passes/dtrace_dof.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -179,8 +179,12 @@ - switch ( opts.architecture() ) { - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: -+#endif -+#if SUPPORT_ARCH_arm64 - case CPU_TYPE_ARM64: -+#endif - storeKind = ld::Fixup::kindStoreLittleEndian32; - break; - default: ---- ld64-242/src/ld/passes/stubs/stubs.cpp.noarm 2013-07-23 01:37:47.000000000 +0200 -+++ ld64-242/src/ld/passes/stubs/stubs.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -324,9 +324,11 @@ - if ( _options.outputKind() != Options::kDynamicLibrary ) - throwf("resolver functions (%s) can only be used in dylibs", atom->name()); - if ( !_options.makeCompressedDyldInfo() ) { -+#if SUPPORT_ARCH_arm_any - if ( _options.architecture() == CPU_TYPE_ARM ) - throwf("resolver functions (%s) can only be used when targeting iOS 4.2 or later", atom->name()); - else -+#endif - throwf("resolver functions (%s) can only be used when targeting Mac OS X 10.6 or later", atom->name()); - } - stubFor[atom] = NULL; -@@ -354,6 +356,7 @@ - throw "symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o"; - - // disable arm close stubs in some cases -+#if SUPPORT_ARCH_arm_any - if ( _architecture == CPU_TYPE_ARM ) { - if ( codeSize > 4*1024*1024 ) - _largeText = true; -@@ -377,6 +380,7 @@ - } - } - } -+#endif - - // make stub atoms - for (std::map<const ld::Atom*,ld::Atom*>::iterator it = stubFor.begin(); it != stubFor.end(); ++it) { ---- ld64-242/src/ld/Resolver.cpp.noarm 2015-08-03 01:08:56.000000000 +0200 -+++ ld64-242/src/ld/Resolver.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -428,6 +428,7 @@ - // update cpu-sub-type - cpu_subtype_t nextObjectSubType = file.cpuSubType(); - switch ( _options.architecture() ) { -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - if ( _options.subArchitecture() != nextObjectSubType ) { - if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) { -@@ -446,6 +447,7 @@ - } - } - break; -+#endif - - case CPU_TYPE_I386: - _internal.cpuSubType = CPU_SUBTYPE_I386_ALL; ---- ld64-242/src/other/machochecker.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/other/machochecker.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -252,6 +252,7 @@ - return false; - } - -+#if SUPPORT_ARCH_arm_any - template <> - bool MachOChecker<arm>::validFile(const uint8_t* fileContent) - { -@@ -269,6 +270,7 @@ - } - return false; - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -294,7 +296,9 @@ - template <> uint8_t MachOChecker<ppc64>::loadCommandSizeMask() { return 0x07; } - template <> uint8_t MachOChecker<x86>::loadCommandSizeMask() { return 0x03; } - template <> uint8_t MachOChecker<x86_64>::loadCommandSizeMask() { return 0x07; } -+#if SUPPORT_ARCH_arm_any - template <> uint8_t MachOChecker<arm>::loadCommandSizeMask() { return 0x03; } -+#endif - #if SUPPORT_ARCH_arm64 - template <> uint8_t MachOChecker<arm64>::loadCommandSizeMask() { return 0x07; } - #endif -@@ -324,11 +328,13 @@ - return threadInfo->thread_register(7); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::getInitialStackPointer(const macho_thread_command<arm::P>* threadInfo) - { - return threadInfo->thread_register(13); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -362,11 +368,13 @@ - return threadInfo->thread_register(16); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::getEntryPoint(const macho_thread_command<arm::P>* threadInfo) - { - return threadInfo->thread_register(15); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> -@@ -1025,6 +1033,7 @@ - return fFirstWritableSegment->vmaddr(); - } - -+#if SUPPORT_ARCH_arm_any - template <> - arm::P::uint_t MachOChecker<arm>::relocBase() - { -@@ -1033,6 +1042,7 @@ - else - return fFirstSegment->vmaddr(); - } -+#endif - - #if SUPPORT_ARCH_arm64 - template <> ---- ld64-242/src/other/ObjectDump.cpp.noarm 2015-08-03 01:08:56.000000000 +0200 -+++ ld64-242/src/other/ObjectDump.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -806,6 +806,7 @@ - case ld::Fixup::kindStoreThumbHigh16: - printf(", then store high-16 in Thumb movt"); - break; -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreARM64Branch26: - printf(", then store as ARM64 26-bit pcrel branch"); - break; -@@ -845,6 +846,7 @@ - case ld::Fixup::kindStoreARM64PCRelToGOT: - printf(", then store as 32-bit delta to GOT entry"); - break; -+#endif - case ld::Fixup::kindDtraceExtra: - printf("dtrace static probe extra info"); - break; -@@ -989,6 +991,7 @@ - case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64: - printf("tlv template offset of %s", referenceTargetAtomName(ref)); - break; -+#if SUPPORT_ARCH_arm64 - case ld::Fixup::kindStoreTargetAddressARM64Branch26: - printf("ARM64 store 26-bit pcrel branch to %s", referenceTargetAtomName(ref)); - break; -@@ -1022,6 +1025,7 @@ - case ld::Fixup::kindStoreTargetAddressARM64TLVPLoadNowLeaPageOff12: - printf("ARM64 store 12-bit page offset of lea for TLV of %s", referenceTargetAtomName(ref)); - break; -+#endif - //default: - // printf("unknown fixup"); - // break; ---- ld64-242/src/other/rebase.cpp.noarm 2013-03-08 00:10:19.000000000 +0100 -+++ ld64-242/src/other/rebase.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -160,9 +160,11 @@ - case CPU_TYPE_X86_64: - fRebasers.push_back(new Rebaser<x86_64>(&p[fileOffset])); - break; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - fRebasers.push_back(new Rebaser<arm>(&p[fileOffset])); - break; -+#endif - default: - throw "unknown file format"; - } -@@ -186,9 +188,11 @@ - else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC_64) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_X86_64)) { - fRebasers.push_back(new Rebaser<x86_64>(mh)); - } -+#if SUPPORT_ARCH_arm_any - else if ( (OSSwapLittleToHostInt32(mh->magic) == MH_MAGIC) && (OSSwapLittleToHostInt32(mh->cputype) == CPU_TYPE_ARM)) { - fRebasers.push_back(new Rebaser<arm>(mh)); - } -+#endif - else { - throw "unknown file format"; - } -@@ -236,7 +240,9 @@ - template <> cpu_type_t Rebaser<ppc64>::getArchitecture() const { return CPU_TYPE_POWERPC64; } - template <> cpu_type_t Rebaser<x86>::getArchitecture() const { return CPU_TYPE_I386; } - template <> cpu_type_t Rebaser<x86_64>::getArchitecture() const { return CPU_TYPE_X86_64; } -+#if SUPPORT_ARCH_arm_any - template <> cpu_type_t Rebaser<arm>::getArchitecture() const { return CPU_TYPE_ARM; } -+#endif - - template <typename A> - uint64_t Rebaser<A>::getBaseAddress() const -@@ -875,8 +881,10 @@ - return "i386"; - case CPU_TYPE_X86_64: - return "x86_64"; -+#if SUPPORT_ARCH_arm_any - case CPU_TYPE_ARM: - return "arm"; -+#endif - } - return "unknown"; - } -@@ -969,6 +977,7 @@ - else if ( arch == CPU_TYPE_X86_64 ) { - return 0x200000000ULL; - } -+#if SUPPORT_ARCH_arm_any - else if ( arch == CPU_TYPE_ARM ) { - // place dylibs below dyld - uint64_t topAddr = 0x2FE00000; -@@ -977,6 +986,7 @@ - throwf("total size of images (0x%X) does not fit below 0x2FE00000", totalSize); - return topAddr - totalSize; - } -+#endif - else - throw "unknown architecture"; - } -@@ -1043,7 +1053,9 @@ - onlyArchs.insert(CPU_TYPE_POWERPC64); - onlyArchs.insert(CPU_TYPE_I386); - onlyArchs.insert(CPU_TYPE_X86_64); -+#if SUPPORT_ARCH_arm_any - onlyArchs.insert(CPU_TYPE_ARM); -+#endif - } - - // scan files and collect sizes ---- ld64-242/src/other/unwinddump.cpp.noarm 2015-08-03 01:08:57.000000000 +0200 -+++ ld64-242/src/other/unwinddump.cpp 2015-08-03 01:09:13.000000000 +0200 -@@ -97,7 +97,9 @@ - - template <> const char* UnwindPrinter<x86>::archName() { return "i386"; } - template <> const char* UnwindPrinter<x86_64>::archName() { return "x86_64"; } -+#if SUPPORT_ARCH_arm_any - template <> const char* UnwindPrinter<arm>::archName() { return "arm"; } -+#endif - #if SUPPORT_ARCH_arm64 - template <> const char* UnwindPrinter<arm64>::archName() { return "arm64"; } - #endif -@@ -1195,7 +1197,9 @@ - #if SUPPORT_ARCH_arm64 - onlyArchs.insert(CPU_TYPE_ARM64); - #endif -+#if SUPPORT_ARCH_arm_any - onlyArchs.insert(CPU_TYPE_ARM); -+#endif - } - - // process each file diff --git a/sys-devel/binutils-apple/files/ld64-95.2.12-Makefile b/sys-devel/binutils-apple/files/ld64-95.2.12-Makefile deleted file mode 100644 index 8016434d3849..000000000000 --- a/sys-devel/binutils-apple/files/ld64-95.2.12-Makefile +++ /dev/null @@ -1,26 +0,0 @@ -CPPFLAGS += -Iinclude -Iabstraction -Ild -Iother -I. - -# dropped machocheck due to compilation failures -all: rebase unwinddump dyldinfo ObjectDump ld64 - -libprunetrie.a: other/PruneTrie.o other/prune_trie.h - $(AR) -s -r -c libprunetrie.a other/PruneTrie.o - -ld64: libprunetrie.a ld/ld.o ld/Options.o ld/debugline.o version.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -rebase: other/rebase.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -dyldinfo: other/dyldinfo.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -unwinddump: other/unwinddump.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -ObjectDump: other/ObjectDump.o ld/debugline.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - -machocheck: other/machochecker.o - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ - diff --git a/sys-devel/binutils-apple/files/ld64-95.2.12-darwin8-no-mlong-branch-warning.patch b/sys-devel/binutils-apple/files/ld64-95.2.12-darwin8-no-mlong-branch-warning.patch deleted file mode 100644 index 790fb97339c5..000000000000 --- a/sys-devel/binutils-apple/files/ld64-95.2.12-darwin8-no-mlong-branch-warning.patch +++ /dev/null @@ -1,15 +0,0 @@ -The whole system (/usr/bin/crt0.o for example) is long-branch compiled, -so *any* linkage operation causes this warning to be raised. Don't do -it. - ---- ld/MachOReaderRelocatable.hpp -+++ ld/MachOReaderRelocatable.hpp -@@ -4165,8 +4165,6 @@ - if ( nextReloc->r_type() != PPC_RELOC_PAIR ) { - throw "PPC_RELOC_JBSR missing following pair"; - } -- if ( !fHasLongBranchStubs ) -- warning("object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: %s", fPath); - fHasLongBranchStubs = true; - result = true; - if ( reloc->r_extern() ) { diff --git a/sys-devel/binutils-apple/files/libunwind-30-Makefile b/sys-devel/binutils-apple/files/libunwind-30-Makefile deleted file mode 100644 index cb502d94868d..000000000000 --- a/sys-devel/binutils-apple/files/libunwind-30-Makefile +++ /dev/null @@ -1,23 +0,0 @@ -CPPFLAGS += -I../include - -all: libunwind.a - -OBJS=Registers.o unw_getcontext.o libuwind.o UnwindLevel1-gcc-ext.o UnwindLevel1.o Unwind-sjlj.o - -libunwind.a: $(OBJS) - libtool -static -o $@ $^ - -libunwind.dylib: $(OBJS) - $(CXX) $(CXXFLAGS) -dynamiclib -single_module -compatibility_version 1 -o $@ $^ - -Registers.o: Registers.s - $(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ - -unw_getcontext.o: unw_getcontext.s - $(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ - -libuwind.o: libuwind.cxx - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DYLDINCS) -c -o $@ $^ - -%.o: %.c - $(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^ |