https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87243

Ken Cunningham <ken.cunningham.webuse at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ken.cunningham.webuse@gmail
                   |                            |.com

--- Comment #6 from Ken Cunningham <ken.cunningham.webuse at gmail dot com> ---
I would suggest that, if not using xcrun (which I understand completely), then
some replication of the logic it uses in darwin's driver would make sense.

An knowledgeable person explained this to me regarding how xcrun finds the SDK:

If -isysroot is on the command line, it is used. Otherwise ...
If system headers are installed, they are used (no sysroot is set). Otherwise
...
If xcrun finds a major-version matching SDK in the selected in
/Library/Developer/SDKs, it will use it. Otherwise ...
If xcrun finds a macosx SDK in the selected Xcode.app or in
/Library/Developer/SDKs, it will use it.
xcrun does not explicitly set the command line arguments. It sets the SDKROOT
envvar, which CFE honors as the default isysroot if set.


This was later updated to change the SDK search path to
/Library/Developer/CommandLineTools/SDKs, which is the one that is working now
on 10.14.

The only thing I would add to that would be that it would probably be quite
desirable to have ${SDKROOT} respected if it has been set by the user, so a
specific SDK can be forced globally.

The way the CFE then uses the ${SDKROOT} internally is here:

https://clang.llvm.org/doxygen/Darwin_8cpp_source.html

Reply via email to