Xcode is using a -Xlinker flag that libtool doesn't understand
I have a target that contains Objective-C source files and builds a static library for iOS. It works fine. I just tried adding a single Swift file to it, and now it fails to build, with a strange link-time error: libtool: unknown option character `X' in: -Xlinker which sounds like Xcode is using a command-line flag that libtool doesn’t understand. A bug in Xcode, maybe? (I’m using the latest beta of 6.3: 6D554n.) If I remove the .swift file from the target, it builds file. Re-add it, I get the error. I’ve checked the target build settings and there’s no custom “-Xlinker” flag defined, so this must be something Xcode came up with on its own. Here’s the entire command line generated by Xcode, and the entire error message: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Couchbase/Seekrit/build/Seekrit/Build/Products/Debug-iphonesimulator -filelist /Couchbase/Seekrit/build/Seekrit/Build/Intermediates/Seekrit.build/Debug-iphonesimulator/SeekritIOS.build/Objects-normal/x86_64/SeekritIOS.LinkFileList -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Couchbase/Seekrit/build/Seekrit/Build/Intermediates/Seekrit.build/Debug-iphonesimulator/SeekritIOS.build/Objects-normal/x86_64/SeekritIOS.swiftmodule -o /Couchbase/Seekrit/build/Seekrit/Build/Products/Debug-iphonesimulator/libSeekritIOS.a error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker ___ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (Xcode-users@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Xcode is using a -Xlinker flag that libtool doesn't understand
Oops, I should have googled first. I found a discussion of this error from last June (right after the first Swift release): https://github.com/CocoaPods/CocoaPods/issues/2226 https://github.com/CocoaPods/CocoaPods/issues/2226 wherein someone quoted from the Xcode 6.0b2 release notes: It is not possible to build static libraries which contain Swift code in this release. (17181019)” Oops. Apparently this hasn’t been fixed yet? Good to know, since the main project I work on is primarily built as a static library :-p —Jens ___ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (Xcode-users@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Xcode is using a -Xlinker flag that libtool doesn't understand
On 30 Mar 2015, at 08:19, Jens Alfke j...@mooseyard.com wrote: Oops, I should have googled first. I found a discussion of this error from last June (right after the first Swift release): https://github.com/CocoaPods/CocoaPods/issues/2226 https://github.com/CocoaPods/CocoaPods/issues/2226 wherein someone quoted from the Xcode 6.0b2 release notes: It is not possible to build static libraries which contain Swift code in this release. (17181019)” Oops. Apparently this hasn’t been fixed yet? Good to know, since the main project I work on is primarily built as a static library :-p —Jens ___ Not fixed as far as I know, seem to recall seeing someone ask about it in the last couple of weeks on the devforums. Since we now have frameworks on iOS and OSX and swift seems very framework-y, I don’t know if or when that will ever be fixed. ___ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (Xcode-users@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com This email sent to arch...@mail-archive.com