-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add simple test of C/C++ hardening flags #270
Conversation
Signed-off-by: David A. Wheeler <[email protected]>
Add a simple test of the C/C++ hardening flags; just run "make" (presuming this is GNU make). |
I should note that the tests currently fail on at my Apple MacOS system: Apple clang version 14.0.3 (clang-1403.0.22.14.1) fails with:
I think clang wants
I think this is a configuration problem on my system. I think gcc is trying to use the Apple MacOS ld command at /usr/bin/ld, which is a hobbled mess, instead of GNU ld. But I suspect other users will see this, so we probably ought to discuss the issue of different loaders (ld) supporting different options. |
@thomasnyman @gkunz - at the very least, I think Do you see any other changes that this test suggests? |
Hi @david-a-wheeler, I really like the idea of adding a test - even though (or just because?) it surfaces some issues with the current set of options. I can confirm your findings on my Mac (and I assume we basically the same version of MacOS 14.1). Moreover, after getting too annoyed by my Mac, I ran the demo on an older Ubuntu 22.04.3 LTS with the following result:
It seems that gcc on Ubuntu has predefined FORTIFY_SOURCE as something else but 3 and therefore it complains about redefining it. One solution is to undefine FORTIFY_SOURCE first and then setting it again.
Other findings? |
That sounds like a good solution. We should propose it and explain why (in a separate PR). Will you write that up @gkunz ? |
@david-a-wheeler yes |
All agreed to adding this simple test, so I'm merging it. The test has revealed some problems - they need to be handled by other PRs. I plan to create a separate PR to turn |
No description provided.