Hello clang/lib/frontend, I search your headers once again. Because it's time for some housekeeping, Within the code I was tweaking, And the targets I was making with my build, Are unfulfilled, It's just language compliance.
In reference works I scroll alone Pages cribbed from holy tomes In the details of a template My code's behaviour has now found its fate When my hopes were dashed as a note left it as described: As undefined It's not in compliance
And from the standard text I saw Ten thousand errors, maybe more Threading used without locking Pointers referenced after freeing Linters writing warnings that coders will never fix But still they tick The box that claims compliance
"Fools," said I, "you do not know" Errors, like a cancer, grow Hear my words that I might reach you Use -Wall and it might teach you But my words and compiler errors fade. Schedules forbade compliance.
And the people bowed and prayed With static checking torn and frayed The markets flashed out their warning In the words that they were forming As recruiters said "The search for more profits leads to writing stuff in CSS, And node.js. Without a need for compliance"
Many thanks to ajtowns for the above contribution!
This PR is ready for review!
When cross-compiling for macOS, the SDK gives us the entire context/sysroot on which we should base the build. This means that we can be extremely specific w/re our search path ordering in order to avoid build problems that arise out of a user's specific environment/system setup and improve the robustness of our macOS toolchain. This PR does 2 things to this end:
Unset environment variables which are known to alter search paths.
Makes us (in the case of macOS builds) explicitly specify the list of system include search paths and its ordering, rather than rely on
clang's unreliable autodetection routine. Here is the rabbit-hole gist.See the added comments in
depends/hosts/darwin.mkfor more details:
We can be this specific only because macOS builds are neatly contained in an SDK, and we are cross-compiling. Native toolchains should rely on the environment/distro/user to know how best to build for the running system.
Note: Although the -u flag of env is not a POSIX standard flag, it seems like it is useful enough to be implemented in coreutils, busybox, FreeBSD.