Merge #19683: depends: Pin clang search paths for darwin host
pull/826/head196b727649
depends: Add comment about cache invalidation (Carl Dong)949c480e52
depends: Fully determine path for darwin cctools (Carl Dong)880660acfa
depends: Fully determine path for darwin_{CC,CXX} (Carl Dong)8033110741
depends: Quote to prevent word splitting in config.site (Carl Dong)77b1ef89a0
depends: Remove -fuse-ld line (Carl Dong)3007339218
depends: Pin clang search paths for darwin host (Carl Dong)107f33d434
depends: Delay expansion of per-package vars (Carl Dong) Pull request description: > 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: 1. Unset environment variables which are known to alter search paths. 1. 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](https://gist.github.com/dongcarl/5cdc6990b7599e8a5bf6d2a9c70e82f9). See the added comments in `depends/hosts/darwin.mk` for more details:8b8296dc70/depends/hosts/darwin.mk (L37-L60)
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](https://www.gnu.org/software/coreutils/manual/html_node/env-invocation.html), [busybox](https://busybox.net/downloads/BusyBox.html#env), [FreeBSD](https://www.freebsd.org/cgi/man.cgi?env). ACKs for top commit: laanwj: code review ACK196b727649
Tree-SHA512: 406442df16d9aa0aef62f9fa94f72d7e48374301f3d826bf32f183e1610942aa44a4adfac7bead1f14aded0044fac400e1328fcd933b2337e55a024f034b5013
commit
76b45d5fd7
Loading…
Reference in new issue