Good idea.

In the end, I resolved the issue by renaming /opt/local/bin/ld which meant that 
clang used /usr/bin/ld, which had an appropriate LLVM version. Would be good if 
the build script utilized the Xcode toolchain instead of relying on system 
settings.

Freddy



> On Dec 8, 2016, at 9:09 PM, William Dillon <will...@housedillon.com> wrote:
> 
> Try it with a PATH that does not include /opt/local/*
> 
> I haven’t build on MacOS in a long time, so I can’t say with any more detail 
> how the tools (clang, ld, etc.) are chosen when building swift ¯\_(ツ)_/¯ 
> 
> Good luck :)
> - Will
> 
>> On December 8, 2016 at 6:05:12 PM, Frederick Kellison-Linn (fred...@me.com) 
>> wrote:
>> which ld gives the same /opt/local version
>> 
>> My path is
>> 
>> /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/freddy/anaconda3/bin:/opt/local/bin:/opt/local/sbin:/Users/freddy/.rvm/gems/ruby-2.1.1/bin:/Users/freddy/.rvm/gems/ruby-2.1.1@global/bin:/Users/freddy/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Users/freddy/.rvm/bin
>> 
>> Freddy
>> 
>>> On Dec 8, 2016, at 5:31 PM, William Dillon <will...@housedillon.com> wrote:
>>> 
>>> What if you try:
>>> 
>>> which ld
>>> 
>>> And, what’s your PATH?
>>> 
>>>> On December 8, 2016 at 2:19:20 PM, Frederick Kellison-Linn 
>>>> (fred...@me.com) wrote:
>>>> 
>>>> Yeah that seems wrong to me as well. Do you know how I can change the 
>>>> linker that clang invokes?
>>>> 
>>>> Freddy
>>>> 
>>>>> On Dec 8, 2016, at 5:16 PM, William Dillon <will...@housedillon.com> 
>>>>> wrote:
>>>>> 
>>>>> The Apple folks might know better and correct me, but I’m pretty certain 
>>>>> you don’t want to be using any toolchains in /opt/local.  It all needs to 
>>>>> be from the Xcode.app.
>>>>> 
>>>>> - Will
>>>>> 
>>>>>> On December 8, 2016 at 2:14:42 PM, Frederick Kellison-Linn via swift-dev 
>>>>>> (swift-dev@swift.org) wrote:
>>>>>> 
>>>>>> The output of those commands follows:
>>>>>> 
>>>>>> $ xcode-select -p
>>>>>> /Applications/Xcode.app/Contents/Developer
>>>>>> 
>>>>>> $ xcodebuild -version
>>>>>> Xcode 8.1
>>>>>> Build version 8B62
>>>>>> 
>>>>>> Both look fine to me.
>>>>>> 
>>>>>> It appears that clang is invoking /opt/local/bin/ld, and running 
>>>>>> /opt/local/bin/ld -v gives:
>>>>>> 
>>>>>> @(#)PROGRAM:ld  PROJECT:ld64-264.3.102
>>>>>> configured to support archs: i386 x86_64 x86_64h armv6 armv7 armv7s 
>>>>>> armv7m armv7k arm64 (tvOS)
>>>>>> LTO support using: LLVM version 3.8.1
>>>>>> 
>>>>>> What is wrong with the config here?
>>>>>> 
>>>>>> Freddy
>>>>>>  
>>>>>>> On Dec 8, 2016, at 4:28 PM, William Dillon <will...@housedillon.com> 
>>>>>>> wrote:
>>>>>>> 
>>>>>>> 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@swift.org) wrote:
>>>>>>>> 
>>>>>>>> 
>>>>>>>>> On Dec 8, 2016, at 7:28 AM, Frederick Kellison-Linn via swift-dev 
>>>>>>>>> <swift-dev@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     gpar...@apple.com     Runtime Wrangler
>>>>>>>> 
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> swift-dev mailing list
>>>>>>>> swift-dev@swift.org
>>>>>>>> https://lists.swift.org/mailman/listinfo/swift-dev
>>>>>> 
>>>>>> _______________________________________________
>>>>>> swift-dev mailing list
>>>>>> swift-dev@swift.org
>>>>>> https://lists.swift.org/mailman/listinfo/swift-dev
>> 
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to