From: Yao Zi <zi...@di...> - 2025-05-17 10:53:12
|
"-no-pie" is forwarded to the linker by compiler driver, instructing the linker not to produce a relocatable executable file. The flag has no effect when doing only compilation, where newer Clang considers it as unused arguments and warns about it. Such warnings are promoted as errors since we supply "-Werror" flag as well, causing configure.ac misdetects the availablity of "-no-pie" flag and failing building of test cases that cannot be compiled as PIE. Let's link the test program as well when checking compiler features to avoid such misdetection. Fixes: 84ad3a82c247 ("Fix compilation problems with some unit tests on Ubuntu 16.10+. Compiler produces position independent executables (PIE) by default which gets in the way of some unit tests. Fixes BZ#377066.") Signed-off-by: Yao Zi <zi...@di...> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index caa79c0147cb..fdf510be4f4a 100755 --- a/configure.ac +++ b/configure.ac @@ -3000,7 +3000,7 @@ AC_MSG_CHECKING([if gcc accepts -no-pie]) safe_CFLAGS=$CFLAGS CFLAGS="-no-pie -Werror" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ return 0; ]])], [ AC_SUBST([FLAG_NO_PIE], ["-no-pie"]) -- 2.49.0 |