diff options
author | Fabian Groffen <grobian@gentoo.org> | 2011-05-11 20:06:45 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2011-05-11 20:06:45 +0000 |
commit | 6dcaead6e0bc9a78d804671b53eddc75550e29e0 (patch) | |
tree | f2e25c5b9cfb41a6fc25cda3745ff00464809d3a /sys-devel/binutils-apple | |
parent | Stable on amd64 wrt bug #366185 (diff) | |
download | historical-6dcaead6e0bc9a78d804671b53eddc75550e29e0.tar.gz historical-6dcaead6e0bc9a78d804671b53eddc75550e29e0.tar.bz2 historical-6dcaead6e0bc9a78d804671b53eddc75550e29e0.zip |
Bump to versions from Developer Tools 3.2.6 and 4.0. The latter cannot be compiled due to missing libraries
Package-Manager: portage-2.2.01.18252-prefix/cvs/Darwin powerpc
Diffstat (limited to 'sys-devel/binutils-apple')
10 files changed, 792 insertions, 3 deletions
diff --git a/sys-devel/binutils-apple/ChangeLog b/sys-devel/binutils-apple/ChangeLog index a08512fb11ef..adecc7c6a042 100644 --- a/sys-devel/binutils-apple/ChangeLog +++ b/sys-devel/binutils-apple/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for sys-devel/binutils-apple -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-apple/ChangeLog,v 1.16 2010/11/18 19:37:05 grobian Exp $ +# 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 $ + +*binutils-apple-4.0 (11 May 2011) +*binutils-apple-3.2.6 (11 May 2011) + + 11 May 2011; Fabian Groffen <grobian@gentoo.org> + +binutils-apple-3.2.6.ebuild, +binutils-apple-4.0.ebuild, + +files/binutils-apple-4.0-as.patch, +files/binutils-apple-4.0-as-dir.patch, + +files/binutils-apple-4.0-no-oss-dir.patch, +files/ld64-123.2-Makefile, + +files/ld64-123.2-darwin8-no-mlong-branch-warning.patch, + +files/ld64-123.2-debug-backtrace.patch: + Bump to versions from Developer Tools 3.2.6 and 4.0. The latter cannot be + compiled due to missing libraries *binutils-apple-3.2.3-r2 (18 Nov 2010) diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest index bb5ef99e2f0f..360cf1ba32a4 100644 --- a/sys-devel/binutils-apple/Manifest +++ b/sys-devel/binutils-apple/Manifest @@ -1,3 +1,6 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX Makefile 246 RMD160 00c197f8251aec53a9bef3a9de2b4738805987ed SHA1 c6bf1fe69f318c3d67ceaa8765415bfaba3e0dbf SHA256 eadeb8c0339d90728868200ce7015fa643564e5f024db5ec8b602ec8318b3716 AUX binutils-apple-3.1.1-as-dir.patch 1531 RMD160 a8911c25378c78ce7693e0c84987c0d076b255bb SHA1 9730cff5ca16baab1a82af435eaef42f3c0ac9ed SHA256 767b44fd052acdea83a55e80c6fccb413ba6044895414eb2f54086a09d1561ce AUX binutils-apple-3.1.1-as.patch 2659 RMD160 df76f4a9a9c97f6a15d965bb6e4a1a6bb5e24956 SHA1 63dfb347ad13a9c0e06f69dcd3e8ca3bac54543d SHA256 56bacc3100fc2804d09368042f9e0389729762f84d3d5f674a0b43c76512286d @@ -14,6 +17,12 @@ AUX binutils-apple-3.2-ld64-Makefile 760 RMD160 da9f2930915d75d51bab3a58417a3ddc AUX binutils-apple-3.2.2-as.patch 2777 RMD160 b94adf36e78c3b43998a063c035979195296ac86 SHA1 eb1be8fbaee452aaa97dd78d2ef7b6eb46eb1274 SHA256 99692bb424bd21d6772c5a81239ecb5babc3b6d6f18a8c7a43e424acb92676d4 AUX binutils-apple-3.2.3-as-dir.patch 1532 RMD160 501c32713235aa7301abca9e6282be277bda415d SHA1 67d2d059562edb55802a8f08485dbc4c0dafb377 SHA256 f2362bf0b6a8dcb0fb533e4db6ab238c6864bd0794051a8331cfef2ea2c57807 AUX binutils-apple-3.2.3-ranlib.patch 2866 RMD160 3e9c64eea5676b872cbf60268ecb479a7142124d SHA1 bc91dc48fbdb8f076912641b8726c01dfb91c693 SHA256 f14e19ab699a15b7c167cddd56de22a88863599b1ea01c53fd8476aa64697245 +AUX binutils-apple-4.0-as-dir.patch 1458 RMD160 b409d3cc62cdeb5a66af2c0939423066c288c07d SHA1 abcfbee6b4470786aa4e3aa30b951c3277a52c4b SHA256 b33439299340b311ef606e11427a7ded25b75e1d35791bb50d7815f4f87b6abc +AUX binutils-apple-4.0-as.patch 2738 RMD160 f7601fc41f373f8e7ef122d059dd04ca42d400af SHA1 fb5f02cf3ead339c0e1723f89e996615f3c15d2f SHA256 b068f2a8bff9fb8f7dd92eb64c9587c9517ef51e682211f81b57e69b7e25fdef +AUX binutils-apple-4.0-no-oss-dir.patch 604 RMD160 844f112ff9dfcd4618a8b1e8a65318397ea16c2c SHA1 beadc9fead70c8befe66eef7d024913d00b79e3f SHA256 fda851a89d86ecc4c90850b4d744daae478e2e55f83522d51a50c2a28f09223f +AUX ld64-123.2-Makefile 764 RMD160 df4c3377960ab1657ee818c705b01b313b73c11d SHA1 a293520a550b60d26d3cb463dfc3050708b2d042 SHA256 273ec8f9e13ffed18c72ff248230ffa43cbaab97bf0c930fd08da0865d38d808 +AUX ld64-123.2-darwin8-no-mlong-branch-warning.patch 790 RMD160 00f8bdb53843777e615d9d7947378d914c7cf077 SHA1 26d3f38a847b4a1d21397d5599ece60d25d30f83 SHA256 d3d5750998000a5fe296efff3298c0096ebbd9118c637a67b070f93acadea4ef +AUX ld64-123.2-debug-backtrace.patch 338 RMD160 1b9b8739da7dc70544f413e30c7fc88103af4ecc SHA1 ebfa3b86fe2a9931f5a814c00f697bf6936f76b5 SHA256 26b16aa555bb15dcb6d799785aed0d240e50cbe0a77968a2a4fe92623bd105ab AUX ld64-95.2.12-Makefile 728 RMD160 56104bcb07a3845b11cf9034f1051c0ceebf681d SHA1 7549a604ea69ad1ad93b92511a70634033cdbab8 SHA256 3e1181c3dc7aaa8cb5d02cc00fc0f760d052bb2714883833a5aaa2fa3105f88d AUX ld64-95.2.12-darwin8-no-mlong-branch-warning.patch 620 RMD160 cf17f65dda73393a921896b8844493b237dc3307 SHA1 b834e98d61a9ecd70aa99b89b5575a8e32b5b2f7 SHA256 ca0455c78e77f84e7d15e6edf19085b0729a12baf29a89455af84e947f201b1d DIST binutils-apple-3.2-unwind-patches-2.tar.xz 23888 RMD160 2d677f7a3f74aaec20f1e999283dd023d1873b54 SHA1 e1b74657fa3f3a0cf479bf7e03d8aceb2295a985 SHA256 2859c3545c467f516bac0704ff97a8d18766d91faa28dfad1dcc07bfbd03919d @@ -25,17 +34,31 @@ DIST cctools-698.tar.gz 2318613 RMD160 6e044c684936172d048e0790d087bb96e47ecb20 DIST cctools-750.tar.gz 1947953 RMD160 4b4074a93d071fc56f5b9ebd972c6a175bb9904e SHA1 20dd28b6e41e6ca367a6f457f6b465a0e4fbae3c SHA256 188855640da114e37e4ddd4824ff6cdc1ea89dfb6c90a23905c9ca315342f356 DIST cctools-773.tar.gz 1962238 RMD160 3ea1b348c878efebc1d1ba9d50a89840c272aafd SHA1 762318baef6f4efca75a066d8265e0cddee267e1 SHA256 293729884921bc9c05fcbe8ef9c2b1166a7ff92cfd5bdb30349b483e78464f98 DIST cctools-782.tar.gz 1981521 RMD160 5b50b75ff7825a97fa4f095d135a6372ce787c10 SHA1 1ed1e38564fc00dc2825382ca5c856403b5eeba3 SHA256 fdf0f60adfab24dd87af9e91c364743e006a241d297ee3cbba7b628fda6d7a9c +DIST cctools-795.tar.gz 1993795 RMD160 0932fa5a96b81e50528211abfec01a9b66790485 SHA1 e4b67b6dac2173a519a57c92ef7be5bf3013417f SHA256 7fab7044b648e92a9fefd493a1bb6daa4246f24c5838d8b5c913a446e6bbd2ef +DIST cctools-800.tar.gz 2000103 RMD160 19c3213c21cd9f5d69be906ebcb53b89e358951b SHA1 0d89f3570849dbb531aaadcc04db18b726662178 SHA256 6984988897036950ec2080022492d0f6d39d3f3ffabcabeda04045ac3a01a5c8 +DIST ld64-123.2.tar.gz 452410 RMD160 551dcd0db5d403eb88033b53345be21c71445a6b SHA1 dc5876b35fe9b76518b58472562ccbec45f6f1c0 SHA256 455a19761c3f7a60d57191a010e314d933a53af8fdc7f5470e10471467e6b352 DIST ld64-85.2.1.tar.gz 598524 RMD160 42c80bd4ad6e9f96a757245e6a2b95084c009ff1 SHA1 31a7debf4c407c32b8bd1a51a4b4a7ae68dc8b85 SHA256 4bcbcbdfd62efdc46c51700b8f5dae2cbd1638e9e50f649d5c7f242d32fca804 DIST ld64-85.2.2.tar.gz 298144 RMD160 f7f897666a072e07f1888beca5b22fdd75fa1b61 SHA1 33c655bd7cbfecd70807dbde428615fb0947f31b SHA256 01ab6f6f1ce91203722c5cd56666ffa81da0eafe8beee1490a383811d56d86aa DIST ld64-95.2.12.tar.gz 401104 RMD160 35de89aa1d31d100bd952829df4316e640c03cb4 SHA1 eea384a5ed3b5a994cc24e076c74ad20e6f8b68a SHA256 5a5ea02bd81d74f4f773403bebe34950acf4830fb7fee0d466305276f869097c DIST ld64-97.14.tar.gz 421074 RMD160 5116cc587a7761d06e1da93019362705510c3d7b SHA1 a21da97f574a121ef29b8a1bfc7a7c74692a0152 SHA256 bfc46df452fc60d9befcefabac8db444d963407af4e3a060a01e394d5ee8d2b4 +DIST ld64-97.17.tar.gz 421947 RMD160 d52df7d7f741c8bedd29cbac73dbb9db992b4795 SHA1 7c1d816c2fec02e558f4a528d16d8161f0e379b5 SHA256 02bd46af0809eaa415d096d7d41c3e8e7d80f7d8d181840866fb87f036b4e089 DIST ld64-97.2.tar.gz 415630 RMD160 e5557db2809627a9a0771c949b42e15c23eb65ba SHA1 3db816678f96db0dc1936af0ceb5c58b049648d6 SHA256 3a94376586656192e16a09c7b82e2a70f0a441fc8cb2ccf8a835a050e82866da +DIST libunwind-llvm-115426.tar.bz2 74622 RMD160 fa69073d23e71c1a5977b3cf4b5b086190079716 SHA1 4a0b371da27361f62380250d2c4a176d939554c4 SHA256 e77a42c04eda5e3db61fc8b5bc98a55c6a015a9b02a74aab0f35d551fc38272f EBUILD binutils-apple-3.1.1.ebuild 5157 RMD160 692fc010932d7ddbf51b3fd63f1f79742cdfcff3 SHA1 5c82eb1ce460f94cc4328327ad5c141463a3953a SHA256 c8f9904789faea57409863af02683e6eae36377925fcf4e7a9dd44dab9c7e6ac EBUILD binutils-apple-3.1.2.ebuild 5288 RMD160 bbe9a2371e5e1e66b0c9fa2f4ca600bb2474d234 SHA1 5d21c2ac4c555ec8d997efe9d5ae0233b2fa17cb SHA256 0818f10ee517368085e4bacfd53f25ab81115f05b480fb716c6b70b7ebc59bdd EBUILD binutils-apple-3.2-r1.ebuild 6228 RMD160 fdd810e43d987bebc9c938beb12ac204667f0cbe SHA1 489c9b0f50541e29f6dc60de68aa3ee21c1c538b SHA256 26c29b4bf9584053e42a6a3d197afc0a21f95413bf6bccf86cb21f4e08c3bcaa EBUILD binutils-apple-3.2.2.ebuild 6202 RMD160 73621094f924415c7669361fde13cc9911ccd56c SHA1 fade93e2da454f2c1f5f9166fbdfbd186efee932 SHA256 c26d98fd40daf363671147acfa554992310b3cda657242a880f2c026f05dac5f EBUILD binutils-apple-3.2.3-r1.ebuild 6521 RMD160 6bd22707129894fc03f8949c79c1b02adb471680 SHA1 f1b1ef2114135646591c0d566bc0b69063f5e8c3 SHA256 bf10cfbacb2e16227ffba16e0509df7ed678aba1aebedee621ac12b6d5491ddb EBUILD binutils-apple-3.2.3-r2.ebuild 6669 RMD160 8a32c0be4ec8a6e8c89f5c2155fb172ebc4565e4 SHA1 9c495edc134edf36478897a7950510e7b57f92fe SHA256 17b6d484e33a20939d00a6bf496fe6aefa2920d21c4fbb6bbf359e853f754f7f +EBUILD binutils-apple-3.2.6.ebuild 6670 RMD160 1a7df67ed733c1a22aca1414e7a2b3f1c1597d9c SHA1 6e5b37a6c5c63c87999f5dd67526cfd8936f44e8 SHA256 241af9c47b9165234672ee61466d4ba21af689cec6ab5e7f606d1f60355b30b8 EBUILD binutils-apple-3.2.ebuild 5913 RMD160 47df8d8d2e207eb95e10359f35c2c5fd152f8938 SHA1 26b56881f56b63bc3f9b25aeae6c814f969f5dfd SHA256 41fb357219cdbb20f16200d05016c1866046f9a351994b738d6e0b7176f3488e -MISC ChangeLog 6858 RMD160 90aecb33d2e1ee163fe638aabbbdc076f6724c3d SHA1 c22c55d3a6da6b6569ba04d8067eb85324f5b118 SHA256 113ea08df295f50c5387244fa8e33ca1e2680948c418c4102673f21008e97f46 +EBUILD binutils-apple-4.0.ebuild 6860 RMD160 69843ca1739f9f7fabf4c386d8f2de4d0c4affcd SHA1 82fcf77c4ec1653081a3cb3dbf36092ef50ef02b SHA256 a22a8295db83b23cc664f069c610eb494de97a293eff04d682debc29fa66e31a +MISC ChangeLog 7407 RMD160 4316ba62304bae57227d99c806aff12865b8e034 SHA1 952cd7350339a50027a1d8be1469fdd4ee07e87c SHA256 1fa8ceb174b06467f599e520fff5eaa9c3a946ea5b039c94b28fdf18d9fe8c14 MISC metadata.xml 250 RMD160 1d572689c02f6408ad8dfcfc955f8dfb7ec3a201 SHA1 dbd7759df5303c9dd998023753a3361206bad1e2 SHA256 f783a2767bd8eb2edebc0b1b1391fdcb461dcdb7a7c99dc1b82504c466688e79 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (Darwin) + +iEYEARECAAYFAk3K7FAACgkQX3X2B8XHTonq3QCgiZLuDsQnsPYlxNIWtQ8No3tS +5gQAnRNWg1yZFwcGg2+5a/Hk+QiYXGDo +=5KSH +-----END PGP SIGNATURE----- diff --git a/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild b/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild new file mode 100644 index 000000000000..8997cc8acf54 --- /dev/null +++ b/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild @@ -0,0 +1,254 @@ +# 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-3.2.6.ebuild,v 1.1 2011/05/11 20:06:45 grobian Exp $ + +EAPI="3" + +inherit eutils flag-o-matic toolchain-funcs + +RESTRICT="test" # the test suite will test what's installed. + +LD64=ld64-97.17 +CCTOOLS=cctools-795 +# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html +UNWIND=binutils-apple-3.2-unwind-patches-5 + +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.gentoo.org/~grobian/distfiles/${UNWIND}.tar.xz" + +LICENSE="APSL-2" +KEYWORDS="~ppc-macos ~x64-macos ~x86-macos" +IUSE="lto test" +SLOT="0" + +RDEPEND="sys-devel/binutils-config + lto? ( sys-devel/llvm ) + test? ( >=dev-lang/perl-5.8.8 )" +DEPEND="${RDEPEND} + >=sys-devel/gcc-apple-4.2.1" + +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } + +if is_cross ; then + SLOT="${CTARGET}" +else + SLOT="0" +fi + +LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV} +INCPATH=${LIBPATH}/include +DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV} +if is_cross ; then + BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV} +else + BINPATH=/usr/${CTARGET}/binutils-bin/${PV} +fi + +S=${WORKDIR} + +src_prepare() { + cd "${S}"/${CCTOOLS} + epatch "${FILESDIR}"/${PN}-3.2.2-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}-3.1.1-no-oss-dir.patch + + cd "${S}"/${LD64}/src + cp "${FILESDIR}"/ld64-95.2.12-Makefile Makefile + + ln -s ../../${CCTOOLS}/include + cp "${WORKDIR}"/ld64-unwind/compact_unwind_encoding.h include/mach-o/ + cp other/prune_trie.h include/mach-o/ || die + # use our own copy of lto.h, which doesn't require llvm build-env + mkdir -p include/llvm-c || die + cp "${WORKDIR}"/ld64-unwind/ld64-97.14-llvm-lto.h include/llvm-c/lto.h || die + + 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 "${WORKDIR}"/ld64-unwind/ld64-97.14-unlibunwind.patch + [[ ${CHOST} == powerpc*-darwin* ]] && \ + epatch "${FILESDIR}"/ld64-95.2.12-darwin8-no-mlong-branch-warning.patch + if use !lto ; then + sed -i -e '/#define LTO_SUPPORT 1/d' other/ObjectDump.cpp || die + fi + + # clean up test suite + cd "${S}"/${LD64} + epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch + + cd "${S}"/${LD64}/unit-tests/test-cases + local c + + # we don't have llvm + ((++c)); rm -rf llvm-integration; + + # we don't have dtrace + ((++c)); rm -rf dtrace-static-probes-coalescing; + ((++c)); rm -rf dtrace-static-probes; + + # a file is missing + ((++c)); rm -rf eh-coalescing-r + + # we don't do universal binaries + ((++c)); rm -rf blank-stubs; + + # looks like a problem with apple's result-filter.pl + ((++c)); rm -rf implicit-common3; + ((++c)); rm -rf order_file-ans; + + # TODO no idea what goes wrong here + ((++c)); rm -rf dwarf-debug-notes; + + einfo "Deleted $c tests that were bound to fail" + + cd "${S}" + ebegin "cleaning Makefiles from unwanted CFLAGS" + find . -name "Makefile" -print0 | xargs -0 sed \ + -i \ + -e 's/ -g / /g' \ + -e 's/^OFLAG =.*$/OFLAG =/' \ + -e 's/install -c -s/install/g' + eend $? + + # -pg is used and the two are incompatible + filter-flags -fomit-frame-pointer +} + +src_configure() { + tc-export CC CXX AR + if use lto ; then + append-flags -DLTO_SUPPORT + append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/llvm + append-libs LTO + else + append-flags -ULTO_SUPPORT + fi +} + +compile_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 \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS} ${LIBS}" \ + || die "emake failed for ld64" + use test && emake build_test + # restore, it's necessary for cctools' install + mv include/mach-o/dyld.h{.disable,} +} + +compile_cctools() { + cd "${S}"/${CCTOOLS} + emake \ + LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \ + EFITOOLS= LTO= \ + COMMON_SUBDIRS='libstuff ar misc otool' \ + SUBDIRS_32= \ + RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \ + || die "emake failed for the cctools" + cd "${S}"/${CCTOOLS}/as + emake \ + BUILD_OBSOLETE_ARCH= \ + RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \ + || die "emake failed for as" +} + +src_compile() { + compile_ld64 + compile_cctools +} + +install_ld64() { + exeinto ${BINPATH} + doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump} + dosym ld64 ${BINPATH}/ld + insinto ${DATAPATH}/man/man1 + doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1 +} + +install_cctools() { + cd "${S}"/${CCTOOLS} + emake install_all_but_headers \ + EFITOOLS= LTO= \ + COMMON_SUBDIRS='ar misc otool' \ + SUBDIRS_32= \ + RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \ + DSTROOT=\"${D}\" \ + BINDIR=\"${EPREFIX}\"${BINPATH} \ + LOCBINDIR=\"${EPREFIX}\"${BINPATH} \ + USRBINDIR=\"${EPREFIX}\"${BINPATH} \ + LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \ + MANDIR=\"${EPREFIX}\"${DATAPATH}/man/ + cd "${S}"/${CCTOOLS}/as + emake install \ + BUILD_OBSOLETE_ARCH= \ + DSTROOT=\"${D}\" \ + USRBINDIR=\"${EPREFIX}\"${BINPATH} \ + LIBDIR=\"${EPREFIX}\"${LIBPATH} + + cd "${ED}"${BINPATH} + insinto ${DATAPATH}/man/man1 + local skips manpage + # ar brings an up-to-date manpage with it + skips=( ar ) + for bin in *; do + for skip in ${skips[@]}; do + if [[ ${bin} == ${skip} ]]; then + continue 2; + fi + done + manpage=${S}/${CCTOOLS}/man/${bin}.1 + if [[ -f "${manpage}" ]]; then + doins "${manpage}" + fi + done + insinto ${DATAPATH}/man/man5 + doins "${S}"/${CCTOOLS}/man/*.5 +} + +src_test() { + einfo "Running unit tests" + cd "${S}"/${LD64}/unit-tests/test-cases + # need host arch, since GNU arch doesn't do what Apple's does + tc-export CC CXX + perl ../bin/make-recursive.pl \ + ARCH="$(/usr/bin/arch)" \ + RELEASEDIR="${S}"/${LD64}/src \ + | perl ../bin/result-filter.pl +} + +src_install() { + install_ld64 + install_cctools + + cd "${S}" + insinto /etc/env.d/binutils + cat <<-EOF > env.d + TARGET="${CHOST}" + VER="${PV}" + FAKE_TARGETS="${CHOST}" + EOF + newins env.d ${CHOST}-${PV} +} + +pkg_postinst() { + binutils-config ${CHOST}-${PV} +} diff --git a/sys-devel/binutils-apple/binutils-apple-4.0.ebuild b/sys-devel/binutils-apple/binutils-apple-4.0.ebuild new file mode 100644 index 000000000000..51cbcb3ac987 --- /dev/null +++ b/sys-devel/binutils-apple/binutils-apple-4.0.ebuild @@ -0,0 +1,261 @@ +# 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 $ + +EAPI="3" + +inherit eutils flag-o-matic toolchain-funcs + +RESTRICT="test" # the test suite will test what's installed. + +LD64=ld64-123.2 +CCTOOLS=cctools-800 +# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html +UNWIND=binutils-apple-3.2-unwind-patches-5 + +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.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" +IUSE="lto test" +SLOT="0" + +RDEPEND="sys-devel/binutils-config + lto? ( sys-devel/llvm ) + test? ( >=dev-lang/perl-5.8.8 )" +DEPEND="${RDEPEND} + >=sys-devel/gcc-apple-4.2.1" + +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } + +if is_cross ; then + SLOT="${CTARGET}" +else + SLOT="0" +fi + +LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV} +INCPATH=${LIBPATH}/include +DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV} +if is_cross ; then + BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV} +else + BINPATH=/usr/${CTARGET}/binutils-bin/${PV} +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}"/${LD64}/src + cp "${FILESDIR}"/${LD64}-Makefile Makefile + + ln -s ../../${CCTOOLS}/include + cp other/prune_trie.h include/mach-o/ || die + # use our own copy of lto.h, which doesn't require llvm build-env + 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 + + 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 + [[ ${CHOST} == powerpc*-darwin* ]] && \ + epatch "${FILESDIR}"/${LD64}-darwin8-no-mlong-branch-warning.patch + if use !lto ; then + sed -i -e '/#define LTO_SUPPORT 1/d' other/ObjectDump.cpp || die + fi + + # clean up test suite + cd "${S}"/${LD64} +# epatch "${FILESDIR}"/${PN}-3.1.1-testsuite.patch + + cd "${S}"/${LD64}/unit-tests/test-cases + local c + + # we don't have llvm + ((++c)); rm -rf llvm-integration; + + # we don't have dtrace + ((++c)); rm -rf dtrace-static-probes-coalescing; + ((++c)); rm -rf dtrace-static-probes; + + # a file is missing + ((++c)); rm -rf eh-coalescing-r + + # we don't do universal binaries + ((++c)); rm -rf blank-stubs; + + # looks like a problem with apple's result-filter.pl + ((++c)); rm -rf implicit-common3; + ((++c)); rm -rf order_file-ans; + + # TODO no idea what goes wrong here + ((++c)); rm -rf dwarf-debug-notes; + + einfo "Deleted $c tests that were bound to fail" + + cd "${S}" + ebegin "cleaning Makefiles from unwanted CFLAGS" + find . -name "Makefile" -print0 | xargs -0 sed \ + -i \ + -e 's/ -g / /g' \ + -e 's/^OFLAG =.*$/OFLAG =/' \ + -e 's/install -c -s/install/g' + eend $? + + # -pg is used and the two are incompatible + filter-flags -fomit-frame-pointer +} + +src_configure() { + tc-export CC CXX AR + if use lto ; then + append-flags -DLTO_SUPPORT + append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/llvm + append-libs LTO + else + append-flags -ULTO_SUPPORT + fi + append-flags -DNDEBUG + append-flags -I${WORKDIR}/libunwind/include +} + +compile_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 \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS} ${LIBS}" \ + || die "emake failed for ld64" + use test && emake build_test + # restore, it's necessary for cctools' install + mv include/mach-o/dyld.h{.disable,} +} + +compile_cctools() { + cd "${S}"/${CCTOOLS} + emake \ + LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \ + EFITOOLS= LTO= \ + COMMON_SUBDIRS='libstuff ar misc otool' \ + SUBDIRS_32= \ + RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \ + || die "emake failed for the cctools" + cd "${S}"/${CCTOOLS}/as + emake \ + BUILD_OBSOLETE_ARCH= \ + RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \ + || die "emake failed for as" +} + +src_compile() { + compile_ld64 + compile_cctools +} + +install_ld64() { + exeinto ${BINPATH} + doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump} + dosym ld64 ${BINPATH}/ld + insinto ${DATAPATH}/man/man1 + doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1 +} + +install_cctools() { + cd "${S}"/${CCTOOLS} + emake install_all_but_headers \ + EFITOOLS= LTO= \ + COMMON_SUBDIRS='ar misc otool' \ + SUBDIRS_32= \ + RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \ + DSTROOT=\"${D}\" \ + BINDIR=\"${EPREFIX}\"${BINPATH} \ + LOCBINDIR=\"${EPREFIX}\"${BINPATH} \ + USRBINDIR=\"${EPREFIX}\"${BINPATH} \ + LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \ + MANDIR=\"${EPREFIX}\"${DATAPATH}/man/ + cd "${S}"/${CCTOOLS}/as + emake install \ + BUILD_OBSOLETE_ARCH= \ + DSTROOT=\"${D}\" \ + USRBINDIR=\"${EPREFIX}\"${BINPATH} \ + LIBDIR=\"${EPREFIX}\"${LIBPATH} + + cd "${ED}"${BINPATH} + insinto ${DATAPATH}/man/man1 + local skips manpage + # ar brings an up-to-date manpage with it + skips=( ar ) + for bin in *; do + for skip in ${skips[@]}; do + if [[ ${bin} == ${skip} ]]; then + continue 2; + fi + done + manpage=${S}/${CCTOOLS}/man/${bin}.1 + if [[ -f "${manpage}" ]]; then + doins "${manpage}" + fi + done + insinto ${DATAPATH}/man/man5 + doins "${S}"/${CCTOOLS}/man/*.5 +} + +src_test() { + einfo "Running unit tests" + cd "${S}"/${LD64}/unit-tests/test-cases + # need host arch, since GNU arch doesn't do what Apple's does + tc-export CC CXX + perl ../bin/make-recursive.pl \ + ARCH="$(/usr/bin/arch)" \ + RELEASEDIR="${S}"/${LD64}/src \ + | perl ../bin/result-filter.pl +} + +src_install() { + install_ld64 + install_cctools + + cd "${S}" + insinto /etc/env.d/binutils + cat <<-EOF > env.d + TARGET="${CHOST}" + VER="${PV}" + FAKE_TARGETS="${CHOST}" + EOF + newins env.d ${CHOST}-${PV} +} + +pkg_postinst() { + binutils-config ${CHOST}-${PV} +} 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 new file mode 100644 index 000000000000..0a6664ce1633 --- /dev/null +++ b/sys-devel/binutils-apple/files/binutils-apple-4.0-as-dir.patch @@ -0,0 +1,67 @@ +--- 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 new file mode 100644 index 000000000000..8df58775d650 --- /dev/null +++ b/sys-devel/binutils-apple/files/binutils-apple-4.0-as.patch @@ -0,0 +1,99 @@ +--- 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 new file mode 100644 index 000000000000..fcce015e1980 --- /dev/null +++ b/sys-devel/binutils-apple/files/binutils-apple-4.0-no-oss-dir.patch @@ -0,0 +1,15 @@ +--- 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/ld64-123.2-Makefile b/sys-devel/binutils-apple/files/ld64-123.2-Makefile new file mode 100644 index 000000000000..9c3e43fcad7b --- /dev/null +++ b/sys-devel/binutils-apple/files/ld64-123.2-Makefile @@ -0,0 +1,26 @@ +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 ld/parsers/macho_relocatable_file.o + $(CXX) $(CXXFLAGS) $(LDFLAGS) -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 new file mode 100644 index 000000000000..c8a303e1c9d6 --- /dev/null +++ b/sys-devel/binutils-apple/files/ld64-123.2-darwin8-no-mlong-branch-warning.patch @@ -0,0 +1,17 @@ +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 new file mode 100644 index 000000000000..f1126503b424 --- /dev/null +++ b/sys-devel/binutils-apple/files/ld64-123.2-debug-backtrace.patch @@ -0,0 +1,15 @@ +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> |