View previous topic :: View next topic |
Author |
Message |
Shadow_Fury Apprentice
Joined: 20 Apr 2021 Posts: 196 Location: 11.435765792823453, 143.05926743686274
|
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2112
|
Posted: Thu May 26, 2022 12:51 am Post subject: |
|
|
Good question!
Most interesting things are set by default on the hardened profile. I've recently added and improved a table on the wiki to explain what is set already.
What you can do yourself:
- Try -D_GLIBCXX_ASSERTIONS in CXXFLAGS (we're likely to add this to hardened profile soon)
- Possibly try -D_FORTIFY_SOURCE=3 with GCC 12 (this is very early days and experimental, see bug 847148; this one is further out but will be added eventually to the hardened profile)
- If you have a CET-capable CPU, enable USE=cet and USE=hardened on gcc, glibc, and binutils.
- Check build logs for implicit function declarations and file bugs (upstream too!). Fixes are usually easy.
As for some of the things on the pages you linked:
- -fvtable-verify=* (rejected for Gentoo, see bug 544980). I'm not aware of any distros turning this on. You could just try it.
- -ftrapv (described as broken by GCC)
- -mmitigate-rop -mindirect-branch=thunk -mfunction-return=thunk. Feel free to set these.
I don't think any of the other stuff mentioned is useful, it's already set by default. Some stuff like -fexceptions might be worth trying. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|