https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79885
--- Comment #13 from Jeremy Huddleston Sequoia <jeremyhu at macports dot org> --- 1. clang honors $SDKROOT from the environment if it is not passed via -isysroot on the command line. That's all gcc needs to do, and then users running 'xcrun gcc' would ge this behavior automatically. 2. xcrun is not OSS, but the primary functionality that you asked for was provided in libxcselect in macOS 10.15, so you wouldn't need to exec xcrun to find the path to the SDK. 3. I cannot decipher your comment "when clang is using a "different" SDK to target a version of MacOS, it is using the runtimes provided by the target MacOS version." ... that doesn't quite make sense, so please be a bit more specific about which runtime you are referring to (the compiler runtime, the OS runtime)... either way I try to interpret it, it makes no sense, so I'm not sure how to address this comment, sorry. 4. macOS deprecates APIs but will almost never remove them (unless we change architectures ... such as when we removed a bunch of deprecated API when moving from ppc to intel). Internal / private SPI is subject to removal, but we aim to never remove API as that breaks binary compatibility.