glibc: allow to build position-independent static executable

This enables ALSR on static executables, which makes them harder to
exploit by providing a crt suitable for static PIEs.

Does this break existing binaries? Likely not. Static-pie is only
used if explicitly enabled.
This commit is contained in:
Jörg Thalheim 2021-05-22 10:01:09 +02:00
parent 3ce66c03b3
commit 61c74e1aee
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4

View file

@ -153,6 +153,8 @@ stdenv.mkDerivation ({
"--enable-add-ons"
"--sysconfdir=/etc"
"--enable-stackguard-randomization"
"--enable-static-pie"
"--enable-bind-now"
(lib.withFeatureAs withLinuxHeaders "headers" "${linuxHeaders}/include")
(lib.enableFeature profilingLibraries "profile")
] ++ lib.optionals withLinuxHeaders [