build: Fix compilation with ld.lld#2094
build: Fix compilation with ld.lld#2094lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
|
|
| set_property (TARGET libtestshade | ||
| APPEND PROPERTY LINK_FLAGS | ||
| -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/testshade_symbols.map) | ||
| endif () |
There was a problem hiding this comment.
I was expecting this to fail on Windows, but it didn't. What's going on? Is cmake smart enough to know that that these linker flags only apply to some platforms and don't put them on the link line elsewher?
There was a problem hiding this comment.
The only place where VISIBILITY_MAP_COMMAND is defined is:
OpenShadingLanguage/src/cmake/compiler.cmake
Lines 135 to 142 in a2a7fb4
Which is Linux/FreeBSD/Hurd, not even Cygwin/mingw.
There was a problem hiding this comment.
Ah, I see! So the if (VISIBILITY_MAP_COMMAND) is already implicitly guarding by platform. Great.
|
You will need a DCO sign-off. The easiest way to do that is: We're experiencing a couple spuriously failing CI jobs which are not related to your changes (you can tell because they fail while setting up dependencies, not while building OSL itself). We won't let that hold up merging this PR if everything else is ok. |
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>
Done |
lgritz
left a comment
There was a problem hiding this comment.
LGTM, thanks for the fix
d282e12
into
AcademySoftwareFoundation:main
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>
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>
Description
When using Clang 18<->22 with ld.lld, build fails with:
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
Tests
Not required.
Checklist:
already run clang-format v17 before submitting, I definitely will look at
the CI test that runs clang-format and fix anything that it highlights as
being nonconforming.