Re: [OE-core] [PATCH 3/6] mesa: enable a rich set of drivers for native builds

Böszörményi Zoltán
2024-08-03T05:14:00Z

2024. 08. 02. 19:52 keltezéssel, Peter Marko via lists.openembedded.org írta:
>> -----Original Message-----
>> From: openembedded-core@lists.openembedded.org <openembedded-
>> core@lists.openembedded.org> On Behalf Of Alexander Kanavin via
>> lists.openembedded.org
>> Sent: Thursday, March 16, 2023 10:41
>> To: openembedded-core@lists.openembedded.org
>> Cc: Kanavin, Alexander (EXT) (Linutronix GmbH) <alex@linutronix.de>
>> Subject: [OE-core] [PATCH 3/6] mesa: enable a rich set of drivers for native
>> builds
>>
>> Without this, the only available driver would be swrast
>> (without llvmpipe) which is far too slow to be practical,
>> and so qemu wouldn't be able to perform accelerated graphics.
>>
>> The one major dependency pulled in by this change is llvm-native
>> which takes just under three minutes on my machine. If this is
>> undesitable, opengl can be removed from DISTRO_FEATURES_NATIVE.
> I was just hit by this commit when migrating our gui layers from kirkstone to scarthgap.
> We include clang-native in our sdk and this creates conflict:
> ERROR: product-image-sdk-1.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/llvm-lto2 is installed by both llvm-native and clang-native, aborting
>
> I had to create mesa_%.bbappend which replaces llvm with clang
> PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, clang clang-native elfutils"
>
> But bbappends are bad idea for config changes and should be only used as last resort so I'd like to solve it via distro config.
> Also update-alternatives doesn't work for native recipes I think.
>
> Any idea how to solve this in a nice way?
> One idea from me would be to create global LLVM_PROVIDER and LLVM_NATIVE_PROVIDER variables which could be automatically switched in meta-clang.
> Wdyt?

This is already documented in meta-clang.
Though it's not automatic, you have to add it manually to
your custom distro's configuration or local.conf.