Module: wine
Branch: master
Commit: 2c7524021ec862eba304c788274d6b49b7c1aca9
URL: https://gitlab.winehq.org/wine/wine/-/commit/2c7524021ec862eba304c788274d6b…
Author: Martin Storsjö <martin(a)martin.st>
Date: Wed Oct 4 15:03:21 2023 +0300
configure: Fix restoring CFLAGS after the test for -Wl,-z,defs.
This fixes a regression from 450c358881dbc6dcfb2692b8f4debb7db8fdc54b;
after testing for -Wl,-z,defs, CFLAGS was restored from an
incorrect variable, leaving CFLAGS essentially empty.
This would break builds for e.g. arm with Clang, where -mthumb would
be essential for being able to build some inline assembly snippets
correctly.
This also had the effect of dropping the default "-g -O2" arguments
from CFLAGS.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
---
configure | 2 +-
configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index cbcc88d6626..a8139a60b10 100755
--- a/configure
+++ b/configure
@@ -10123,7 +10123,7 @@ else $as_nop
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$ac_save_cflags
+ CFLAGS=$ac_save_CFLAGS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wl_z_defs" >&5
printf "%s\n" "$ac_cv_wl_z_defs" >&6; }
diff --git a/configure.ac b/configure.ac
index d288c544dfd..4803b7abea4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -771,7 +771,7 @@ case $host_os in
dnl On FreeBSD, shared libraries using environ fail to link with -Wl,-z,defs
AC_LINK_IFELSE([AC_LANG_SOURCE([[extern char **environ; char **envp; void myfunc(void) { envp = environ; }]])],
[ac_cv_wl_z_defs=yes],[ac_cv_wl_z_defs=no])
- CFLAGS=$ac_save_cflags])
+ CFLAGS=$ac_save_CFLAGS])
test $ac_cv_wl_z_defs != yes || AS_VAR_APPEND([UNIXLDFLAGS],[" -Wl,-z,defs"])
WINE_TRY_CFLAGS([-Wl,--export-dynamic],[WINELOADER_LDFLAGS="-Wl,--export-dynamic"])