]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Build: Use only the generic symbol versioning with NVIDIA HPC Compiler.
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 15 Mar 2024 15:15:50 +0000 (17:15 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 21 May 2024 21:34:26 +0000 (00:34 +0300)
This does the previous commit with CMake.

AC_EGREP_CPP uses AC_REQUIRE so the outermost if-commands must
be changed to AS_IF to ensure that things wont break some day.
See 5a5bd7f871818029d5ccbe189f087f591258c294.

(cherry picked from commit 49324b711f9d42b3543bf2f3ae598eaa03360bd5)
(cherry picked from commit b03139b1d210865526ab0e945aa79b2627f8c202)

configure.ac

index f55d342ab5d240afef5b22807aabfcf6dc2da274..0ea42f721ce716d9345ff0f33d029de96fa57b0f 100644 (file)
@@ -660,13 +660,13 @@ fi
 # --with-pic and --without-pic though. As long as neither --with-pic nor
 # --without-pic is used then we can use #ifdef PIC to detect if the file is
 # being built for a shared library.
-if test "x$enable_symbol_versions" = xno ; then
+AS_IF([test "x$enable_symbol_versions" = xno], [
        enable_symbol_versions=no
        AC_MSG_RESULT([no])
-elif test "x$enable_shared" = xno ; then
+], [test "x$enable_shared" = xno], [
        enable_symbol_versions=no
        AC_MSG_RESULT([no (not building a shared library)])
-else
+], [
        # "yes" means that symbol version are to be used but we need to
        # autodetect which variant to use.
        if test "x$enable_symbol_versions" = xyes ; then
@@ -681,7 +681,15 @@ else
                                enable_symbol_versions=generic
                                ;;
                        *-linux*)
-                               enable_symbol_versions=linux
+                               # NVIDIA HPC Compiler doesn't support symbol
+                               # versioning but the linker script can still
+                               # be used.
+                               AC_EGREP_CPP([use_generic_symbol_versioning],
+                                       [#ifdef __NVCOMPILER
+                                       use_generic_symbol_versioning
+                                       #endif],
+                                       [enable_symbol_versions=generic],
+                                       [enable_symbol_versions=linux])
                                ;;
                        *)
                                enable_symbol_versions=generic
@@ -725,7 +733,7 @@ else
                AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
        fi
        AC_MSG_RESULT([yes ($enable_symbol_versions)])
-fi
+])
 
 AM_CONDITIONAL([COND_SYMVERS_LINUX],
        [test "x$enable_symbol_versions" = xlinux])