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@martin.st>
This commit is contained in:
Martin Storsjö 2023-10-04 15:03:21 +03:00 committed by Alexandre Julliard
parent 16217163d9
commit 2c7524021e
2 changed files with 2 additions and 2 deletions

2
configure vendored
View file

@ -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; }

View file

@ -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"])