Fix test for .symver asm directive support in configure

We need to use it with the correct, i.e. existing, symbol name, which
means the mangled name actually used by the linker and not just the name
of the function as it appears in the source.

Fix the test to actually detect lack of support for .symver when using
clang with -flto.

Closes #25438.
This commit is contained in:
Vadim Zeitlin
2025-05-25 17:10:39 +02:00
parent 6269297ab2
commit f2b844307d
3 changed files with 45 additions and 8 deletions
Vendored
+33 -5
View File
@@ -33873,18 +33873,26 @@ if ${wx_cv_elf_symver_multiple+:} false; then :
else
echo "lib_new {}; lib_old { *; };" >conftest.sym
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "wx/private/elfversion.h"
wxELF_SYMVER("foo","foo@lib_old")
wxELF_SYMVER("foo","foo@@lib_new")
extern "C" {
wxELF_SYMVER("_foo","_foo@lib_old")
wxELF_SYMVER("_foo","_foo@@lib_new")
void foo() {}
}
int main() { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
if ac_fn_cxx_try_link "$LINENO"; then :
wx_cv_elf_symver_multiple=yes
else
wx_cv_elf_symver_multiple=no
@@ -33892,6 +33900,12 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
rm -f conftest.sym
@@ -33909,17 +33923,25 @@ if ${wx_cv_elf_symver+:} false; then :
else
echo "lib_new {}; lib_old { *; };" >conftest.sym
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "wx/private/elfversion.h"
wxELF_SYMVER("foo","foo@@lib_new")
extern "C" {
wxELF_SYMVER("_foo","_foo@@lib_new")
void foo() {}
}
int main() { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
if ac_fn_cxx_try_link "$LINENO"; then :
wx_cv_elf_symver=yes
else
wx_cv_elf_symver=no
@@ -33927,6 +33949,12 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
rm -f conftest.sym
+11 -3
View File
@@ -4025,17 +4025,21 @@ if test "$wxUSE_SHARED" = "yes"; then
wx_cv_elf_symver_multiple,
[
echo "lib_new {}; lib_old { *; };" >conftest.sym
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([
AC_LANG_SOURCE([
#include "wx/private/elfversion.h"
wxELF_SYMVER("foo","foo@lib_old")
wxELF_SYMVER("foo","foo@@lib_new")
extern "C" {
wxELF_SYMVER("_foo","_foo@lib_old")
wxELF_SYMVER("_foo","_foo@@lib_new")
void foo() {}
}
int main() { return 0; }
])],
wx_cv_elf_symver_multiple=yes,
wx_cv_elf_symver_multiple=no
)
AC_LANG_POP()
rm -f conftest.sym
]
)
@@ -4047,16 +4051,20 @@ if test "$wxUSE_SHARED" = "yes"; then
wx_cv_elf_symver,
[
echo "lib_new {}; lib_old { *; };" >conftest.sym
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([
AC_LANG_SOURCE([
#include "wx/private/elfversion.h"
wxELF_SYMVER("foo","foo@@lib_new")
extern "C" {
wxELF_SYMVER("_foo","_foo@@lib_new")
void foo() {}
}
int main() { return 0; }
])],
wx_cv_elf_symver=yes,
wx_cv_elf_symver=no
)
AC_LANG_POP()
rm -f conftest.sym
]
)
+1
View File
@@ -255,6 +255,7 @@ Changes in behaviour which may result in build errors
All (Unix):
- Fix configure build with --with-flavour option broken in 3.2.8 (#25436).
- Fix configure build with clang and LTO broken in 3.2.8 (#25438).
wxGTK: