clang 4 and 5 got slotted into EPREFIX/usr/lib/llvm/<major>. binutils-apple need to be adjusted for that to a.) find llvm tools that are nowadays used as backends to cctools tools (clang as, nm, size, llvm-objdump) b.) link to and ldopen libLTO.dylib from this path. Also, clang-5 starts to complain about some C++ method prototypes in ld64-274.2/src/ld/parsers/macho_relocatable_file.cpp. Reproducible: Always
Created attachment 511630 [details] Updated ebuild for binutils-apple-8.2.1 This ebuild uses eclass llvm to find the LLVM prefix and adjusts include and library directories accordingly. ld64 is still linked directly against libLTO. The hope is that the portage preserved-libs feature helps to prevent major fallout in the future now that libLTO at least gets a different path between major versions. cctools is adjusted to use a helper function to find LLVM tools and libs inside the prefix. The helper function is eprefixify'd before compilation instead of trying to transport the prefix path via make variables. This greatly reduces the impact and patch size to the make files. The same function is used in a small shim binary that finds and executes llvm replacements for cctools tools (nm, size, objdump).
Created attachment 511640 [details] Updated llvm-shim that accounts for being called as CTARGET-tool
Created attachment 511678 [details] Updated tapi ebuild to allow tapi support in ld64 again. The attached ebuild builds tapi-2.0.0 from the github open source drop repository. This makes tapi support in ld64 functional again. The build process is somewhat convoluted though. See header of ebuild for explanation.
Created attachment 511690 [details] Updated tapi ebuild to allow tapi support in ld64 again. Change tapi ebuild to play nice with cmake's CMAKE_INSTALL_RPATH_USE_LINK_PATH feature. This automatically adds rpaths to libs it's linked against. Move the temporary ObjCMetadata install root into the tapi build dir so it does not end up on the rpath.
Created attachment 511734 [details] Updated binutils-apple-8.2.1 ebuild with tapi support Update ld64 Makefile to add rpath for tapi library as well.
Created attachment 511888 [details] Updated binutils-apple-8.2.1 ebuild with bootstrap workaround Add a workaround that stops eclass llvm from dying during bootstrap because LLVM isn't installed yet.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e31bea4612e174201032c496edc62b8e97109569 commit e31bea4612e174201032c496edc62b8e97109569 Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2017-12-29 13:49:59 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2017-12-29 13:49:59 +0000 sys-devel/binutils-apple: patchbump for llvm 4/5 by Michael Weiser Closes: https://bugs.gentoo.org/642292 Package-Manager: Portage-2.3.13, Repoman-2.3.3 sys-devel/binutils-apple/Manifest | 1 + .../binutils-apple/binutils-apple-8.2.1-r1.ebuild | 366 +++++++++++++++++++++ 2 files changed, 367 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=861716fce0066319fce54243dab1aa805e04aeff commit 861716fce0066319fce54243dab1aa805e04aeff Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2017-12-29 14:36:17 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2017-12-29 14:36:26 +0000 sys-libs/tapi: version bump to support recent ld64 by Michael Weiser I made some small changes to use a tarball because repoman does not permit a live-ebuild (one that uses git-r3) to be in the tree unmasked. Closes: https://bugs.gentoo.org/642292 Package-Manager: Portage-2.3.13, Repoman-2.3.3 sys-libs/tapi/Manifest | 4 + .../files/objcmetadata-800.0.42.1-standalone.patch | 130 +++++++++++++++ sys-libs/tapi/files/tapi-2.0.0-standalone.patch | 141 ++++++++++++++++ sys-libs/tapi/tapi-2.0.0.ebuild | 177 +++++++++++++++++++++ 4 files changed, 452 insertions(+)
Created attachment 511976 [details, diff] Set S directly to tapi source directory Didn't like the git checkout myself because of the missing integrity checking. Cool solution, pulling the tarball from Github. tapi fails to build though because it can not find Readme.md on install. I think TAPI_S can just be S as in the attached patch. This way it builds for me.
Can you keep an eye out for fixing the tapi ebuild? (TAPI_S vs. S)
I pushed that here: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=353da60003022823a64948adc2662bf75e91679a
Right, sorry. It's all there and compiles and works. Sorry for the noise.