Skip to content

Commit f1c5f2a

Browse files
committed
configure.ac: support static toolchains when compiling with hardening
It's not clear to me why `-shared` was added to the hardening flags in the first place, but unconditionally adding it breaks compilation with hardening enabled (the default). Signed-off-by: Winter M <winter@antithesis.com>
1 parent 29e23a6 commit f1c5f2a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

configure.ac

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,14 @@ AS_IF([test x"$enable_hardening" != x"no"], [
323323
AX_ADD_FORTIFY_SOURCE
324324
325325
add_hardened_c_flag([-fPIC])
326-
add_hardened_ld_flag([[-shared]])
326+
327+
AC_ARG_ENABLE([shared],
328+
AS_HELP_STRING([--disable-shared], [don't build shared libraries]),,
329+
[enable_shared="yes"]
330+
)
331+
AS_IF([test x"$enable_shared" != x"no"], [
332+
add_hardened_ld_flag([[-shared]])
333+
])
327334
328335
add_hardened_c_flag([-fPIE])
329336
add_hardened_ld_flag([[-pie]])

0 commit comments

Comments
 (0)