Search Portage & Overlays:

Hardened profiles improvements - 01/01/2023 00:00 GMT

Gentoo's hardened profiles are adopting two new modern toolchain hardening
1. Level 3 fortification (-D_FORTIFY_SOURCE=3) [0]
2. libstdc++ assertions (-D_GLIBCXX_ASSERTIONS) [1]

These will both be enabled by default with USE=hardened on sys-devel/gcc
for >=sys-devel/gcc-12.2.1_p20221231.

To view the existing list of hardening changes applied by the profiles,
see the wiki [2].

Stable users may wish to add sys-devel/gcc-12.2.1_p20221231 into
/etc/portage/package.accept_keywords if they wish to take advantage
of these improvements early, before GCC 12 is marked stable.

## Migration

To fully take advantage of these new settings, GCC must first
be upgraded, and then all packages must be re-emerged:
1. # emerge --sync
2. # emerge --verbose --oneshot ">=sys-devel/gcc-12.2.1_p20221231"
3. # gcc-config latest
4. # emerge --verbose --emptytree @world

## Troubleshooting

In the event that some packages fail at runtime, please file a bug
with the full details. To temporarily workaround the problem,
it should be possible to recompile broken packages with the
following *FLAGS:


Posted By: Sam James