From 5a0370b07c54bfb2ef46835164c75167ff618345 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 3 Jan 2018 21:45:45 +0100 Subject: sys-devel/binutils-apple: restore 3.2 for bootstrapping 10.5 Package-Manager: Portage-2.3.13, Repoman-2.3.3 --- sys-devel/binutils-apple/Manifest | 4 + sys-devel/binutils-apple/binutils-apple-3.2.ebuild | 227 +++++++++++++++++++++ 2 files changed, 231 insertions(+) create mode 100644 sys-devel/binutils-apple/binutils-apple-3.2.ebuild (limited to 'sys-devel') diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest index f404c7a7bfbb..17d373c04217 100644 --- a/sys-devel/binutils-apple/Manifest +++ b/sys-devel/binutils-apple/Manifest @@ -1,3 +1,5 @@ +DIST binutils-apple-LP64-patches-1.tar.bz2 10235 BLAKE2B 3352170bcfe73c574217597233ca58c7d6ebeedf9dfe9da1399953dfe1a0c87fc26e9ba8864620ddd67c6f38e48aeb6950737637605f0b860eb4a0d246f3aff7 SHA512 5632d4033c39e47de3ec275d02100ed53408a63122fe722c26dda1b02275c397524b113e51e1334d3235fc7f0a3bb8e53d4ccc1c2e40f24c6129282846da22e1 +DIST binutils-apple-patches-3.2-r0.tar.bz2 4137 BLAKE2B 9cd7afbba5337cb9c395556b2691e4acd73ee323d643da4335f6465ccc29b06f889d01fb42c7778576607bfdb859e2df38d3ebf82d4bf7f0971079da6985f237 SHA512 5381a93d61c39993cdb294ecb238016e26cdfe283fae553f75ddc6662812709301d5208c770ac0992d1dfab92e4802c660e6fb4336ad891335ab716d3b042805 DIST binutils-apple-patches-4.3-r1.tar.bz2 37363 BLAKE2B a5ad04d4bf746a864f03a25d052197ed9a6ecada1f34460f4e38bea8cd87dfe2cb6c7f99f2096acac2231cd1e0c13c53757854b07f729a7a0c5a162a908fbe83 SHA512 f5d64ad182891c3af971e6aabd3c0c1b717b6a1cb471632339cba61b41a998d15880d18de09aafa1c3d059e528c888d6e8b914025c79bc21897d90a6d0e2ebf5 DIST binutils-apple-patches-5.1-r2.tar.bz2 51642 BLAKE2B 1b44020a05e0a91cfe569273f1e3dc65afaeac4bcdb80a626bdcc1f30cf8fbba6cc7bb522ece93126d4035b2d309defefd17fe0cee5bcaadcc58c4fa0feb4827 SHA512 37ba0dcae6c10b54a07c6208f6893ab80b0de1bd1c2f677902f707c8290629f7671a481e256b57a18bf304b95e41e4d59519bc1c88f15de488c0ef7e142f5cd8 DIST binutils-apple-patches-6.1-r1.tar.bz2 42189 BLAKE2B 8505acaff6343b2f4dffe9c1dd78e360762f0ad78d39fbc0227265ed8b6768dba62c1a7d6784ca685934942e1a211c70275474001b066e3292c579fa0aa2f356 SHA512 be8ee5af5c8c9f9228cf6980f032aa101058ac1a414bec89401dbc4ff32ea96d6ebf96b7b79285fa1e7b4037a9ed68b285dbe59ff8e3d3e62bfc0145199e72f3 @@ -9,6 +11,7 @@ DIST binutils-apple-patches-7.3-r0.tar.bz2 44576 BLAKE2B a9f23fe66f9b3e25b8975c9 DIST binutils-apple-patches-7.3-r1.tar.bz2 44737 BLAKE2B 4ac5d3b50c04b1ab71dc1c266db8b44e9d34f12bcc8a53966232cb5a6999b2662f9891367a2e7f8ea4f0f014b19594c1adf8dd945a18419980bca729c1de302e SHA512 ce4b3a725e19cb632b0c101a32488ce09a8bb89aed08339d5518d834cb68c525b2e0c8b66564a945c077915e92cc6be3f7028c5baacb870b3ca9b9422b4fb0da DIST binutils-apple-patches-8.2-r0.tar.bz2 5771 BLAKE2B b562ea4dd9214bc66695dbdb2452c88b1885ae1e36904516ea664157cbf0b54421d80cd0df792fcc431a3e0b98e804488c651b3fa29b368445450d0d13a1502c SHA512 92d04396630a31b752a24845c27fe8da2e37eb176117c9b31193e8f48af7ade707cda4060289b848965310afd05b2f121c740b0e5baa56b79c5481273a88c84e DIST binutils-apple-patches-8.2-r1.tar.bz2 10830 BLAKE2B 345db8619873e9e91b79c3fdc0685fc46f82366df0b6153c1a59fbe5c122622e799754397e980e8752ef01ef25bbac81bb8f0339e92168790211b1d9c03bef2d SHA512 e7ca8cbac75671846c044abcd5415cfcf5832ff71acd5a2799b643369b02f2f7148990398c51913a3758e589f9fbff875e333aadf568e2a8a2defeafaa2aca95 +DIST cctools-750.tar.gz 1947953 BLAKE2B c2c6176daaeac0ca407c13c19ce15a84be639510d95c15bca654ba3415fe64a136a0155bcd3c8a34696c35cfe6989f1177a486cc71acc157b42d7c706b23fb29 SHA512 e2e152a9fb7db47c60fe450e1fc92c6866ab89682c7fdc594b97e419ce93ea1353654bd4419bf3df99d119f554aa0f32993dc645dd7c4680840cd01b7dce2f67 DIST cctools-822.tar.gz 2024412 BLAKE2B 6b58499a9dfc2a1b166ff428f1e263cd44e03c50cdc8f6e467cfee93bc2dc2a9c81bf7626479dce195b152f04217e2d3a427afac45484cba4c5f2bdfbb7e46f9 SHA512 8b02cc837d5e0520f35da445f25ba86b5042d5caa27b49a599e829ed89428cf78dbd1831bcf6c18301f941fbfb31ac2114e248041d98008a466e1574f4fe1586 DIST cctools-855.tar.gz 1699635 BLAKE2B 4d98cf2bbced6894083dc2733a35cf9a4c47f71172fe98265a8f047218cc90276085919129553e3a1ea0658416eebf3b7cf0908bd32ac1a224480554257999ee SHA512 50f5d015ce807aa5ca274dd2deea810b8b375110e60b5e334ca4b2170526b738ea5f86a5436caebbdb748badc3b89601d0f450f5b867d8393c89e336a3db4b3f DIST cctools-862.tar.gz 1702345 BLAKE2B de84058aa78824562b0eabf93a29badaba0908a7140336a281a6ea46a9b09d893433a908c299e8de866a76e0eeb98b730570958fc8fac559ccc6e35f5138b121 SHA512 faa401c1dc55bfb9cd2a9a9cc7bc9d473ee63b019607967c8b0da325514d6a1f7b1f52404370bcc018e86d30d75a4b01183f49b793f577110663efe43871360a @@ -35,5 +38,6 @@ DIST ld64-264.3.101.tar.gz 681491 BLAKE2B d924b8865924d7d2b55886221c0e8c6ed0b50c DIST ld64-264.3.102.tar.gz 681509 BLAKE2B 4a0699ec761bd145b8034c8577ce9f843c9384fee5486855565d1d89858a445492d66aca2798a6e9c1bb4f59328680c05bcf1cd024d917c063e74d3549073ce0 SHA512 ec221de3624dcce3db694ec2d7b05f3c939cd1ba79c97437ba9f2d4e5d9c37369bb5df82cc37bc158bf5c4e2128cc2b96ca1a7477f98538850092bffa4601da0 DIST ld64-274.1.tar.gz 670493 BLAKE2B 00ab46b09f29c6143c5066ffb0a12017fb2268a5f205c41851a95bc38443aa5494ce81b793a6668bcd3a8abb0ba4215f0da372c413ae52e4ca1e437ad370f8e0 SHA512 ef5d6802f759e09aa2dfab7eb84e9cd2a57b28da3f150833cf1a922c395dd696e501b1bcb10385cbe995f4945fc6c99c2d2d8c50c42f369186bdc1ac3e30ad99 DIST ld64-274.2.tar.gz 671652 BLAKE2B f45bb65bbe65c7baff54dec633a49b8ea472a59a7978aa050b329132963b26e4a2b3ef3dd034b04247531a11a07de5135b3726a429165cbfcae50e06c09531f4 SHA512 7b4e17f199909450b697bf719564c6841d46f5116c48dd47ff483ae7ddfe2965db1b7c024ed8ebeeaf90cd983ed353b95f7f23c93c8971536977dc892e6d6a9d +DIST ld64-85.2.1.tar.gz 598524 BLAKE2B 92cb3c763cc067e2ee6c4fec910f078cc69daca2a328a74ebc988908b1655138873b69bfb0c19b284f0aedb678e99de3866d4f13460cb3427985704093dca37a SHA512 b5ffaffc43e74f22688fecd9fb3023a59160cf051f9412f34e6b0acf1c4f9d43ba641e199d8d6b1c6cf3bbbbf117645988fd879ded1fec8be056b6941fe79999 DIST libunwind-30.tar.gz 82811 BLAKE2B 26993d6afa6930931c01b579326964a66832ed7a6ffa26eff10016c8d6d175d3b671753cf8700dcdbae7f0a9c01b16e9cbd3c9fe86697608f1f08a8eceb64782 SHA512 57106eafa1516791b4e0db2de6c6336bc0c1cbd8bf098a6d3a809fafa457802c95a7aeae9137f4ca5922a3018dfd8f597907ea4187b0afbbf267500eae00041f DIST libunwind-35.3.tar.gz 90002 BLAKE2B d63ab0ae6e66a6f35ec17de9713d3bf4853cd80af218e868762b20dd8a44d42cd9ff8fce1d8c46fca4759144726bbf248a02a5dede5a94a2b75d3b45ddb7d018 SHA512 b7d9a86ef24f1fe9ca14517471e03a910219a229af9f0d4cf94435115971360640451107ba20c93fb1aab788f8b6eb5ed580ee08fdaa990b9fa43e9ae360c6b4 diff --git a/sys-devel/binutils-apple/binutils-apple-3.2.ebuild b/sys-devel/binutils-apple/binutils-apple-3.2.ebuild new file mode 100644 index 000000000000..8b3622786d6e --- /dev/null +++ b/sys-devel/binutils-apple/binutils-apple-3.2.ebuild @@ -0,0 +1,227 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit eutils flag-o-matic toolchain-funcs + +RESTRICT="test" # the test suite will test what's installed. + +# LD64=ld64-95.2.12 # can't compile this one, missing libunwind/* includes +# http://lists.apple.com/archives/Darwin-dev/2009/Sep/msg00025.html +LD64=ld64-85.2.1 # from 3.1.2 +CCTOOLS=cctools-750 +LP64PATCHES=binutils-apple-LP64-patches-1 + +DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools 3.2" +HOMEPAGE="http://www.opensource.apple.com/darwinsource/" +SRC_URI="https://opensource.apple.com/tarballs/ld64/${LD64}.tar.gz + https://opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz + https://dev.gentoo.org/~grobian/distfiles/${LP64PATCHES}.tar.bz2 + https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-3.2-r0.tar.bz2" + +LICENSE="APSL-2" +KEYWORDS="~ppc-macos ~x64-macos ~x86-macos" +IUSE="test" + +RDEPEND="sys-devel/binutils-config" +DEPEND="${RDEPEND} + test? ( >=dev-lang/perl-5.8.8 )" + +SLOT="3" + +S=${WORKDIR} + +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } + +prepare_ld64() { + cd "${S}"/${LD64}/src + cp "${WORKDIR}"/Makefile . || die + + local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\"" + sed -i \ + -e '/^#define LTO_SUPPORT 1/s:1:0:' \ + ObjectDump.cpp || die + echo '#undef LTO_SUPPORT' > configure.h + echo '' > linker_opts + echo "char ldVersionString[] = ${VER_STR};" > version.cpp + + # clean up test suite + 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; + + elog "Deleted $c tests that were bound to fail" +} + +src_prepare() { + prepare_ld64 + + cd "${S}"/${CCTOOLS} + epatch "${WORKDIR}"/${PN}-3.1.1-as.patch + epatch "${WORKDIR}"/${PN}-3.1.1-as-dir.patch + epatch "${WORKDIR}"/${PN}-3.1.1-ranlib.patch + epatch "${WORKDIR}"/${PN}-3.1.1-libtool-ranlib.patch + epatch "${WORKDIR}"/${PN}-3.1.1-nmedit.patch + epatch "${WORKDIR}"/${PN}-3.1.1-no-headers.patch + epatch "${WORKDIR}"/${PN}-3.1.1-no-oss-dir.patch + epatch "${WORKDIR}"/${P}-armv7-defines.patch + + cd "${S}"/${LD64} + epatch "${WORKDIR}"/${PN}-3.1.1-testsuite.patch + epatch "${WORKDIR}"/LP64/ld64/*.patch + + 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 + + eapply_user +} + +src_configure() { + 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 +} + +compile_ld64() { + cd "${S}"/${LD64}/src + # 'struct linkedit_data_command' is defined in mach-o/loader.h on leopard, + # but not on tiger. + [[ ${CHOST} == *-apple-darwin8 ]] && \ + append-flags -isystem "${S}"/${CCTOOLS}/include/ + emake || die "emake failed for ld64" + use test && emake build_test +} + +compile_cctools() { + cd "${S}"/${CCTOOLS} + emake \ + LTO= \ + TRIE= \ + EFITOOLS= \ + 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() { + tc-export CC CXX + compile_cctools + compile_ld64 +} + +install_ld64() { + exeinto ${BINPATH} + doexe "${S}"/${LD64}/src/{ld64,rebase} + 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= \ + 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} +} -- cgit v1.2.3-65-gdbad