[swift-dev] Build failing on CMakeTestCCompiler.cmake

William Dillon william at housedillon.com
Thu Dec 8 15:28:14 CST 2016


I think Greg is right.  I’ve seen this before, and the way I fixed it was by fixing the Xcode configuration, specifically relating to the command-line tools.

- Will

On December 8, 2016 at 1:24:59 PM, Greg Parker via swift-dev (swift-dev at swift.org) wrote:


On Dec 8, 2016, at 7:28 AM, Frederick Kellison-Linn via swift-dev <swift-dev at swift.org> wrote:

Hello,

I have been attempting to build Swift, but have been running into issues near the end of the build. Specifically, CMake fails on the step [2112/2254] Performing configure step for 'compiler-rt’, since the compiled clang fails to build a simple C program. The specific issue appears to be at the lines:

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

My system settings are as follows:

MacBook Pro (Retina, Mid 2012)
macOS Sierra Version 10.12.2 Beta (16C48b)
Xcode Version 8.1 (8B62)
    |----clang/clang++: Apple LLVM version 8.0.0 (clang-800.0.42.1)

  /Users/freddy/Development/swift/swift-source/build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/./bin/clang
  -isysroot
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
  -Wl,-search_paths_first -Wl,-headerpad_max_install_names
  CMakeFiles/cmTC_b980a.dir/testCCompiler.c.o -o cmTC_b980a && :

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

That error sounds like the build is trying to use an old linker that does not understand the format of the current SDK's files.

Xcode 8.1 (8B62) should be fine. If the problem is an old linker then it is most likely coming from some other install of Xcode on your machine.

What is the output of `xcode-select -p` and `xcodebuild -version`? If those are pointing at some other install of Xcode then you can use `xcode-select -s` to tell the command-line tools which copy of Xcode to use.

You can also re-run the failing clang command by hand and add -### to its arguments. clang will then print the full path to the linker it is running.


-- 
Greg Parker     gparker at apple.com     Runtime Wrangler


_______________________________________________
swift-dev mailing list
swift-dev at swift.org
https://lists.swift.org/mailman/listinfo/swift-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20161208/acea5ead/attachment.html>


More information about the swift-dev mailing list