https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79885
Jack Howarth <howarth.at.gcc at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |howarth.at.gcc at gmail dot com --- Comment #11 from Jack Howarth <howarth.at.gcc at gmail dot com> --- Just a reminder that clang solves finding the position of the SDK via xcrun and SDKROOT. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87243 The compiler stub programs that users run execute the real clang compilers by calling them via the xcrun program which sets the SDKROOT, among other environmental variables, for the clang compiler to use. ENVIRONMENT CPATH This environment variable is modified by xcrun to include /usr/local/include when an explicit SDK is not requested via envi- ronment variable nor command line argument and neither -nostdinc nor -nostdsysteminc are present. DEVELOPER_DIR Overrides the active developer directory. When DEVELOPER_DIR is set, its value will be used instead of the system-wide active developer directory. LIBRARY_PATH This environment variable is modified by xcrun to include /usr/local/lib when an explicit SDK is not requested via environment variable nor command line argument and -Z is not being passed to the linker. SDKROOT Specifies the default SDK to be used when looking up tools (some tools may have SDK specific versions). This environment variable is also set by xcrun to be the absolute path to the user provided SDK (either via SDKROOT or the --sdk option), when it is used to invoke a normal developer tool (build tools like xcodebuild or make are exempt from this behavior). For example, if xcrun is used to invoke clang via: xcrun --sdk macosx clang test.c then xcrun will provide the full path to the macosx SDK in the envi- ronment variable SDKROOT. That in turn will be used by clang(1) to automatically select that SDK when compiling the test.c file. TOOLCHAINS Specifies the default toolchain to be used when looking up tools (for tools which are toolchain specific).