File: Add-version-script-to-control-exposed-symbols.patch

package info (click to toggle)
rocsparse 6.4.3-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 20,408 kB
  • sloc: cpp: 234,069; f90: 9,307; sh: 2,262; python: 1,939; makefile: 1,588; ansic: 440; xml: 26
file content (30 lines) | stat: -rw-r--r-- 921 bytes parent folder | download
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)