Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 642292 - sys-devel/binutils-apple: Update for clang-4/5
Summary: sys-devel/binutils-apple: Update for clang-4/5
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-26 11:18 UTC by Michael Weiser
Modified: 2018-01-03 12:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Updated ebuild for binutils-apple-8.2.1 (binutils-apple.tar.gz,13.58 KB, application/x-gzip)
2017-12-26 11:25 UTC, Michael Weiser
Details
Updated llvm-shim that accounts for being called as CTARGET-tool (binutils-apple-8.2.1-llvm-shim.patch,3.80 KB, text/plain)
2017-12-26 13:25 UTC, Michael Weiser
Details
Updated tapi ebuild to allow tapi support in ld64 again. (tapi-2.0.0.tar.gz,5.17 KB, application/x-gzip)
2017-12-26 17:58 UTC, Michael Weiser
Details
Updated tapi ebuild to allow tapi support in ld64 again. (tapi-2.0.0.tar.gz,5.21 KB, application/x-gzip)
2017-12-26 20:27 UTC, Michael Weiser
Details
Updated binutils-apple-8.2.1 ebuild with tapi support (binutils-apple.tar.gz,10.83 KB, application/x-gzip)
2017-12-27 12:36 UTC, Michael Weiser
Details
Updated binutils-apple-8.2.1 ebuild with bootstrap workaround (binutils-apple.tar.gz,10.89 KB, application/x-gzip)
2017-12-28 20:44 UTC, Michael Weiser
Details
Set S directly to tapi source directory (tapi-2.0.0-S.patch,973 bytes, patch)
2017-12-29 16:05 UTC, Michael Weiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weiser 2017-12-26 11:18:08 UTC
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
Comment 1 Michael Weiser 2017-12-26 11:25:15 UTC
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).
Comment 2 Michael Weiser 2017-12-26 13:25:23 UTC
Created attachment 511640 [details]
Updated llvm-shim that accounts for being called as CTARGET-tool
Comment 3 Michael Weiser 2017-12-26 17:58:41 UTC
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.
Comment 4 Michael Weiser 2017-12-26 20:27:00 UTC
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.
Comment 5 Michael Weiser 2017-12-27 12:36:32 UTC
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.
Comment 6 Michael Weiser 2017-12-28 20:44:36 UTC
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.
Comment 7 Larry the Git Cow gentoo-dev 2017-12-29 13:50:08 UTC
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(+)
Comment 8 Larry the Git Cow gentoo-dev 2017-12-29 14:36:36 UTC
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(+)
Comment 9 Michael Weiser 2017-12-29 16:05:27 UTC
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.
Comment 10 Michael Weiser 2018-01-02 21:02:04 UTC
Can you keep an eye out for fixing the tapi ebuild? (TAPI_S vs. S)
Comment 12 Michael Weiser 2018-01-03 12:24:55 UTC
Right, sorry. It's all there and compiles and works. Sorry for the noise.