diff mbox series

[v2,3/3] mesa: Add PACKAGECONFIG "rusticl"

Message ID 20230226050814.929055-4-zboszor@gmail.com
State New
Headers show
Series Mesa 23.0.0 | expand

Commit Message

Zoltán Böszörményi Feb. 26, 2023, 5:08 a.m. UTC
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 meta/recipes-graphics/mesa/mesa.inc | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Comments

Alex Kiernan Feb. 27, 2023, 8:03 a.m. UTC | #1
On Sun, Feb 26, 2023 at 5:08 AM Zoltán Böszörményi <zboszor@gmail.com> wrote:
>
> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> ---
>  meta/recipes-graphics/mesa/mesa.inc | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
> index 89e2dc6e90..2fbc1f971e 100644
> --- a/meta/recipes-graphics/mesa/mesa.inc
> +++ b/meta/recipes-graphics/mesa/mesa.inc
> @@ -46,6 +46,7 @@ PROVIDES = " \
>      "
>
>  inherit meson pkgconfig python3native gettext features_check
> +inherit ${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'rust', '', d)}
>
>  BBCLASSEXTEND = "native nativesdk"
>
> @@ -119,6 +120,13 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
>  OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
>  PACKAGECONFIG[clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools"
>
> +# "rusticl" requires libclc and spirv-llvm-translator from meta-clang and spirv-tools from OE-Core
> +PACKAGECONFIG[rusticl] = "-Dgallium-rusticl=true -Drust_std=2021,-Dgallium-rusticl=false,bindgen-cli-native libclc spirv-tools spirv-llvm-translator,libclc spirv-tools spirv-llvm-translator"
> +
> +# Building "rusticl" runs bindgen.
> +# This setting is needed by bindgen to dlopen the correct libclang.
> +export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
> +

Could that be part of a wrapper in the bindgen recipe?

>  PACKAGECONFIG[broadcom] = ""
>  PACKAGECONFIG[etnaviv] = ""
>  PACKAGECONFIG[freedreno] = ""
> @@ -197,6 +205,7 @@ DEV_PKG_DEPENDENCY = ""
>  RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
>
>  RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'clover', 'libclc spirv-tools', '', d)}"
> +RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'libclc spirv-tools spirv-llvm-translator', '', d)}"
>
>  PACKAGES =+ "libegl-mesa libegl-mesa-dev \
>               libosmesa libosmesa-dev \
> @@ -233,7 +242,7 @@ do_install:append () {
>  # RPROVIDEs/RCONFLICTs on the generic libgl name.
>  python __anonymous() {
>      pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
> -    if "clover" in pkgconfig:
> +    if "clover" in pkgconfig or "rusticl" in pkgconfig:
>          pkgconfig.append("opencl")
>      suffix = ""
>      if "-native" in d.getVar("PN"):
> @@ -305,7 +314,7 @@ FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
>  FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
>  FILES:libgl-mesa = "${libdir}/libGL.so.*"
>  FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
> -FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
> +FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/libRusticlOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd ${sysconfdir}/OpenCL/vendors/rusticl.icd"
>  FILES:libglapi = "${libdir}/libglapi.so.*"
>  FILES:libosmesa = "${libdir}/libOSMesa.so.*"
>  FILES:libxatracker = "${libdir}/libxatracker.so.*"
> @@ -319,7 +328,7 @@ FILES:libglapi-dev = "${libdir}/libglapi.*"
>  FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
>  FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
>  FILES:libgles3-mesa-dev = "${includedir}/GLES3"
> -FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
> +FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so ${libdir}/libRusticlOpenCL.so"
>  FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
>  FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
>                            ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
> --
> 2.39.2
>
Alexander Kanavin Feb. 27, 2023, 9:31 a.m. UTC | #2
On Mon, 27 Feb 2023 at 09:04, Alex Kiernan <alex.kiernan@gmail.com> wrote:
> > +# Building "rusticl" runs bindgen.
> > +# This setting is needed by bindgen to dlopen the correct libclang.
> > +export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
> > +
>
> Could that be part of a wrapper in the bindgen recipe?

Specifically, take a look at create_wrapper in
classes-global/utils.bbclass and examples of its use in meta/

Alex
Alex Kiernan Feb. 27, 2023, 9:32 a.m. UTC | #3
On Mon, Feb 27, 2023 at 8:04 AM Alex Kiernan via
lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org>
wrote:
>
> On Sun, Feb 26, 2023 at 5:08 AM Zoltán Böszörményi <zboszor@gmail.com> wrote:
> >
> > Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> > ---
> >  meta/recipes-graphics/mesa/mesa.inc | 15 ++++++++++++---
> >  1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
> > index 89e2dc6e90..2fbc1f971e 100644
> > --- a/meta/recipes-graphics/mesa/mesa.inc
> > +++ b/meta/recipes-graphics/mesa/mesa.inc
> > @@ -46,6 +46,7 @@ PROVIDES = " \
> >      "
> >
> >  inherit meson pkgconfig python3native gettext features_check
> > +inherit ${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'rust', '', d)}
> >
> >  BBCLASSEXTEND = "native nativesdk"
> >
> > @@ -119,6 +120,13 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
> >  OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
> >  PACKAGECONFIG[clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools"
> >
> > +# "rusticl" requires libclc and spirv-llvm-translator from meta-clang and spirv-tools from OE-Core
> > +PACKAGECONFIG[rusticl] = "-Dgallium-rusticl=true -Drust_std=2021,-Dgallium-rusticl=false,bindgen-cli-native libclc spirv-tools spirv-llvm-translator,libclc spirv-tools spirv-llvm-translator"
> > +
> > +# Building "rusticl" runs bindgen.
> > +# This setting is needed by bindgen to dlopen the correct libclang.
> > +export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
> > +
>
> Could that be part of a wrapper in the bindgen recipe?
>

Also, with this export, I don't believe you have a dependency on
anything from meta-clang (certainly you're not declaring it here
AFAICS).

> >  PACKAGECONFIG[broadcom] = ""
> >  PACKAGECONFIG[etnaviv] = ""
> >  PACKAGECONFIG[freedreno] = ""
> > @@ -197,6 +205,7 @@ DEV_PKG_DEPENDENCY = ""
> >  RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
> >
> >  RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'clover', 'libclc spirv-tools', '', d)}"
> > +RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'libclc spirv-tools spirv-llvm-translator', '', d)}"
> >
> >  PACKAGES =+ "libegl-mesa libegl-mesa-dev \
> >               libosmesa libosmesa-dev \
> > @@ -233,7 +242,7 @@ do_install:append () {
> >  # RPROVIDEs/RCONFLICTs on the generic libgl name.
> >  python __anonymous() {
> >      pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
> > -    if "clover" in pkgconfig:
> > +    if "clover" in pkgconfig or "rusticl" in pkgconfig:
> >          pkgconfig.append("opencl")
> >      suffix = ""
> >      if "-native" in d.getVar("PN"):
> > @@ -305,7 +314,7 @@ FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
> >  FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
> >  FILES:libgl-mesa = "${libdir}/libGL.so.*"
> >  FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
> > -FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
> > +FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/libRusticlOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd ${sysconfdir}/OpenCL/vendors/rusticl.icd"
> >  FILES:libglapi = "${libdir}/libglapi.so.*"
> >  FILES:libosmesa = "${libdir}/libOSMesa.so.*"
> >  FILES:libxatracker = "${libdir}/libxatracker.so.*"
> > @@ -319,7 +328,7 @@ FILES:libglapi-dev = "${libdir}/libglapi.*"
> >  FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
> >  FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
> >  FILES:libgles3-mesa-dev = "${includedir}/GLES3"
> > -FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
> > +FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so ${libdir}/libRusticlOpenCL.so"
> >  FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
> >  FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
> >                            ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
> > --
> > 2.39.2
> >
>
>
> --
> Alex Kiernan
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177775): https://lists.openembedded.org/g/openembedded-core/message/177775
> Mute This Topic: https://lists.openembedded.org/mt/97240533/3618097
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kiernan@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Zoltán Böszörményi Feb. 27, 2023, 10:36 a.m. UTC | #4
2023. 02. 27. 10:32 keltezéssel, Alex Kiernan írta:
> On Mon, Feb 27, 2023 at 8:04 AM Alex Kiernan via
> lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org>
> wrote:
>> On Sun, Feb 26, 2023 at 5:08 AM Zoltán Böszörményi <zboszor@gmail.com> wrote:
>>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>> ---
>>>   meta/recipes-graphics/mesa/mesa.inc | 15 ++++++++++++---
>>>   1 file changed, 12 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
>>> index 89e2dc6e90..2fbc1f971e 100644
>>> --- a/meta/recipes-graphics/mesa/mesa.inc
>>> +++ b/meta/recipes-graphics/mesa/mesa.inc
>>> @@ -46,6 +46,7 @@ PROVIDES = " \
>>>       "
>>>
>>>   inherit meson pkgconfig python3native gettext features_check
>>> +inherit ${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'rust', '', d)}
>>>
>>>   BBCLASSEXTEND = "native nativesdk"
>>>
>>> @@ -119,6 +120,13 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
>>>   OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
>>>   PACKAGECONFIG[clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools"
>>>
>>> +# "rusticl" requires libclc and spirv-llvm-translator from meta-clang and spirv-tools from OE-Core
>>> +PACKAGECONFIG[rusticl] = "-Dgallium-rusticl=true -Drust_std=2021,-Dgallium-rusticl=false,bindgen-cli-native libclc spirv-tools spirv-llvm-translator,libclc spirv-tools spirv-llvm-translator"
>>> +
>>> +# Building "rusticl" runs bindgen.
>>> +# This setting is needed by bindgen to dlopen the correct libclang.
>>> +export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
>>> +
>> Could that be part of a wrapper in the bindgen recipe?
>>
> Also, with this export, I don't believe you have a dependency on
> anything from meta-clang (certainly you're not declaring it here
> AFAICS).

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/8352
bindgen dlopens libclang which AFAIK doesn't exist in oe-core or meta-oe.
Unless I am wrong, bindgen does depend on meta-clang.

>
>>>   PACKAGECONFIG[broadcom] = ""
>>>   PACKAGECONFIG[etnaviv] = ""
>>>   PACKAGECONFIG[freedreno] = ""
>>> @@ -197,6 +205,7 @@ DEV_PKG_DEPENDENCY = ""
>>>   RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
>>>
>>>   RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'clover', 'libclc spirv-tools', '', d)}"
>>> +RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'libclc spirv-tools spirv-llvm-translator', '', d)}"
>>>
>>>   PACKAGES =+ "libegl-mesa libegl-mesa-dev \
>>>                libosmesa libosmesa-dev \
>>> @@ -233,7 +242,7 @@ do_install:append () {
>>>   # RPROVIDEs/RCONFLICTs on the generic libgl name.
>>>   python __anonymous() {
>>>       pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
>>> -    if "clover" in pkgconfig:
>>> +    if "clover" in pkgconfig or "rusticl" in pkgconfig:
>>>           pkgconfig.append("opencl")
>>>       suffix = ""
>>>       if "-native" in d.getVar("PN"):
>>> @@ -305,7 +314,7 @@ FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
>>>   FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
>>>   FILES:libgl-mesa = "${libdir}/libGL.so.*"
>>>   FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
>>> -FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
>>> +FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/libRusticlOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd ${sysconfdir}/OpenCL/vendors/rusticl.icd"
>>>   FILES:libglapi = "${libdir}/libglapi.so.*"
>>>   FILES:libosmesa = "${libdir}/libOSMesa.so.*"
>>>   FILES:libxatracker = "${libdir}/libxatracker.so.*"
>>> @@ -319,7 +328,7 @@ FILES:libglapi-dev = "${libdir}/libglapi.*"
>>>   FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
>>>   FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
>>>   FILES:libgles3-mesa-dev = "${includedir}/GLES3"
>>> -FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
>>> +FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so ${libdir}/libRusticlOpenCL.so"
>>>   FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
>>>   FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
>>>                             ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
>>> --
>>> 2.39.2
>>>
>>
>> --
>> Alex Kiernan
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#177775): https://lists.openembedded.org/g/openembedded-core/message/177775
>> Mute This Topic: https://lists.openembedded.org/mt/97240533/3618097
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kiernan@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>
Zoltán Böszörményi Feb. 27, 2023, 10:39 a.m. UTC | #5
2023. 02. 27. 10:31 keltezéssel, Alexander Kanavin írta:
> On Mon, 27 Feb 2023 at 09:04, Alex Kiernan <alex.kiernan@gmail.com> wrote:
>>> +# Building "rusticl" runs bindgen.
>>> +# This setting is needed by bindgen to dlopen the correct libclang.
>>> +export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
>>> +
>> Could that be part of a wrapper in the bindgen recipe?
> Specifically, take a look at create_wrapper in
> classes-global/utils.bbclass and examples of its use in meta/
>
> Alex

Thanks, I will look into it.
Alex Kiernan Feb. 27, 2023, 11:28 a.m. UTC | #6
On Mon, Feb 27, 2023 at 10:36 AM Böszörményi Zoltán <zboszor@gmail.com> wrote:
>
> 2023. 02. 27. 10:32 keltezéssel, Alex Kiernan írta:
> > On Mon, Feb 27, 2023 at 8:04 AM Alex Kiernan via
> > lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org>
> > wrote:
> >> On Sun, Feb 26, 2023 at 5:08 AM Zoltán Böszörményi <zboszor@gmail.com> wrote:
> >>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >>> ---
> >>>   meta/recipes-graphics/mesa/mesa.inc | 15 ++++++++++++---
> >>>   1 file changed, 12 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
> >>> index 89e2dc6e90..2fbc1f971e 100644
> >>> --- a/meta/recipes-graphics/mesa/mesa.inc
> >>> +++ b/meta/recipes-graphics/mesa/mesa.inc
> >>> @@ -46,6 +46,7 @@ PROVIDES = " \
> >>>       "
> >>>
> >>>   inherit meson pkgconfig python3native gettext features_check
> >>> +inherit ${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'rust', '', d)}
> >>>
> >>>   BBCLASSEXTEND = "native nativesdk"
> >>>
> >>> @@ -119,6 +120,13 @@ PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
> >>>   OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
> >>>   PACKAGECONFIG[clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools"
> >>>
> >>> +# "rusticl" requires libclc and spirv-llvm-translator from meta-clang and spirv-tools from OE-Core
> >>> +PACKAGECONFIG[rusticl] = "-Dgallium-rusticl=true -Drust_std=2021,-Dgallium-rusticl=false,bindgen-cli-native libclc spirv-tools spirv-llvm-translator,libclc spirv-tools spirv-llvm-translator"
> >>> +
> >>> +# Building "rusticl" runs bindgen.
> >>> +# This setting is needed by bindgen to dlopen the correct libclang.
> >>> +export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
> >>> +
> >> Could that be part of a wrapper in the bindgen recipe?
> >>
> > Also, with this export, I don't believe you have a dependency on
> > anything from meta-clang (certainly you're not declaring it here
> > AFAICS).
>
> See https://gitlab.freedesktop.org/mesa/mesa/-/issues/8352
> bindgen dlopens libclang which AFAIK doesn't exist in oe-core or meta-oe.
> Unless I am wrong, bindgen does depend on meta-clang.
>

Reading your recipe, it looks to me like your libclang dependency is
resolving from rust-native, as you've no DEPENDS to bring clang-native
into your recipe's sysroot-native.


> >
> >>>   PACKAGECONFIG[broadcom] = ""
> >>>   PACKAGECONFIG[etnaviv] = ""
> >>>   PACKAGECONFIG[freedreno] = ""
> >>> @@ -197,6 +205,7 @@ DEV_PKG_DEPENDENCY = ""
> >>>   RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
> >>>
> >>>   RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'clover', 'libclc spirv-tools', '', d)}"
> >>> +RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'libclc spirv-tools spirv-llvm-translator', '', d)}"
> >>>
> >>>   PACKAGES =+ "libegl-mesa libegl-mesa-dev \
> >>>                libosmesa libosmesa-dev \
> >>> @@ -233,7 +242,7 @@ do_install:append () {
> >>>   # RPROVIDEs/RCONFLICTs on the generic libgl name.
> >>>   python __anonymous() {
> >>>       pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
> >>> -    if "clover" in pkgconfig:
> >>> +    if "clover" in pkgconfig or "rusticl" in pkgconfig:
> >>>           pkgconfig.append("opencl")
> >>>       suffix = ""
> >>>       if "-native" in d.getVar("PN"):
> >>> @@ -305,7 +314,7 @@ FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
> >>>   FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
> >>>   FILES:libgl-mesa = "${libdir}/libGL.so.*"
> >>>   FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
> >>> -FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
> >>> +FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/libRusticlOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd ${sysconfdir}/OpenCL/vendors/rusticl.icd"
> >>>   FILES:libglapi = "${libdir}/libglapi.so.*"
> >>>   FILES:libosmesa = "${libdir}/libOSMesa.so.*"
> >>>   FILES:libxatracker = "${libdir}/libxatracker.so.*"
> >>> @@ -319,7 +328,7 @@ FILES:libglapi-dev = "${libdir}/libglapi.*"
> >>>   FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
> >>>   FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
> >>>   FILES:libgles3-mesa-dev = "${includedir}/GLES3"
> >>> -FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
> >>> +FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so ${libdir}/libRusticlOpenCL.so"
> >>>   FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
> >>>   FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
> >>>                             ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
> >>> --
> >>> 2.39.2
> >>>
> >>
> >> --
> >> Alex Kiernan
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#177775): https://lists.openembedded.org/g/openembedded-core/message/177775
> >> Mute This Topic: https://lists.openembedded.org/mt/97240533/3618097
> >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kiernan@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
> >
>


--
Alex Kiernan
Alexander Kanavin Feb. 27, 2023, 11:36 a.m. UTC | #7
On Mon, 27 Feb 2023 at 12:28, Alex Kiernan <alex.kiernan@gmail.com> wrote:
> Reading your recipe, it looks to me like your libclang dependency is
> resolving from rust-native, as you've no DEPENDS to bring clang-native
> into your recipe's sysroot-native.

That cannot be because rust-native doesn't depend on meta-clang
either. It does build rust-llvm though. So maybe meta-clang is not
needed after all?

Just to ensure that the recipe ends up in the right place; there's an
open PR to add it to meta-clang, but I'm not sure that is the correct
destination.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 89e2dc6e90..2fbc1f971e 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -46,6 +46,7 @@  PROVIDES = " \
     "
 
 inherit meson pkgconfig python3native gettext features_check
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'rust', '', d)}
 
 BBCLASSEXTEND = "native nativesdk"
 
@@ -119,6 +120,13 @@  PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
 OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}"
 PACKAGECONFIG[clover] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools"
 
+# "rusticl" requires libclc and spirv-llvm-translator from meta-clang and spirv-tools from OE-Core
+PACKAGECONFIG[rusticl] = "-Dgallium-rusticl=true -Drust_std=2021,-Dgallium-rusticl=false,bindgen-cli-native libclc spirv-tools spirv-llvm-translator,libclc spirv-tools spirv-llvm-translator"
+
+# Building "rusticl" runs bindgen.
+# This setting is needed by bindgen to dlopen the correct libclang.
+export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
+
 PACKAGECONFIG[broadcom] = ""
 PACKAGECONFIG[etnaviv] = ""
 PACKAGECONFIG[freedreno] = ""
@@ -197,6 +205,7 @@  DEV_PKG_DEPENDENCY = ""
 RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev"
 
 RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'clover', 'libclc spirv-tools', '', d)}"
+RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'rusticl', 'libclc spirv-tools spirv-llvm-translator', '', d)}"
 
 PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libosmesa libosmesa-dev \
@@ -233,7 +242,7 @@  do_install:append () {
 # RPROVIDEs/RCONFLICTs on the generic libgl name.
 python __anonymous() {
     pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
-    if "clover" in pkgconfig:
+    if "clover" in pkgconfig or "rusticl" in pkgconfig:
         pkgconfig.append("opencl")
     suffix = ""
     if "-native" in d.getVar("PN"):
@@ -305,7 +314,7 @@  FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
 FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
 FILES:libgl-mesa = "${libdir}/libGL.so.*"
 FILES:libglx-mesa = "${libdir}/libGLX*.so.*"
-FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
+FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/libRusticlOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd ${sysconfdir}/OpenCL/vendors/rusticl.icd"
 FILES:libglapi = "${libdir}/libglapi.so.*"
 FILES:libosmesa = "${libdir}/libOSMesa.so.*"
 FILES:libxatracker = "${libdir}/libxatracker.so.*"
@@ -319,7 +328,7 @@  FILES:libglapi-dev = "${libdir}/libglapi.*"
 FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
 FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
 FILES:libgles3-mesa-dev = "${includedir}/GLES3"
-FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so"
+FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so ${libdir}/libRusticlOpenCL.so"
 FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
 FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
                           ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \