spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
PATCH 1/1 spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
if usrmerge included in DISTRO_FEATURES base_libdir is set to "/usr/lib{64}" instead of "lib{64}". Build issues occur when building vulkan-validation-layers or any recipe that requires the output of spirv-tools (SPIRV-ToolsTarget.cmake).
As INTERFACE_LINK_LIBRARIES cmake property value is set incorrectly. _IMPORT_PREFIX is already set to <recipes-sysroot>/usr
if usrmerge included INTERFACE_LINK_LIBRARIES value would be <recipes-sysroot>/usr/usr/lib
Leading to bellow error
recipe-sysroot/usr/usr/lib', needed by 'layers/libVkLayer_khronos_validation.so', missing and no known rule to make it
Solution:
Remove "/usr/" from base_libdir string if present as base_libdir should only contain name of directory.
--- meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +12 -1
@@ -28,11 +28,22 @@ EXTRA_OECMAKE += "\ -DSPIRV_SKIP_TESTS=ON \ " +# Removes "/usr/" from base_libdir if exist as +# it's already define in _IMPORT_PREFIX string +# leading to <recipes-sysroot>/usr/usr/lib not +# found as it doesn't exist. +def update_base_libdir(d): + base_libdir=d.getVar("base_libdir") + if '/usr/' in base_libdir: + return base_libdir.strip("/usr/") + return base_libdir + do_install:append:class-target() { + baselibdir="${@update_base_libdir(d)}" # Properly set _IMPORT_PREFIX in INTERFACE_LINK_LIBRARIES so that dependent # tools can find the right library sed -i ${D}${libdir}/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake \ - -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}\${base_libdir}":' + -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}\${baselibdir}":' } # all the libraries are unversioned, so don't pack it on PN-dev
Signature · 1 line
2.34.1
Quoted 34 lines · Vincent Davis Jr
if usrmerge included in
DISTRO_FEATURESbase_libdiris set to "/usr/lib{64}" instead of "lib{64}". Build issues occur when building vulkan-validation-layers or any recipe that requires the output of spirv-tools (SPIRV-ToolsTarget.cmake).As
INTERFACE_LINK_LIBRARIEScmake property value is set incorrectly._IMPORT_PREFIXis already set to <recipes-sysroot>/usr
if usrmerge includedINTERFACE_LINK_LIBRARIESvalue would be <recipes-sysroot>/usr/usr/libLeading to bellow error
recipe-sysroot/usr/usr/lib', needed by 'layers/libVkLayer_khronos_validation.so', missing and no known rule to make it
Solution:
Remove "
/usr/" frombase_libdirstring if present asbase_libdirshould only contain name of directory.Signed-off-by Vincent Davis Jr <[email protected]>--- meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +0
-0@@ -28,11 +28,22 @@ EXTRA_OECMAKE += "\ -DSPIRV_SKIP_TESTS=ON \ "
meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb EXTRA_OECMAKE += "\ · line 40
Quoted 10 lines
meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +10
-0+# Removes "/usr/" from base_libdir if exist as +# it's already define in _IMPORT_PREFIX string +# leading to <recipes-sysroot>/usr/usr/lib not +# found as it doesn't exist. +def update_base_libdir(d): + base_libdir=d.getVar("base_libdir") + if '/usr/' in base_libdir: + return base_libdir.strip("/usr/") + return base_libdir +
baselib variable exists already. Please try to use that instead.
Quoted 25 lines
meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +2
-1do_install:append:class-target() { + baselibdir="${@update_base_libdir(d)}" # Properly set _IMPORT_PREFIX in INTERFACE_LINK_LIBRARIES so that dependent # tools can find the right library sed -i ${D}${libdir}/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake \ - -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}\${base_libdir}":' + -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}\${baselibdir}":' }# all the libraries are unversioned, so don't pack it on PN-dev -- 2.34.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182641): https://lists.openembedded.org/g/openembedded-core/message/182641
Mute This Topic: https://lists.openembedded.org/mt/99472427/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
something like this will be good
Quoted 74 lines · Khem Raj
Quoted 34 lines · Vincent Davis Jr
if usrmerge included in
DISTRO_FEATURESbase_libdiris set to "/usr/lib{64}" instead of "lib{64}". Build issues occur when building vulkan-validation-layers or any recipe that requires the output of spirv-tools (SPIRV-ToolsTarget.cmake).As
INTERFACE_LINK_LIBRARIEScmake property value is set incorrectly._IMPORT_PREFIXis already set to <recipes-sysroot>/usr
if usrmerge includedINTERFACE_LINK_LIBRARIESvalue would be <recipes-sysroot>/usr/usr/libLeading to bellow error
recipe-sysroot/usr/usr/lib', needed by 'layers/libVkLayer_khronos_validation.so', missing and no known rule to make it
Solution:
Remove "
/usr/" frombase_libdirstring if present asbase_libdirshould only contain name of directory.Signed-off-by Vincent Davis Jr <[email protected]>--- meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +0
-0@@ -28,11 +28,22 @@ EXTRA_OECMAKE += "\ -DSPIRV_SKIP_TESTS=ON \ "meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb EXTRA_OECMAKE += "\ · line 40
Quoted 10 lines
meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +10
-0+# Removes "/usr/" from base_libdir if exist as +# it's already define in _IMPORT_PREFIX string +# leading to <recipes-sysroot>/usr/usr/lib not +# found as it doesn't exist. +def update_base_libdir(d): + base_libdir=d.getVar("base_libdir") + if '/usr/' in base_libdir: + return base_libdir.strip("/usr/") + return base_libdir +baselib variable exists already. Please try to use that instead.
Quoted 25 lines
meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb +2
-1do_install:append:class-target() { + baselibdir="${@update_base_libdir(d)}" # Properly set _IMPORT_PREFIX in INTERFACE_LINK_LIBRARIES so that dependent # tools can find the right library sed -i ${D}${libdir}/cmake/SPIRV-Tools/SPIRV-ToolsTarget.cmake \ - -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}\${base_libdir}":' + -e 's:INTERFACE_LINK_LIBRARIES.*$:INTERFACE_LINK_LIBRARIES "\$\{_IMPORT_PREFIX\}\${baselibdir}":' }# all the libraries are unversioned, so don't pack it on PN-dev -- 2.34.1-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182641): https://lists.openembedded.org/g/openembedded-core/message/182641
Mute This Topic: https://lists.openembedded.org/mt/99472427/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Just tried that builds for me.
Quoted 2 lines · Vincent Davis Jr
Just tried that builds for me.
cool. Then please send a v2 of your patch series using that patch.
Quoted 8 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182647): https://lists.openembedded.org/g/openembedded-core/message/182647
Mute This Topic: https://lists.openembedded.org/mt/99472427/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-