clang-3.7 @3.7.1_5: ld: unexpected token: !tapi-tbd-v2
macOS Sierra 10.12.5
Xcode 8.3.3
: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
: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 i386
:info:build clang: error: unable to execute command: Segmentation fault: 11
:info:build clang: error: linker command failed due to signal (use -v to see invocation)
$ port -v installed cctools ld64 ld64-latest llvm-3.7 llvm-3.9
The following ports are currently installed:
cctools @895_4+llvm39+universal (active) platform='darwin 16' archs='i386 x86_64' date='2017-01-03T17:43:31-0600'
ld64 @3_0+universal (active) platform='darwin 16' archs='i386 x86_64' date='2016-12-27T16:46:25-0600'
ld64-latest @274.2_1+llvm39+universal (active) platform='darwin 16' archs='i386 x86_64' date='2017-03-14T15:52:06-0500'
llvm-3.7 @3.7.1_4+universal (active) platform='darwin 16' archs='i386 x86_64' date='2017-07-20T10:06:25-0500'
llvm-3.9 @3.9.1_3+universal (active) platform='darwin 16' archs='i386 x86_64' date='2017-03-04T07:46:20-0600'
I think this is related to #53784. As a workaround, you can install ld64 with the +ld64_xcode variant. After that llvm-3.7 builds fine.
By the way: If you are compiling llvm-3.7 because you need to build xorg-server, you may face another issue later on: #54504.