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>
Release 1.15.3.0 (1 Apr 2026) -- compared to 1.15.2.0 --------------------------------------------------------- - *bsdl*: Incorporate diffuse MaterialX BSDFs into BSDL library [AcademySoftwareFoundation#2092](AcademySoftwareFoundation#2092) (by Alejandro Conty) - *build*: Fix compilation with ld.lld [AcademySoftwareFoundation#2094](AcademySoftwareFoundation#2094) (by Sv. Lockal) (1.15.3.0, 1.14.10.0) - *ci*: Add Windows 2025 with MSVS 2026 job variant to CI [AcademySoftwareFoundation#2093](AcademySoftwareFoundation#2093) (1.15.3.0, 1.14.10.0) - *ci*: For security, replace some workflow substitutions with safer env substitutions [AcademySoftwareFoundation#2088](AcademySoftwareFoundation#2088) (1.15.3.0, 1.14.10.0) - *ci*: Some minor LLVM dependency improvements [AcademySoftwareFoundation#2090](AcademySoftwareFoundation#2090) - *ci*: Various fixes for unexpected CI runner breakages: fmt/OIIO main build [AcademySoftwareFoundation#2095](AcademySoftwareFoundation#2095), Mac compiler path [AcademySoftwareFoundation#2096](AcademySoftwareFoundation#2096), Intel compiler certificate update [AcademySoftwareFoundation#2101](AcademySoftwareFoundation#2101), OIIO dependency hash lockdown [AcademySoftwareFoundation#2102](AcademySoftwareFoundation#2102) (1.15.3.0, 1.14.10.0) Signed-off-by: Larry Gritz <lg@larrygritz.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.