Opened 12 months ago

Last modified 8 months ago

#59342 assigned defect

llvm-config uses incorrect SDK taken from xcode rather than command-line tools

Reported by: thomasrussellmurphy (Thomas Russell Murphy) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.6.1
Keywords: Cc: larryv (Lawrence Velázquez), EJFielding (Eric Fielding), jrjsmrtn
Port: llvm-6.0 llvm-5.0

Description (last modified by kencu (Ken))

Filing (late) a ticket per the request of the mailing list. Re-ran clean + upgrade attempt and attaching log.

Addendum: fixed for llvm-7.0. still an issue for llvm-5.0 and llvm-6.0.

Attachments (3)

cctools_921_4_failure.log (135.9 KB) - added by thomasrussellmurphy (Thomas Russell Murphy) 12 months ago.
cctools upgrade failure log
main.log (133.7 KB) - added by EJFielding (Eric Fielding) 12 months ago.
main log showing failure to build
cctools_failed_upgrade_10.14.6_20191023.log (120.2 KB) - added by jrjsmrtn 12 months ago.

Download all attachments as: .zip

Change History (17)

Changed 12 months ago by thomasrussellmurphy (Thomas Russell Murphy)

Attachment: cctools_921_4_failure.log added

cctools upgrade failure log

comment:1 Changed 12 months ago by jmroot (Joshua Root)

Cc: larryv added
Owner: set to jeremyhu
Port: llvm-7.0 added
Priority: Not setNormal
Status: newassigned
Summary: cctools @921_3+llvm70: unable to upgrade to 921_4, build errorcctools @921_3+llvm70: uses incorrect SDK taken from llvm-config-mp-7.0

comment:2 Changed 12 months ago by kencu (Ken)

presumably once we confirm all the buildbots have the command line tools installed, we revbump every port (like this one) with a baked-in SDK pointing into Xcode, and we should fix these issues up.

comment:3 Changed 12 months ago by EJFielding (Eric Fielding)

Cc: EJFielding added

comment:4 Changed 12 months ago by EJFielding (Eric Fielding)

I was going to open a new ticket but found this one with exactly the same problem. I am attaching my "main.log" file also in case it helps.

Changed 12 months ago by EJFielding (Eric Fielding)

Attachment: main.log added

main log showing failure to build

comment:5 Changed 12 months ago by EJFielding (Eric Fielding)

I was trying to upgrade all my other ports and I tried this:

sudo port upgrade outdated and not cctools

The port command is still trying to build cctools. Is this the correct syntax?

comment:6 Changed 12 months ago by jrjsmrtn

Cc: jrjsmrtn added

Changed 12 months ago by jrjsmrtn

comment:7 Changed 12 months ago by jrjsmrtn

I added another log for a cctools 921_4 failed upgrade on macOS 10.14.6.

comment:8 Changed 12 months ago by EJFielding (Eric Fielding)

I installed Xcode 10.3 (had to find it on the developer.apple.com site https://developer.apple.com/download/more/?=xcode). Now my cctools upgrade works.

comment:9 Changed 12 months ago by thomasrussellmurphy (Thomas Russell Murphy)

Workaround to enable updating the rest of my ports tree:

sudo port uninstall -f cctools
sudo port install cctools +xcode

The problematic variant may still need to be corrected, but changing variants should meet my needs.

comment:10 Changed 11 months ago by EJFielding (Eric Fielding)

In case someone else tries to follow what I did, installing an old version of Xcode only worked for a while. My employer has an automatic software upgrade system that installed Xcode 11.2 on top of Xcode 10.3. Apparently, it did not do a complete installation, so I then ended up with an inconsistent Swift library and xcodebuild would not run. I got a bunch of errors like this:

objc[48448]: Class __SwiftNativeNSDataBase is implemented in both /usr/lib/swift/libswiftCore.dylib (0x7fff94acce48) and /Applications/Xcode.app/Contents/Frameworks/libswiftCore.dylib (0x10633ded0). One of the two will be used. Which one is undefined.
objc[48448]: Class __SwiftNativeNSIndexSetBase is implemented in both /usr/lib/swift/libswiftCore.dylib (0x7fff94acce98) and /Applications/Xcode.app/Contents/Frameworks/libswiftCore.dylib (0x10633df20). One of the two will be used. Which one is undefined.
This copy of libswiftCore.dylib requires an OS version prior to 10.14.4.

It also seems like cctools is now fixed, so this issue can be closed.

comment:11 Changed 9 months ago by kencu (Ken)

Cc: kencu added

comment:12 Changed 8 months ago by kencu (Ken)

All of the following is on 10.14 as of Feb 9, 2020:

It looks like things are fixed in llvm 8, and 9, which now have much smaller cflags footprints:

$ llvm-config-mp-9.0 --cflags
-I/opt/local/libexec/llvm-9.0/include  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

$ llvm-config-mp-8.0 --cflags
-I/opt/local/libexec/llvm-8.0/include  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

llvm-7.0 has been rebuilt against the command line tools, and the isysroot cflags are correct now:

$ llvm-config-mp-7.0 --cflags
-I/opt/local/libexec/llvm-7.0/include -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -fPIC -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

llvm-6.0 and llvm-5.0 still have faulty isysroots that point into Xcode, and they will need to be rebuilt against the command line tools on the buildbots to pick up the correct isysroots that point into the CLTs:

$ llvm-config-mp-6.0 --cflags
-I/opt/local/libexec/llvm-6.0/include -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fPIC -Werror=date-time -Werror=unguarded-availability-new -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

$ llvm-config-mp-5.0 --cflags
-I/opt/local/libexec/llvm-5.0/include -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fPIC -Werror=date-time -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -DNDEBUG -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

comment:13 Changed 8 months ago by kencu (Ken)

Description: modified (diff)
Port: llvm-6.0 llvm-5.0 added; llvm-7.0 removed

comment:14 Changed 8 months ago by kencu (Ken)

Cc: kencu removed
Owner: changed from jeremyhu to kencu
Port: cctools removed
Summary: cctools @921_3+llvm70: uses incorrect SDK taken from llvm-config-mp-7.0llvm-config uses incorrect SDK taken from xcode rather than command-line tools
Note: See TracTickets for help on using tickets.