From 75e62709f161d4f5f2bc1202bb7e4e906b4aaa91 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Thu, 30 Apr 2026 15:00:14 +0900 Subject: Do not override user CFLAGS/LDFLAGS in hardening flag detection `CHECK_CFLAG` / `CHECK_LDFLAG` overwrote `CFLAGS`/`LDFLAGS` with only the flag under test, so feature detection ran with a different target than the real build. For example `CFLAGS=-march=i586 ./configure` accepted `-fcf-protection=full` (detected under the toolchain's i686 default) but then failed to compile because GCC 15 rejects `-fcf-protection` on i586. Prepend `$USER_CFLAGS` / `$USER_LDFLAGS` (saved before `AC_PROG_CC`) to the detection command so the probe matches the real build. Fixes #1268 --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index eb2b9ce..c0ad033 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # This must be saved before AC_PROG_CC USER_CFLAGS="$CFLAGS" +USER_LDFLAGS="$LDFLAGS" AC_PROG_CC([cc gcc]) AM_PROG_CC_C_O -- cgit v1.2.3-55-g6feb