From f1c5f2af4730233aafc1369207d237bebda9be96 Mon Sep 17 00:00:00 2001 From: Winter M Date: Tue, 24 Feb 2026 14:20:55 -0500 Subject: [PATCH] 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 --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3bf5db0af..e4b91a33e 100644 --- a/configure.ac +++ b/configure.ac @@ -323,7 +323,14 @@ AS_IF([test x"$enable_hardening" != x"no"], [ AX_ADD_FORTIFY_SOURCE add_hardened_c_flag([-fPIC]) - add_hardened_ld_flag([[-shared]]) + + AC_ARG_ENABLE([shared], + AS_HELP_STRING([--disable-shared], [don't build shared libraries]),, + [enable_shared="yes"] + ) + AS_IF([test x"$enable_shared" != x"no"], [ + add_hardened_ld_flag([[-shared]]) + ]) add_hardened_c_flag([-fPIE]) add_hardened_ld_flag([[-pie]])