From: Xuanteng Huang <xuanteng.huang@outlook.com>
Date: Thu, 21 Nov 2024 19:59:37 +0800
Subject: add version script to control exposed symbols
Description: This patch add a version script for linker to hide all
internal APIs from being exposed. Only public APIs beginning with
rsmi_* will be public.

Forwarded: not-needed
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,8 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -O0 -DDEBUG")
 endif ()
 
+set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-Wl,--version-script=${CMAKE_SOURCE_DIR}/debian/librocm-smi64-1.version")
+
 ## Address Sanitize Flag
 if (${ADDRESS_SANITIZER})
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g -fno-omit-frame-pointer")
