Source/WebCore/DerivedSources.make invokes CC with -isysroot $(SDKROOT), which won't work if you use an SDK identifier instead of an absolute path. Where necessary, we should use xcrun to find the absolute path to the SDK. This works for either: xcrun --sdk <SDK identifier> --show-sdk-path xcrun --sdk /Full/Path/To/The/SDK --show-sdkpath Both return /Full/Path/To/The/SDK.
I'm a little bit surprised that Xcode isn't expanding SDKROOT out to the path to the SDK.
(In reply to comment #1) > I'm a little bit surprised that Xcode isn't expanding SDKROOT out to the path to the SDK. Is it clang that doesn't know what to do with "-isysroot <SDK identifier>"?
(In reply to comment #2) > (In reply to comment #1) > > I'm a little bit surprised that Xcode isn't expanding SDKROOT out to the path to the SDK. Actually, it turns out that it does expand it, but we have a derived sources shell script phase and it isn't passing SDKROOT=${SDKROOT} to the make invocation, so maybe adding that is all we need. > > Is it clang that doesn't know what to do with "-isysroot <SDK identifier>"? Yeah, it looks that it has to be an absolute path because it prepends it to other path options.
Created attachment 187371 [details] Patch Yep, looks like we just need to pass SDKROOT to the make invocation for Derived Sources. Confirmed this on all platforms.
Comment on attachment 187371 [details] Patch That's a little surprising. Where is make currently getting the value of SDKROOT from if not the environment?
(In reply to comment #5) > (From update of attachment 187371 [details]) > That's a little surprising. Where is make currently getting the value of SDKROOT from if not the environment? I think it is getting it from the environment fine but when Xcode expands it it doesn't update the environment when calling out to shell scripts in build phases. That would seem to match the behavior I was seeing, where building with SDKROOT=my.sdk is passed through to the environment in `make -f DerivedSources.make`.
Comment on attachment 187371 [details] Patch Clearing flags on attachment: 187371 Committed r142546: <http://trac.webkit.org/changeset/142546>
All reviewed patches have been landed. Closing bug.