From ac14ce8c79ebb8a2a882a5b483fa59476392b036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 5 Feb 2021 11:19:48 +0100 Subject: [PATCH] configure: Silence a linker warning about no-PIC .text relocations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- configure | 28 +++++++++++++++++++++++++++- configure.ac | 4 +++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 3f17db20fd6..8d782ad0353 100755 --- a/configure +++ b/configure @@ -9274,7 +9274,33 @@ fi case $host_cpu in *i[3456789]86*) DLLFLAGS="$DLLFLAGS -fno-PIC" - LDDLLFLAGS="-fno-PIC" ;; + LDDLLFLAGS="-fno-PIC" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-PIC -Wl,-z,notext" >&5 +$as_echo_n "checking whether the compiler supports -fno-PIC -Wl,-z,notext... " >&6; } +if ${ac_cv_cflags__fno_PIC__Wl__z_notext+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -fno-PIC -Wl,-z,notext" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(int argc, char **argv) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_cflags__fno_PIC__Wl__z_notext=yes +else + ac_cv_cflags__fno_PIC__Wl__z_notext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fno_PIC__Wl__z_notext" >&5 +$as_echo "$ac_cv_cflags__fno_PIC__Wl__z_notext" >&6; } +if test "x$ac_cv_cflags__fno_PIC__Wl__z_notext" = xyes; then : + LDDLLFLAGS="$LDDLLFLAGS -Wl,-z,notext" +fi + ;; *) DLLFLAGS="$DLLFLAGS -fPIC" LDDLLFLAGS="-fPIC" ;; diff --git a/configure.ac b/configure.ac index 19db4f60b28..9d8f831e0fc 100644 --- a/configure.ac +++ b/configure.ac @@ -912,7 +912,9 @@ case $host_os in case $host_cpu in *i[[3456789]]86*) DLLFLAGS="$DLLFLAGS -fno-PIC" - LDDLLFLAGS="-fno-PIC" ;; + LDDLLFLAGS="-fno-PIC" + WINE_TRY_CFLAGS([-fno-PIC -Wl,-z,notext],[LDDLLFLAGS="$LDDLLFLAGS -Wl,-z,notext"]) + ;; *) DLLFLAGS="$DLLFLAGS -fPIC" LDDLLFLAGS="-fPIC" ;;