From: Guillem Jover Date: Sun, 12 Feb 2023 22:55:09 +0000 (+0100) Subject: build: Fix version script linker support detection X-Git-Tag: 0.11.8~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dec783dce5a7131e232a06e63a544645b5463dd8;p=thirdparty%2Flibbsd.git build: Fix version script linker support detection When the linker uses --no-undefined-version either specified by the user or as the default behavior (such as with newer clang >= 16 releases), a missing symbol definition will cause a linker error if that symbol is listed in the version script. --- diff --git a/configure.ac b/configure.ac index 875ff04..4faddd0 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,11 @@ AC_CACHE_CHECK([if ld supports --version-script flag], save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" AC_LINK_IFELSE([ - AC_LANG_PROGRAM([], []) + AC_LANG_PROGRAM([[ +extern int symbol(void); +int symbol(void) { return 0; } +]], [[ +]]) ], [ libbsd_cv_version_script=yes ], [