1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From: Christian Kastner <ckk@debian.org>
Date: Sat, 28 Jun 2025 11:06:25 +0200
Subject: Add version script to control exposed symbols
The C++ symbols emitted are clearly not intended to be part of the API.
Rather than spending a lot of time finding the root cause, simply allow
only the rocsparse_ symbols.
Based on a solution by Xuanteng Huang for src:rocm-smi-lib.
Forwarded: not-needed
---
CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e26803..d35d1b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,6 +122,10 @@ if(BUILD_ADDRESS_SANITIZER)
set(BUILD_FORTRAN_CLIENTS OFF)
endif()
+# Debian: symbol hygiene
+set(SYMVERSCRIPT "${CMAKE_SOURCE_DIR}/debian/librocsparse1.version.lds")
+set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-Wl,--version-script=${SYMVERSCRIPT}")
+
# Dependencies
include(cmake/Dependencies.cmake)
|