CMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.

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 c273123ed0)
This commit is contained in:
Lasse Collin 2024-03-15 16:36:35 +02:00
parent 886633f423
commit 73baa8d99b
1 changed files with 6 additions and 1 deletions

View File

@ -343,7 +343,8 @@ if(NOT WIN32)
set(SYMBOL_VERSIONING_DEFAULT OFF) set(SYMBOL_VERSIONING_DEFAULT OFF)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND 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 # As a special case, GNU/Linux on MicroBlaze gets the generic
# symbol versioning because GCC 12 doesn't support the __symver__ # symbol versioning because GCC 12 doesn't support the __symver__
# attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes # attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes
@ -351,6 +352,10 @@ if(NOT WIN32)
# the CMake toolchain file (not perfectly standardized but it very # the CMake toolchain file (not perfectly standardized but it very
# likely has "microblaze" in lower case or mixed case somewhere in # likely has "microblaze" in lower case or mixed case somewhere in
# the string). # 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") set(SYMBOL_VERSIONING_DEFAULT "generic")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")