| Message ID | 20251103082911.1792759-2-peter.tatrai.ext@siemens.com | 
|---|---|
| State | New | 
| Headers | show | 
| Series | Fix Rust self-test failures on PowerPC | expand | 
On Mon, 3 Nov 2025 at 09:29, Tatrai, Peter via lists.openembedded.org <peter.tatrai.ext=siemens.com@lists.openembedded.org> wrote: > This fixes PowerPC (qemuppc) test failures with undefined references: > undefined reference to 'compress2' > undefined reference to 'uncompress' > undefined reference to 'ZSTD_decompress' > undefined reference to 'ZSTD_isError' > undefined reference to 'ZSTD_compress2' > undefined reference to 'crc32' > - cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';" > + cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';" But this still does not explain why the issue is specific to powerpc. Can you get to the bottom of it? Alex
On Mon, Nov 3, 2025 at 3:22 AM Alexander Kanavin via lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> wrote: > > On Mon, 3 Nov 2025 at 09:29, Tatrai, Peter via lists.openembedded.org > <peter.tatrai.ext=siemens.com@lists.openembedded.org> wrote: > > This fixes PowerPC (qemuppc) test failures with undefined references: > > undefined reference to 'compress2' > > undefined reference to 'uncompress' > > undefined reference to 'ZSTD_decompress' > > undefined reference to 'ZSTD_isError' > > undefined reference to 'ZSTD_compress2' > > undefined reference to 'crc32' > > - cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';" > > + cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';" > > But this still does not explain why the issue is specific to powerpc. > Can you get to the bottom of it? We have compressed debug info enabled in gcc llvm and binutils so it needed libctf.so and libbfd.so to deal with these symbols and rust's linker wrapper calls the system linker so there is a transitive dependency on zlib and libzstd, for x86_64, I see them in DT_NEEDED section so transitive dependency is met. Since we use --as-needed by default I am guessing on ppc the linker somehow ignores these libs and does not add them to DT_NEEDED segments and autoloading does not happen. Please look into these directions > > Alex > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#225647): https://lists.openembedded.org/g/openembedded-core/message/225647 > Mute This Topic: https://lists.openembedded.org/mt/116094536/1997914 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index 31222e2456..819ff6af9e 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py @@ -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)