diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2021-01-08 06:03:08 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2021-01-08 06:10:24 +0100 |
commit | 76b45d5fd7eb99f612cf9c10a7617de4019f6cd5 (patch) | |
tree | 90b34cac3cc26f7d5f5fdc30b4a5fb586a43cca2 /.gitattributes | |
parent | 86a8b35f321d55bb2381ea56bcc1cdd17c7896e6 (diff) | |
parent | 196b7276495c5d125e3799aee6cfc54be6720ec7 (diff) |
Merge #19683: depends: Pin clang search paths for darwin host
196b7276495c5d125e3799aee6cfc54be6720ec7 depends: Add comment about cache invalidation (Carl Dong)
949c480e527532be58d6184deb313d91339efdbf depends: Fully determine path for darwin cctools (Carl Dong)
880660acfa547558f6ef5adff6768de95e53af6e depends: Fully determine path for darwin_{CC,CXX} (Carl Dong)
80331107416b8a6cb487ee1c89a39c6a8bced27b depends: Quote to prevent word splitting in config.site (Carl Dong)
77b1ef89a07bf7a493ce4abaccbbff793cbde9be depends: Remove -fuse-ld line (Carl Dong)
300733921863c176535806c40afdc813b99e7459 depends: Pin clang search paths for darwin host (Carl Dong)
107f33d434ebbe6f93fa187e2af1f6f850e82d3b 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:
https://github.com/bitcoin/bitcoin/blob/8b8296dc70a0aa5ca86d11ba5d3151fc56208e25/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 ACK 196b7276495c5d125e3799aee6cfc54be6720ec7
Tree-SHA512: 406442df16d9aa0aef62f9fa94f72d7e48374301f3d826bf32f183e1610942aa44a4adfac7bead1f14aded0044fac400e1328fcd933b2337e55a024f034b5013
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions