-
Notifications
You must be signed in to change notification settings - Fork 922
Enable FORTIFY_SOURCE=3 when supported by the compiler #12381
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
Barely tested, we should at least measure the performance impact and ponder making that optional.
thanks! When testing it I noticed that gcc (unlike clang) does not result in gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0 (fails)config.log:
Ubuntu clang version 15.0.2-1config.log:
|
It works for me with GCC 12.2.0 on Arch. It requires glibc >= 2.34, but Ubuntu 22.10 is supposed to have 2.36, so I don't know. |
Oh, you have |
The option defaults to 2 to keep the existing behaviour, but 3 and auto are supported, with auto trying to select the highest version supported by the compiler.
I just pushed a commit adding an |
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.
This is behaving strangely for me. Using the first commit only, and the latest clang and gcc on Archlinux I get:
checking whether C++ compiler handles -D_FORTIFY_SOURCE=3... no
checking whether C++ compiler handles -D_FORTIFY_SOURCE=2... no
Additionally, with the second commit (which adds --enable-fortify-source
) I get the following when I don't pass --enable-fortify-source
:
checking whether FORTIFY_SOURCE is supported... checking whether C++ compiler handles -D_FORTIFY_SOURCE=2... no
checking whether C++ compiler handles -D_FORTIFY_SOURCE=1... no
no
- The output is garbled.
- It still says that none of the levels are supported.
- It sometimes can't find either
libcrypto
orlibdecaf
headers anymore, varies between runs:
checking whether compiling and linking against OpenSSL's libcrypto works... no
configure: error: OpenSSL/libcrypto not found
checking for decaf.hxx... no
configure: error: cannot find libdecaf headers
Although those work fine with the first commit. I can't tell what the second commit introduces that might break this. It happens whether I pass --enable-fortify-source
or not.
I pushed a commit fixing the interleaving during the detection of As for the rest, I don't get it :-/
And in all cases I get:
|
My issues were caused by the fact that This output is still interleaved though:
|
Ah, right. We could change the optimization when we check if the compiler supports this feature, but that doesn't feel right since it will not work in the end anyway.
Weird, it really shouldn't be with the latest commit. |
Argh. Sorry. I fetched and forgot to rebase. It works fine now. Thank you! |
Short description
Barely tested, we should at least measure the performance impact and ponder making that optional.
Checklist
I have: