Topic: Compilation flags
There are several patches for gcc-4.2.x in attachment.
These patches based on patches from HLFS project, but I've done some differences ![]()
I did not find any documentation about used flags except -fstack-protector{,-all}. Therefore I propose to use also -fPIC in compilation. Sure, it would be better to differ -fPIC and -fPIE, since the last are more suitable for executables. It allow more optimization in -O3, but -O3 I think is very aggressive for hardened distro it may cause some memory leaks with -O3 and SSP. Therefore I think that it'll be better to use "-O2 -fPIC -fstack-protector-all" combination ![]()
We can use -z now ldflag for preloading(explicit run-time linking). It't faster ![]()
If we'll use -fPIC for all, we must use -z pic for linking also. And -z noexecstack -- it's powerful thing
Finally, so we can prevent code execution in stack.
Dmitry.
