Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#53784 closed defect (fixed)

Add support for tapi-tbd-v2

Reported by: jtalle Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: larryv (Lawrence Velázquez), cjones051073 (Chris Jones), josephwinston (Joseph Winston)
Port: ld64-latest

Description

Attempted to use 'sudo port install clang-3.7' and received an error.

Attaching log file.

Attachments (1)

clang-3.7 (3.6 MB) - added by jtalle 7 years ago.

Change History (23)

Changed 7 years ago by jtalle

Attachment: clang-3.7 added

comment:1 Changed 7 years ago by jtalle

the logfile was > 10mb. Created a txt file with the tail end of the log and attached it.

comment:2 Changed 7 years ago by mf2k (Frank Schima)

Cc: larryv added
Owner: set to jeremyhu
Port: clang-3.7 added
Status: newassigned

In the future, please fill in the Port field and Cc the port maintainers (port info --maintainers clang-3.7), if any.

comment:3 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Port: ld64-latest added; clang-3.7 removed
Summary: clang-3.7 failAdd support for tapi-tbd-v2

:info:build ld: unexpected token: !tapi-tbd-v2 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib/libc++abi.tbd' for architecture x86_64

Please use the +ld64-latest variant of ld64.

comment:4 Changed 7 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I started working on this a few weeks ago, but I didn't finish it. If someone wants to pick up where I left off, see https://github.com/jeremyhu/macports-ports/commits/tapi-v2

The trouble is that the tapi drop from Apple doesn't work with OSS llvm (at least not the versions I tried 3.7-devel at the time). We will likely want to instead create a libtapi port which pulls in the version of llvm that Apple released from that same version of Xcode.

comment:5 Changed 7 years ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:6 Changed 7 years ago by josephwinston (Joseph Winston)

Cc: josephwinston added

comment:7 Changed 6 years ago by gaming-hacker (G Alexander)

what's the status on this? it still doesn't work with llvm5 or llvm6

ld: unexpected token: !tapi-tbd-v2 file '/System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd' for architecture x86_64
Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I understand your frustration, but it's simply not a priority for me. If it's hindering you, just install the +ld64_xcode variant of ld64 until it is addressed.

comment:9 in reply to:  8 Changed 6 years ago by sunoterra (Michael Stilson)

Replying to jeremyhu:

I understand your frustration, but it's simply not a priority for me. If it's hindering you, just install the +ld64_xcode variant of ld64 until it is addressed.

nice! building ld64 with that variant solves all kinds of build/link errors that have been popping up lately, on 10.11.x systems.

thanks @jeremyhu 🖖

comment:10 Changed 6 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 5698d9483b44984a826d0f41154a4381b7957223/macports-ports (master):

ld64: default to +ld64_xcode on Xcode9+

ld64 does not understand tapi in the open-source
versions at present.

closes: #56843
closes: #53784
closes: #56398
closes: #56277
see: #56647
see: #54510
see: #54506
see: #53151

comment:11 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened

Reopening. This hasn't been fixed. This tracks adding support, not deferring to Xcode.

comment:12 Changed 6 years ago by kencu (Ken)

Thanks -- I was going to reopen it myself, as I know you meant for this to track adding tapi support to ld64.

Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:13 Changed 6 years ago by kencu (Ken)

BTW -- one of your Apple colleagues has put on GitHub what appears to be a nice-looking tapi drop that looks as though it would build in the clang / llvm mix as an additional project. I'm sure you already knew this:

<https://github.com/ributzka/tapi>

Edit:

So that has been made into an easy-to-build project <https://github.com/tpoechtrager/apple-libtapi/tree/2.0.0> however, it is incomplete, and actually segfaults when used. It seems that certain parts are not yet implemented in the github released version <https://github.com/tpoechtrager/apple-libtapi/blob/2.0.0/src/llvm/projects/libtapi/lib/Core/MachODylibReader.cpp> and so it appears we continue to await an official Apple drop of tapi 2.0.0 with tapi-v3 support in it.

Given this, I'll stop trying to make this happen until something comes down from above, which is where I'm sure you are with this as well.

Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:14 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Yeah, that drop isn't compatible with OSS llvm mainline. It was based on an Apple fork, and hasn't been updated for mainline, which is part of the problem.

comment:16 Changed 4 years ago by kencu (Ken)

comment:17 Changed 4 years ago by ken-cunningham-webuse

In 358bba9ebfd25dd2e78bc961e63c720de6caf27d/macports-ports (master):

libtapi @ 1000.10.8: new port

adds Text-Based API support to ld64
allows open-source versions of ld64 to support newer
MacOS SDK versions that come with only *.tbd files
instead of full or stub dylibs to link against

see #53784

comment:18 Changed 4 years ago by kencu (Ken)

With libtapi and two small modifications to our current ld64-latest port (deleting the patchfile that disabled tapi and adding -ltapi to the ld Makefile line), the current ld64-latest port seems to handle the *.tbd files in the MacOS10.14.sdk without any trouble, on 10.13 so far.

So that is a step in the right direction. I will ponder what to do next here, but I think perhaps spinning off ld64-latest into ld64-274 might make sense, as it would be the last ld64 we have that does not require tapi, and then we can make a new ld64-latest that hopefully is up to date with the latest version available.

This is a bit tricky, but there are several internet projects out there that have made some headway on this already to use as a guide for patches, and perhaps once we get something worth looking at, Jeremy might have some input.

comment:19 Changed 4 years ago by kencu (Ken)

see <https://github.com/macports/macports-ports/pull/6223> for the WIP on the new ld64-latest...

comment:20 Changed 4 years ago by kencu (Ken)

I have ld64 @450 building now -- that is the latest available, and so should update the port shortly.

comment:21 Changed 4 years ago by kencu (Ken)

Resolution: fixed
Status: reopenedclosed

In 43f6c6038861428f10bf07b236464273e9c0e206/macports-ports (master):

ld64-latest: build 450.3

  • add man pages if ld64-latest is installed
  • add build fixes for older systems
  • clarify compiler blacklisting for some older ld64 versions
  • add new ld64_274 subport
  • default systems that can't build libtapi with Xcode to ld64_274
  • add support for tests (universal tests TBA)

closes: #57587
closes: #53784

comment:22 Changed 4 years ago by ken-cunningham-webuse

In 358bba9ebfd25dd2e78bc961e63c720de6caf27d/macports-ports (dar, master, py38-reproject, revert-6945-rust-1.43.0, wireshark):

libtapi @ 1000.10.8: new port

adds Text-Based API support to ld64
allows open-source versions of ld64 to support newer
MacOS SDK versions that come with only *.tbd files
instead of full or stub dylibs to link against

see #53784

Note: See TracTickets for help on using tickets.