All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
@ 2023-06-11 22:53 Vincent Davis Jr
  2023-06-12  0:52 ` [OE-core] " Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Davis Jr @ 2023-06-11 22:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Vincent Davis Jr

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.

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
---
 meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb b/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
index 21f9dd9650..dbfdbd4e0a 100644
--- a/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
+++ b/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
@@ -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
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
  2023-06-11 22:53 [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES Vincent Davis Jr
@ 2023-06-12  0:52 ` Khem Raj
  2023-06-12  1:12   ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2023-06-12  0:52 UTC (permalink / raw)
  To: Vincent Davis Jr; +Cc: openembedded-core

On Sun, Jun 11, 2023 at 3:55 PM Vincent Davis Jr <vince@underview.tech> wrote:
>
> 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.
>
> Signed-off-by: Vincent Davis Jr <vince@underview.tech>
> ---
>  meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb b/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
> index 21f9dd9650..dbfdbd4e0a 100644
> --- a/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
> +++ b/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
> @@ -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
> +

baselib variable exists already. Please try to use that instead.

>  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
> --
> 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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
  2023-06-12  0:52 ` [OE-core] " Khem Raj
@ 2023-06-12  1:12   ` Khem Raj
  2023-06-12  2:17     ` Vincent Davis Jr
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2023-06-12  1:12 UTC (permalink / raw)
  To: Vincent Davis Jr; +Cc: openembedded-core

something like this will be good

https://git.yoctoproject.org/poky-contrib/commit/?h=yoe/mut&id=98781287ec0e12d1dc3506f84871b47993c6750b

On Sun, Jun 11, 2023 at 5:52 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Sun, Jun 11, 2023 at 3:55 PM Vincent Davis Jr <vince@underview.tech> wrote:
> >
> > 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.
> >
> > Signed-off-by: Vincent Davis Jr <vince@underview.tech>
> > ---
> >  meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb b/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
> > index 21f9dd9650..dbfdbd4e0a 100644
> > --- a/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
> > +++ b/meta/recipes-graphics/spir/spirv-tools_1.3.243.0.bb
> > @@ -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
> > +
>
> baselib variable exists already. Please try to use that instead.
>
> >  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
> > --
> > 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: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
  2023-06-12  1:12   ` Khem Raj
@ 2023-06-12  2:17     ` Vincent Davis Jr
  2023-06-12  2:36       ` [OE-core] " Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Davis Jr @ 2023-06-12  2:17 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 32 bytes --]

Just tried that builds for me.

[-- Attachment #2: Type: text/html, Size: 32 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES
  2023-06-12  2:17     ` Vincent Davis Jr
@ 2023-06-12  2:36       ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2023-06-12  2:36 UTC (permalink / raw)
  To: Vincent Davis Jr; +Cc: openembedded-core

On Sun, Jun 11, 2023 at 7:17 PM Vincent Davis Jr <vince@underview.tech> wrote:
>
> Just tried that builds for me.

cool. Then please send a v2 of your patch series using that patch.

> -=-=-=-=-=-=-=-=-=-=-=-
> 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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-12  2:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-11 22:53 [PATCH] spirv-tools: fix base_libdir when usrmerge in DISTRO_FEATURES Vincent Davis Jr
2023-06-12  0:52 ` [OE-core] " Khem Raj
2023-06-12  1:12   ` Khem Raj
2023-06-12  2:17     ` Vincent Davis Jr
2023-06-12  2:36       ` [OE-core] " Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.