Do not use -fPIE when building SO with hardening, it breaks __thread in contribs
@@ -732,7 +732,10 @@ module _BASE_UNIT {
when ($HARDENING == "yes") {
when ($CLANG) {
- CFLAGS+=-fstack-protector-all -fPIE -D_hardening_enabled_
+ CFLAGS+=-fstack-protector-all -D_hardening_enabled_
+ when (!$PIC) {
+ CFLAGS+=-fPIE
+ }
LDFLAGS+=-z relro -z now -z noexecstack -pie
}
}
