Skip to content
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 compiler flags which could be interesting in terms of software security #956

Open
piponazo opened this issue Jul 12, 2019 · 4 comments
Assignees
Labels
CMake Configuration issues related with CMake compilers Related with compiler options, definitions, support, etc.
Milestone

Comments

@piponazo
Copy link
Collaborator

Take ideas from here:

https://git.libssh.org/projects/libssh.git/tree/CompilerChecks.cmake

@piponazo piponazo added the CMake Configuration issues related with CMake label Jul 12, 2019
@piponazo piponazo self-assigned this Jul 12, 2019
@piponazo piponazo added the compilers Related with compiler options, definitions, support, etc. label Jul 12, 2019
@D4N
Copy link
Member

D4N commented Jul 12, 2019

We essentially want to add this:

$ rpm --eval %{optflags}
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection

wherever supported (the annobin stuff is afaik only supported on RHEL/CentOS & Fedora)

@1div0
Copy link
Collaborator

1div0 commented Jul 12, 2019

Also, for better performance LTO use would be nice to have.

@D4N
Copy link
Member

D4N commented Jul 12, 2019 via email

@clanmills
Copy link
Collaborator

This sounds important, although I don't understand it. I'll mark this for attention in v1.00.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake Configuration issues related with CMake compilers Related with compiler options, definitions, support, etc.
Projects
None yet
Development

No branches or pull requests

5 participants