From: Peter Tatrai <[email protected]>

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 <[email protected]>
Signed-off-by: Yash Shinde <[email protected]>
---
 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"]
         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)
-- 
2.49.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#227461): 
https://lists.openembedded.org/g/openembedded-core/message/227461
Mute This Topic: https://lists.openembedded.org/mt/116709648/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to