diff mbox series

[1/5] rust: add missing zlib and zstd dependencies

Message ID 20251210101803.1120711-1-Yash.Shinde@windriver.com
State New
Headers show
Series [1/5] rust: add missing zlib and zstd dependencies | expand

Commit Message

Yash Shinde Dec. 10, 2025, 10:17 a.m. UTC
From: Peter Tatrai <peter.tatrai.ext@siemens.com>

Rust's internal LLVM requires zlib and zstd compression libraries when
building rustc_codegen_llvm and other compiler components.
Without these dependencies, building Rust for target fails
with linker errors:

  error: linking with `target-rust-ccld` failed: exit status: 1
  = note: undefined reference to `compress2'
  = note: undefined reference to `uncompress'
  = note: undefined reference to `ZSTD_decompress'
  = note: undefined reference to `ZSTD_isError'
  = note: undefined reference to `ZSTD_compress2'
  = note: undefined reference to `crc32'

This manifested in oe-selftest failure on qemuppc:
  oe-selftest -r rust.RustSelfTestSystemEmulated.test_rust

Additionally, this was observed while testing with other targets as well.

Signed-off-by: Peter Tatrai <peter.tatrai.ext@siemens.com>
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
---
 meta/lib/oeqa/selftest/cases/rust.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Randy MacLeod Dec. 10, 2025, 5:36 p.m. UTC | #1
Add Peter since this is/was his patch and you have his SOB line.
Please do that in the future.

I have some comments and questions that could go contribute to a v2
but so far, I don't object, too strongly, to merging patch 1/5 at least!


On 2025-12-10 5:17 a.m., Yash.Shinde@windriver.com wrote:
> From: Peter Tatrai<peter.tatrai.ext@siemens.com>
>
> Rust's internal LLVM
Is this an old comment? llvm is now an oe-core  recipe and we don't use 
rust's internal llvm
as far as I know (which isn't very far!).

> requires zlib and zstd compression libraries when
Yes, we have a patch for clang for this:
meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
adding in meta-clang in 2022:
https://github.com/kraj/meta-clang/commit/0f38186ae93400b870f7f92938bbf8643e7da958
and the llvm-project commit is (1).

Anyway, Khem,

What are your thoughts about this patch and about using cmake for llvm?

> building rustc_codegen_llvm and other compiler components.
> Without these dependencies, building Rust for target fails
> with linker errors:
>
>    error: linking with `target-rust-ccld` failed: exit status: 1
>    = note: undefined reference to `compress2'
>    = note: undefined reference to `uncompress'
>    = note: undefined reference to `ZSTD_decompress'
>    = note: undefined reference to `ZSTD_isError'
>    = note: undefined reference to `ZSTD_compress2'
>    = note: undefined reference to `crc32'
>
> This manifested in oe-selftest failure on qemuppc:
>    oe-selftest -r rust.RustSelfTestSystemEmulated.test_rust
>
> Additionally, this was observed while testing with other targets as well.
If you have a list on hand of which targets had this problem,
that might be useful to include in the log. It might help
us understand why the problem seems to be arch-specific.
>
> Signed-off-by: Peter Tatrai<peter.tatrai.ext@siemens.com>
> Signed-off-by: Yash Shinde<Yash.Shinde@windriver.com>
> ---
>   meta/lib/oeqa/selftest/cases/rust.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
> index 31222e2456..01a98339a6 100644
> --- a/meta/lib/oeqa/selftest/cases/rust.py
> +++ b/meta/lib/oeqa/selftest/cases/rust.py
> @@ -47,7 +47,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>           bitbake("{} -c test_compile".format(recipe))
>           builddir = get_bb_var("RUSTSRC", "rust")
>           # build core-image-minimal with required packages
> -        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
> +        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd"]
>
This has been present since the original rust.py selftest was added.
It seems like a hack in that things are added to (blindly?) fix linking 
errors
rather than getting to the root cause of the problem.

That may be acceptable in the short run but shouldn't the list should be
just what rustc/cargo from rustup depend on:
❯ which rustc
/home/rmacleod/.cargo/bin/rustc
❯ ldd `which rustc`
     linux-vdso.so.1 (0x00007a636834b000)
     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007a636830b000)
     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007a6368306000)
     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007a6368301000)
     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007a636821a000)
     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007a6368215000)
     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007a6366a00000)
     /lib64/ld-linux-x86-64.so.2 (0x00007a636834d000)

❯ cargo --version
cargo 1.91.1 (ea2d97820 2025-10-10)
❯ which cargo
/home/rmacleod/.cargo/bin/cargo
❯ ldd `which cargo`
     linux-vdso.so.1 (0x0000789ffe470000)
     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x0000789ffe430000)
     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x0000789ffe42b000)
     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x0000789ffe426000)
     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000789ffcf19000)
     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x0000789ffe421000)
     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000789ffcc00000)
     /lib64/ld-linux-x86-64.so.2 (0x0000789ffe472000)

perhaps with the exception of libatomic and libgomp which seem like 
valid requirements.
I guess I'm really wondering if libzstd even libatomic and libgomp, 
should be RDEPENDs for some recipe.

>           features = []
>           features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
>           features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
> @@ -124,7 +124,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>               cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
>               # Strip debug symbols from test binaries to reduce size (300+ MB -> ~140 MB)
>               # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes
> -            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';"
> +            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';"
>               # Trigger testing.
>               cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
>               cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)

../Randy


1) 
https://github.com/llvm/llvm-project/commit/e939bf67e34037970192fa90ad22ab7628f5de33

commit e939bf67e34037970192fa90ad22ab7628f5de33
Author: Cole Kissane <cole.kissane@gmail.com>
Date:   Tue Jul 19 13:54:35 2022

     [llvm] add zstd to `llvm::compression` namespace

     - add zstd to `llvm::compression` namespace
     - add a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring 
that of `LLVM_ENABLE_ZLIB`
     - add tests for zstd to `llvm/unittests/Support/CompressionTest.cpp`
     - debian users should install libzstd when using 
`LLVM_ENABLE_ZSTD=FORCE_ON` from source due to this bug 
https://bugs.launchpad.net/ubuntu/+source/libzstd/+bug/1941956

     Reviewed By: leonardchan, MaskRay

     Differential Revision: https://reviews.llvm.org/D128465
Yash Shinde Dec. 11, 2025, 8:10 a.m. UTC | #2
On 10-12-2025 23:06, Randy MacLeod wrote:
> Add Peter since this is/was his patch and you have his SOB line.
> Please do that in the future.
>
> I have some comments and questions that could go contribute to a v2
> but so far, I don't object, too strongly, to merging patch 1/5 at least!
>
>
> On 2025-12-10 5:17 a.m., Yash.Shinde@windriver.com wrote:
>> From: Peter Tatrai<peter.tatrai.ext@siemens.com>
>>
>> Rust's internal LLVM
> Is this an old comment? llvm is now an oe-core  recipe and we don't 
> use rust's internal llvm
> as far as I know (which isn't very far!).

I kept the message from Peter's patch unchanged which was submitted 
around the same time when
  rust-llvm was dropped. I will reword the commit message in v2, if 
required.

For more details: 
https://lists.openembedded.org/g/openembedded-core/message/225636

>
>> requires zlib and zstd compression libraries when
> Yes, we have a patch for clang for this:
> meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
> adding in meta-clang in 2022:
> https://github.com/kraj/meta-clang/commit/0f38186ae93400b870f7f92938bbf8643e7da958
> and the llvm-project commit is (1).

The selftest execution environment requires the zlib and zstd features
as llvm enables them unless explicitly disabled.

The rust recipe level RUSTFLAGS aren't propagated to qemu image for testing.
This requires explicit passing of the flags for zstd lib.
(zlib is already available by default in core-image-minimal)

The following error confirms that rust via llvm expects these libs to be 
available in the image for testing.

> Anyway, Khem,
>
> What are your thoughts about this patch and about using cmake for llvm?
>
>> building rustc_codegen_llvm and other compiler components.
>> Without these dependencies, building Rust for target fails
>> with linker errors:
>>
>>    error: linking with `target-rust-ccld` failed: exit status: 1
>>    = note: undefined reference to `compress2'
>>    = note: undefined reference to `uncompress'
>>    = note: undefined reference to `ZSTD_decompress'
>>    = note: undefined reference to `ZSTD_isError'
>>    = note: undefined reference to `ZSTD_compress2'
>>    = note: undefined reference to `crc32'
>>
>> This manifested in oe-selftest failure on qemuppc:
>>    oe-selftest -r rust.RustSelfTestSystemEmulated.test_rust
>>
>> Additionally, this was observed while testing with other targets as well.
> If you have a list on hand of which targets had this problem,
> that might be useful to include in the log. It might help
> us understand why the problem seems to be arch-specific.

Peter reported it for ppc target but eventually it was observed on all 
targets in our testings,
i.e arm32, arm64, riscv-64, x86-32 and x86-64.
So, this is a generic requirement rather than arch-specific.

>> Signed-off-by: Peter Tatrai<peter.tatrai.ext@siemens.com>
>> Signed-off-by: Yash Shinde<Yash.Shinde@windriver.com>
>> ---
>>   meta/lib/oeqa/selftest/cases/rust.py | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
>> index 31222e2456..01a98339a6 100644
>> --- a/meta/lib/oeqa/selftest/cases/rust.py
>> +++ b/meta/lib/oeqa/selftest/cases/rust.py
>> @@ -47,7 +47,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>>           bitbake("{} -c test_compile".format(recipe))
>>           builddir = get_bb_var("RUSTSRC", "rust")
>>           # build core-image-minimal with required packages
>> -        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
>> +        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd"]
>>
> This has been present since the original rust.py selftest was added.
> It seems like a hack in that things are added to (blindly?) fix 
> linking errors
> rather than getting to the root cause of the problem.
>
> That may be acceptable in the short run but shouldn't the list should be
> just what rustc/cargo from rustup depend on:
> ❯ which rustc
> /home/rmacleod/.cargo/bin/rustc
> ❯ ldd `which rustc`
>     linux-vdso.so.1 (0x00007a636834b000)
>     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
> (0x00007a636830b000)
>     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007a6368306000)
>     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
> (0x00007a6368301000)
>     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007a636821a000)
>     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007a6368215000)
>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007a6366a00000)
>     /lib64/ld-linux-x86-64.so.2 (0x00007a636834d000)
>
> ❯ cargo --version
> cargo 1.91.1 (ea2d97820 2025-10-10)
> ❯ which cargo
> /home/rmacleod/.cargo/bin/cargo
> ❯ ldd `which cargo`
>     linux-vdso.so.1 (0x0000789ffe470000)
>     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
> (0x0000789ffe430000)
>     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x0000789ffe42b000)
>     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
> (0x0000789ffe426000)
>     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000789ffcf19000)
>     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x0000789ffe421000)
>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000789ffcc00000)
>     /lib64/ld-linux-x86-64.so.2 (0x0000789ffe472000)
>
> perhaps with the exception of libatomic and libgomp which seem like 
> valid requirements.
> I guess I'm really wondering if libzstd even libatomic and libgomp, 
> should be RDEPENDs for some recipe.

The list of packages in "default_installed_packages" is needed to 
include additional selftest requirements apart from the default ones 
used in core-image-minimal. These are actual requirements rather than 
hack. Adding them in DEPENDS/RDEPENDS do not propagate the dependencies 
in selftest qemu image.


>
>>           features = []
>>           features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
>>           features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
>> @@ -124,7 +124,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>>               cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
>>               # Strip debug symbols from test binaries to reduce size (300+ MB -> ~140 MB)
>>               # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes
>> -            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';"
>> +            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';"
>>               # Trigger testing.
>>               cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
>>               cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)
>
> ../Randy
>
>
> 1) 
> https://github.com/llvm/llvm-project/commit/e939bf67e34037970192fa90ad22ab7628f5de33
>
> commit e939bf67e34037970192fa90ad22ab7628f5de33
> Author: Cole Kissane <cole.kissane@gmail.com>
> Date:   Tue Jul 19 13:54:35 2022
>
>     [llvm] add zstd to `llvm::compression` namespace
>
>     - add zstd to `llvm::compression` namespace
>     - add a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring 
> that of `LLVM_ENABLE_ZLIB`
>     - add tests for zstd to `llvm/unittests/Support/CompressionTest.cpp`
>     - debian users should install libzstd when using 
> `LLVM_ENABLE_ZSTD=FORCE_ON` from source due to this bug 
> https://bugs.launchpad.net/ubuntu/+source/libzstd/+bug/1941956
>
>     Reviewed By: leonardchan, MaskRay
>
>     Differential Revision: https://reviews.llvm.org/D128465
>
>
>
>
> -- 
> # Randy MacLeod
> # Wind River Linux
Randy MacLeod Dec. 11, 2025, 12:59 p.m. UTC | #3
On 2025-12-11 3:10 a.m., Yash Shinde wrote:
>
>
> On 10-12-2025 23:06, Randy MacLeod wrote:
>> Add Peter since this is/was his patch and you have his SOB line.
>> Please do that in the future.
>>
>> I have some comments and questions that could go contribute to a v2
>> but so far, I don't object, too strongly, to merging patch 1/5 at least!
>>
>>
>> On 2025-12-10 5:17 a.m., Yash.Shinde@windriver.com wrote:
>>> From: Peter Tatrai<peter.tatrai.ext@siemens.com>
>>>
>>> Rust's internal LLVM
>> Is this an old comment? llvm is now an oe-core  recipe and we don't 
>> use rust's internal llvm
>> as far as I know (which isn't very far!).
>
> I kept the message from Peter's patch unchanged which was submitted 
> around the same time when
>  rust-llvm was dropped. I will reword the commit message in v2, if 
> required.
>
> For more details: 
> https://lists.openembedded.org/g/openembedded-core/message/225636


Good.


>
>>
>>> requires zlib and zstd compression libraries when
>> Yes, we have a patch for clang for this:
>> meta/recipes-devtools/clang/clang/0024-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch
>> adding in meta-clang in 2022:
>> https://github.com/kraj/meta-clang/commit/0f38186ae93400b870f7f92938bbf8643e7da958
>> and the llvm-project commit is (1).
>
> The selftest execution environment requires the zlib and zstd features
> as llvm enables them unless explicitly disabled.
>
> The rust recipe level RUSTFLAGS aren't propagated to qemu image for 
> testing.
> This requires explicit passing of the flags for zstd lib.
> (zlib is already available by default in core-image-minimal)
>
> The following error confirms that rust via llvm expects these libs to 
> be available in the image for testing.
>

Okay.


>> Anyway, Khem,
>>
>> What are your thoughts about this patch and about using cmake for llvm?
>>
>>> building rustc_codegen_llvm and other compiler components.
>>> Without these dependencies, building Rust for target fails
>>> with linker errors:
>>>
>>>    error: linking with `target-rust-ccld` failed: exit status: 1
>>>    = note: undefined reference to `compress2'
>>>    = note: undefined reference to `uncompress'
>>>    = note: undefined reference to `ZSTD_decompress'
>>>    = note: undefined reference to `ZSTD_isError'
>>>    = note: undefined reference to `ZSTD_compress2'
>>>    = note: undefined reference to `crc32'
>>>
>>> This manifested in oe-selftest failure on qemuppc:
>>>    oe-selftest -r rust.RustSelfTestSystemEmulated.test_rust
>>>
>>> Additionally, this was observed while testing with other targets as well.
>> If you have a list on hand of which targets had this problem,
>> that might be useful to include in the log. It might help
>> us understand why the problem seems to be arch-specific.
>
> Peter reported it for ppc target but eventually it was observed on all 
> targets in our testings,
> i.e arm32, arm64, riscv-64, x86-32 and x86-64.
> So, this is a generic requirement rather than arch-specific.
>
Good so please revise your v2 commit log to indicate exactly what you 
observed.


../Randy

>
>>> Signed-off-by: Peter Tatrai<peter.tatrai.ext@siemens.com>
>>> Signed-off-by: Yash Shinde<Yash.Shinde@windriver.com>
>>> ---
>>>   meta/lib/oeqa/selftest/cases/rust.py | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
>>> index 31222e2456..01a98339a6 100644
>>> --- a/meta/lib/oeqa/selftest/cases/rust.py
>>> +++ b/meta/lib/oeqa/selftest/cases/rust.py
>>> @@ -47,7 +47,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>>>           bitbake("{} -c test_compile".format(recipe))
>>>           builddir = get_bb_var("RUSTSRC", "rust")
>>>           # build core-image-minimal with required packages
>>> -        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
>>> +        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd"]
>>>
>> This has been present since the original rust.py selftest was added.
>> It seems like a hack in that things are added to (blindly?) fix 
>> linking errors
>> rather than getting to the root cause of the problem.
>>
>> That may be acceptable in the short run but shouldn't the list should be
>> just what rustc/cargo from rustup depend on:
>> ❯ which rustc
>> /home/rmacleod/.cargo/bin/rustc
>> ❯ ldd `which rustc`
>>     linux-vdso.so.1 (0x00007a636834b000)
>>     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
>> (0x00007a636830b000)
>>     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007a6368306000)
>>     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
>> (0x00007a6368301000)
>>     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007a636821a000)
>>     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007a6368215000)
>>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007a6366a00000)
>>     /lib64/ld-linux-x86-64.so.2 (0x00007a636834d000)
>>
>> ❯ cargo --version
>> cargo 1.91.1 (ea2d97820 2025-10-10)
>> ❯ which cargo
>> /home/rmacleod/.cargo/bin/cargo
>> ❯ ldd `which cargo`
>>     linux-vdso.so.1 (0x0000789ffe470000)
>>     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
>> (0x0000789ffe430000)
>>     librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x0000789ffe42b000)
>>     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
>> (0x0000789ffe426000)
>>     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000789ffcf19000)
>>     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x0000789ffe421000)
>>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000789ffcc00000)
>>     /lib64/ld-linux-x86-64.so.2 (0x0000789ffe472000)
>>
>> perhaps with the exception of libatomic and libgomp which seem like 
>> valid requirements.
>> I guess I'm really wondering if libzstd even libatomic and libgomp, 
>> should be RDEPENDs for some recipe.
>
> The list of packages in "default_installed_packages" is needed to 
> include additional selftest requirements apart from the default ones 
> used in core-image-minimal. These are actual requirements rather than 
> hack. Adding them in DEPENDS/RDEPENDS do not propagate the 
> dependencies in selftest qemu image.
>
>
>>
>>>           features = []
>>>           features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
>>>           features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
>>> @@ -124,7 +124,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
>>>               cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
>>>               # Strip debug symbols from test binaries to reduce size (300+ MB -> ~140 MB)
>>>               # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes
>>> -            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';"
>>> +            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';"
>>>               # Trigger testing.
>>>               cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
>>>               cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)
>>
>> ../Randy
>>
>>
>> 1) 
>> https://github.com/llvm/llvm-project/commit/e939bf67e34037970192fa90ad22ab7628f5de33
>>
>> commit e939bf67e34037970192fa90ad22ab7628f5de33
>> Author: Cole Kissane <cole.kissane@gmail.com>
>> Date:   Tue Jul 19 13:54:35 2022
>>
>>     [llvm] add zstd to `llvm::compression` namespace
>>
>>     - add zstd to `llvm::compression` namespace
>>     - add a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring 
>> that of `LLVM_ENABLE_ZLIB`
>>     - add tests for zstd to `llvm/unittests/Support/CompressionTest.cpp`
>>     - debian users should install libzstd when using 
>> `LLVM_ENABLE_ZSTD=FORCE_ON` from source due to this bug 
>> https://bugs.launchpad.net/ubuntu/+source/libzstd/+bug/1941956
>>
>>     Reviewed By: leonardchan, MaskRay
>>
>>     Differential Revision: https://reviews.llvm.org/D128465
>>
>>
>>
>>
>> -- 
>> # Randy MacLeod
>> # Wind River Linux
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 31222e2456..01a98339a6 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -47,7 +47,7 @@  class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
         bitbake("{} -c test_compile".format(recipe))
         builddir = get_bb_var("RUSTSRC", "rust")
         # build core-image-minimal with required packages
-        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
+        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd"]
         features = []
         features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
         features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
@@ -124,7 +124,7 @@  class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
             cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
             # Strip debug symbols from test binaries to reduce size (300+ MB -> ~140 MB)
             # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes
-            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';"
+            cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';"
             # Trigger testing.
             cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
             cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)