diff options
author | Fabian Groffen <grobian@gentoo.org> | 2011-09-03 20:33:22 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2011-09-03 20:33:22 +0000 |
commit | bfdf9ff35270b7ec066bd136909c6ba10dc50773 (patch) | |
tree | a1d72c83cea84df44681c40d9c6d02af359e9709 /sys-devel/binutils-apple | |
parent | Restrict tests, bug 281712 (diff) | |
download | gentoo-2-bfdf9ff35270b7ec066bd136909c6ba10dc50773.tar.gz gentoo-2-bfdf9ff35270b7ec066bd136909c6ba10dc50773.tar.bz2 gentoo-2-bfdf9ff35270b7ec066bd136909c6ba10dc50773.zip |
Bump to version from Developer Tools 4.1, drop 4.0 version as it never compiled. Slot 4.x series as they are significantly different from 3.x series.
(Portage version: 2.2.01.19120-prefix/cvs/Darwin i386)
Diffstat (limited to 'sys-devel/binutils-apple')
-rw-r--r-- | sys-devel/binutils-apple/ChangeLog | 11 | ||||
-rw-r--r-- | sys-devel/binutils-apple/binutils-apple-4.1.ebuild (renamed from sys-devel/binutils-apple/binutils-apple-4.0.ebuild) | 67 | ||||
-rw-r--r-- | sys-devel/binutils-apple/files/ld64-123.2-Makefile | 24 | ||||
-rw-r--r-- | sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch | 218 | ||||
-rw-r--r-- | sys-devel/binutils-apple/files/libunwind-30-Makefile | 23 |
5 files changed, 316 insertions, 27 deletions
diff --git a/sys-devel/binutils-apple/ChangeLog b/sys-devel/binutils-apple/ChangeLog index adecc7c6a042..4e11a9b8bbc6 100644 --- a/sys-devel/binutils-apple/ChangeLog +++ b/sys-devel/binutils-apple/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sys-devel/binutils-apple # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/ChangeLog,v 1.17 2011/05/11 20:06:45 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/ChangeLog,v 1.18 2011/09/03 20:33:22 grobian Exp $ + +*binutils-apple-4.1 (03 Sep 2011) + + 03 Sep 2011; Fabian Groffen <grobian@gentoo.org> -binutils-apple-4.0.ebuild, + +binutils-apple-4.1.ebuild, +files/libunwind-30-Makefile, + +files/ld64-123.2.1-lto.patch, files/ld64-123.2-Makefile: + Bump to version from Developer Tools 4.1, drop 4.0 version as it never + compiled. Slot 4.x series as they are significantly different from 3.x + series. *binutils-apple-4.0 (11 May 2011) *binutils-apple-3.2.6 (11 May 2011) diff --git a/sys-devel/binutils-apple/binutils-apple-4.0.ebuild b/sys-devel/binutils-apple/binutils-apple-4.1.ebuild index 51cbcb3ac987..69271ce7d513 100644 --- a/sys-devel/binutils-apple/binutils-apple-4.0.ebuild +++ b/sys-devel/binutils-apple/binutils-apple-4.1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/binutils-apple-4.0.ebuild,v 1.1 2011/05/11 20:06:45 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/binutils-apple-4.1.ebuild,v 1.1 2011/09/03 20:33:22 grobian Exp $ EAPI="3" @@ -8,8 +8,10 @@ inherit eutils flag-o-matic toolchain-funcs RESTRICT="test" # the test suite will test what's installed. -LD64=ld64-123.2 -CCTOOLS=cctools-800 +LD64=ld64-123.2.1 +CCTOOLS=cctools-806 +LIBUNWIND=libunwind-30 +DYLD=dyld-195.5 # http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html UNWIND=binutils-apple-3.2-unwind-patches-5 @@ -17,14 +19,15 @@ DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}" HOMEPAGE="http://www.opensource.apple.com/darwinsource/" SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz + http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz + http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz http://www.gentoo.org/~grobian/distfiles/${UNWIND}.tar.xz http://www.gentoo.org/~grobian/distfiles/libunwind-llvm-115426.tar.bz2" LICENSE="APSL-2" -#uncompilable #KEYWORDS="~ppc-macos ~x64-macos ~x86-macos" +KEYWORDS="" IUSE="lto test" -SLOT="0" RDEPEND="sys-devel/binutils-config lto? ( sys-devel/llvm ) @@ -41,9 +44,9 @@ fi is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } if is_cross ; then - SLOT="${CTARGET}" + SLOT="${CTARGET}-4" else - SLOT="0" + SLOT="4" fi LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV} @@ -58,17 +61,12 @@ fi S=${WORKDIR} src_prepare() { - cd "${S}"/${CCTOOLS} - epatch "${FILESDIR}"/${PN}-4.0-as.patch - epatch "${FILESDIR}"/${PN}-4.0-as-dir.patch - epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch - epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch - epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch - epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch - epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch + cd "${S}"/${LIBUNWIND}/src + cp "${FILESDIR}"/${LIBUNWIND}-Makefile Makefile cd "${S}"/${LD64}/src - cp "${FILESDIR}"/${LD64}-Makefile Makefile + cp "${FILESDIR}"/${LD64%.1}-Makefile Makefile + epatch "${FILESDIR}"/${LD64}-lto.patch ln -s ../../${CCTOOLS}/include cp other/prune_trie.h include/mach-o/ || die @@ -76,22 +74,32 @@ src_prepare() { mkdir -p include/llvm-c || die cp "${WORKDIR}"/ld64-unwind/ld64-97.14-llvm-lto.h include/llvm-c/lto.h || die # make libunwind sources known - pushd "${WORKDIR}"/libunwind/include > /dev/null - ln -s ../src libunwind || die - popd > /dev/null + #pushd "${WORKDIR}"/libunwind/include > /dev/null + ln -s ../../${LIBUNWIND}/src libunwind || die + cp ../../${LIBUNWIND}/include/*.h include/ || die + #popd > /dev/null echo '' > configure.h echo '' > linker_opts local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\"" echo "char ldVersionString[] = ${VER_STR};" > version.cpp - epatch "${FILESDIR}"/${LD64}-debug-backtrace.patch + epatch "${FILESDIR}"/${LD64%.1}-debug-backtrace.patch [[ ${CHOST} == powerpc*-darwin* ]] && \ - epatch "${FILESDIR}"/${LD64}-darwin8-no-mlong-branch-warning.patch + epatch "${FILESDIR}"/${LD64%.1}-darwin8-no-mlong-branch-warning.patch if use !lto ; then sed -i -e '/#define LTO_SUPPORT 1/d' other/ObjectDump.cpp || die fi + cd "${S}"/${CCTOOLS} + epatch "${FILESDIR}"/${PN}-4.0-as.patch + epatch "${FILESDIR}"/${PN}-4.0-as-dir.patch + epatch "${FILESDIR}"/${PN}-3.2.3-ranlib.patch + epatch "${FILESDIR}"/${PN}-3.1.1-libtool-ranlib.patch + epatch "${FILESDIR}"/${PN}-3.1.1-nmedit.patch + epatch "${FILESDIR}"/${PN}-3.1.1-no-headers.patch + epatch "${FILESDIR}"/${PN}-4.0-no-oss-dir.patch + # clean up test suite cd "${S}"/${LD64} # epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch @@ -140,21 +148,31 @@ src_configure() { append-flags -DLTO_SUPPORT append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/llvm append-libs LTO + LTO=1 else append-flags -ULTO_SUPPORT + LTO=0 fi append-flags -DNDEBUG append-flags -I${WORKDIR}/libunwind/include } +compile_libunwind() { + einfo "building ${LIBUNWIND}" + cd "${S}"/${LIBUNWIND}/src + emake DYLDINCS=-I../../${DYLD}/include || die +} + compile_ld64() { + einfo "building ${LD64}" cd "${S}"/${LD64}/src # remove antiquated copy that's available on any OSX system and # breaks ld64 compilation mv include/mach-o/dyld.h{,.disable} emake \ + LTO=${LTO} \ CFLAGS="${CFLAGS}" \ - CXXFLAGS="${CXXFLAGS}" \ + CXXFLAGS="${CXXFLAGS} -I../../${DYLD}/include" \ LDFLAGS="${LDFLAGS} ${LIBS}" \ || die "emake failed for ld64" use test && emake build_test @@ -163,6 +181,7 @@ compile_ld64() { } compile_cctools() { + einfo "building ${CCTOOLS}" cd "${S}"/${CCTOOLS} emake \ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \ @@ -179,6 +198,7 @@ compile_cctools() { } src_compile() { + compile_libunwind compile_ld64 compile_cctools } @@ -209,7 +229,8 @@ install_cctools() { BUILD_OBSOLETE_ARCH= \ DSTROOT=\"${D}\" \ USRBINDIR=\"${EPREFIX}\"${BINPATH} \ - LIBDIR=\"${EPREFIX}\"${LIBPATH} + LIBDIR=\"${EPREFIX}\"${LIBPATH} \ + LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} cd "${ED}"${BINPATH} insinto ${DATAPATH}/man/man1 diff --git a/sys-devel/binutils-apple/files/ld64-123.2-Makefile b/sys-devel/binutils-apple/files/ld64-123.2-Makefile index 9c3e43fcad7b..bd60c60cff0f 100644 --- a/sys-devel/binutils-apple/files/ld64-123.2-Makefile +++ b/sys-devel/binutils-apple/files/ld64-123.2-Makefile @@ -1,12 +1,30 @@ -CPPFLAGS += -Iinclude -Iabstraction -Ild -Iother -I. +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 ObjectDump ld64 +all: rebase unwinddump dyldinfo ld64 ObjectDump 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 +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) +LD64LIBS += ld/parsers/lto_file.o +CPPFLAGS += "-DLTO" +else +CPPFLAGS += "-ULTO" +endif + +ld64: libprunetrie.a $(LD64LIBS) version.o $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ rebase: other/rebase.o 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 new file mode 100644 index 000000000000..17bac81ca291 --- /dev/null +++ b/sys-devel/binutils-apple/files/ld64-123.2.1-lto.patch @@ -0,0 +1,218 @@ +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/libunwind-30-Makefile b/sys-devel/binutils-apple/files/libunwind-30-Makefile new file mode 100644 index 000000000000..cb502d94868d --- /dev/null +++ b/sys-devel/binutils-apple/files/libunwind-30-Makefile @@ -0,0 +1,23 @@ +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 $@ $^ |