Skip to content

Commit 10a9551

Browse files
AngryLokilgritz
authored andcommitted
build: Fix compilation with ld.lld (#2094)
When using Clang 18<->22 with ld.lld, build fails with: ``` clang++ -Wl,--version-script=.../hidesymbols.map -o lib/liboslcomp.so.1.13.7 ... ld.lld: error: version script assignment of 'global' to symbol 'test_shade' failed: symbol not defined ``` The issue is that test_shade does not belong to liboslcomp, instead it belongs to libtestshade, and ld.lld actually checks that and fails. The minimal fix is to remove test_shade from hidesymbols.map, the slightly better way is to create a separate symbols map for libtestshade. See also: https://bugs.gentoo.org/929091 Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
1 parent 6b256cf commit 10a9551

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/build-scripts/hidesymbols.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
global: *OSL*; test_shade; *osl*imageio*; *osl_input_extensions; PyInit*;
2+
global: *OSL*; *osl*imageio*; *osl_input_extensions; PyInit*;
33
local: osl_*; *pvt*; *;
44
};

src/testshade/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ if (NOT CODECOV)
110110
OUTPUT_NAME libtestshade${OSL_LIBNAME_SUFFIX}
111111
)
112112

113+
# Only libtestshade exports test_shade; keep it out of the global map.
114+
if (VISIBILITY_MAP_COMMAND)
115+
set_property (TARGET libtestshade
116+
APPEND PROPERTY LINK_FLAGS
117+
-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/testshade_symbols.map)
118+
endif ()
119+
113120
target_link_libraries (libtestshade
114121
PRIVATE
115122
oslexec oslquery oslcomp)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
global: test_shade;
3+
local: *;
4+
};

0 commit comments

Comments
 (0)