-
-
Notifications
You must be signed in to change notification settings - Fork 18k
cc-wrapper: add support for libcxxhardeningfast & libcxxhardeningextensive hardening flags
#442945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8de8347 to
2b6ab40
Compare
2b6ab40 to
4d10181
Compare
4d10181 to
825000a
Compare
philiptaron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm running the tests. Couple of comments, nothing blocking.
|
|
Four PIE tests (see the nixpkgs-review) fail. The logs are there. Could you take a look? |
|
I suspect those broke when pie got enabled at the toolchain level. Anyway, looks like you've just merged the pie flag's removal ;) |
e58826f to
b20ee00
Compare
Yes, it's those failures that made me look more information... and voila, they disappear in a poof of excellence. |
philiptaron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more removal from the release notes then I move to merge.
…lags as with glibcxxassertions, we don't yet have a nice mechanism for deferring support decisions to the c++ library in use, so for now at least enabling this hardening flag will cause _LIBCPP_HARDENING_MODE to be defined on all compilers
ld built with this fails to link glib's gio on x86_64 darwin
b20ee00 to
422942c
Compare
The libcxxhardeningfast and libcxxhardeingextensive hardening flags introduced by NixOS#442945 add _LIBCPP_HARDENING_MODE definitions to compiler invocations, but zig already sets it automatically. This causes macro re-definition warnings (or errors if -Werror is enabled) when compiling C++ projects with zigStdenv.
See https://libcxx.llvm.org/Hardening.html
These two flags are mutually exclusive in the same way
fortify/fortify3andstrictflexarrays1/strictflexarrays3are.As with
glibcxxassertions(#414987), we don't yet have a nice mechanism for deferring support decisions to the c++ library in use, so for now at least enabling this hardening flag will cause_LIBCPP_HARDENING_MODEto be defined on all compilers.Not yet finished: release notes and docs entries, but this is ready for review in its current state.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.