]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
CMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 15 Mar 2024 14:36:35 +0000 (16:36 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 21 May 2024 21:34:26 +0000 (00:34 +0300)
It doesn't support the __symver__ attribute or __asm__(".symver ...").
The generic symbol versioning can still be used since it only needs
linker support.

(cherry picked from commit c273123ed0ebaebf49994057a7fe98aae7f42c40)
(cherry picked from commit 08754772e801218e5e06dc06e51c9e712ddf3e49)

CMakeLists.txt

index 8944de9e209f749c376544639d4eb978761fb04e..b2bde39b9071a47f0ea6a1b3fd805071ff625e6e 100644 (file)
@@ -256,7 +256,8 @@ if(NOT WIN32)
     set(SYMBOL_VERSIONING_DEFAULT OFF)
 
     if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
-            CMAKE_SYSTEM_PROCESSOR MATCHES "[Mm]icro[Bb]laze")
+            (CMAKE_SYSTEM_PROCESSOR MATCHES "[Mm]icro[Bb]laze" OR
+             CMAKE_C_COMPILER_ID STREQUAL "NVHPC"))
         # As a special case, GNU/Linux on MicroBlaze gets the generic
         # symbol versioning because GCC 12 doesn't support the __symver__
         # attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes
@@ -264,6 +265,10 @@ if(NOT WIN32)
         # the CMake toolchain file (not perfectly standardized but it very
         # likely has "microblaze" in lower case or mixed case somewhere in
         # the string).
+        #
+        # NVIDIA HPC Compiler doesn't support symbol versioning but
+        # it uses the linked from the system so the linker script
+        # can still be used to get the generic symbol versioning.
         set(SYMBOL_VERSIONING_DEFAULT "generic")
 
     elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")