Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#53151 closed defect (invalid)

ld64-latest: handeling tbd files

Reported by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) Owned by: jeremyhu@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ld64-latest

Description

I am currently trying to get Qt to use MacPorts clang instead of Xcode clang so as to hopefully support older OSs for longer..
The linker, however, does not seem to be able to handle tbd files.
For example, the following code fails:

clang++-mp-3.9 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk main.cxx

with the error

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

I have been able to workaround the problem by removing -syslibroot from the linker.

The more difficult problem is when the .tbd file and dylib file are in the same directory as in:

clang++-mp-3.9 -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -weak_framework XCTest main.cxx

which produces the error

ld: unexpected token: !tapi-tbd-v2 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/XCTest.tbd' for architecture x86_64

Any suggestions on a fix or workaround?

Change History (5)

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

Resolution: invalid
Status: newclosed

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

(and indicate that it's a dupe of 29679726).

comment:3 Changed 8 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Thank you for the suggestion.
I opened bug number 29804935 with Apple.

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

Thanks. Every dupe helps.

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

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

Note: See TracTickets for help on using tickets.