Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 743613 - gnome-base/librsvg-2.48.8 on musl-1.2.1: /usr/lib/rust-1.46.0/rustlib/x86_64-unknown-linux-musl/lib/libunwind-6bcb0d8697a865ce.rlib(elf64.o): in function `_Uelf64_get_proc_name_in_image': undefined reference to `lzma_stream_footer_decode'
Summary: gnome-base/librsvg-2.48.8 on musl-1.2.1: /usr/lib/rust-1.46.0/rustlib/x86_64-...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
Depends on:
Reported: 2020-09-19 18:38 UTC by Andrew Savchenko
Modified: 2020-10-08 10:19 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---

build.log (librsvg-2.48.8:20200919-181612.log,60.44 KB, text/x-log)
2020-09-19 18:38 UTC, Andrew Savchenko
environment (environment,137.05 KB, text/plain)
2020-09-19 18:39 UTC, Andrew Savchenko
emerge --info (,8.98 KB, application/x-info)
2020-09-19 18:40 UTC, Andrew Savchenko

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2020-09-19 18:38:48 UTC
Created attachment 661503 [details]


the latest librsvg fail to build on musl-based system as follows:

  = note: /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: /usr/lib/rust-1.46.0/rustlib/x86_64-unknown-linux-musl/lib/libunwind-6bcb0d8697a865ce.rlib(elf64.o): in function `_Uelf64_get_proc_name_in_image':
          (.text+0x436): undefined reference to `lzma_stream_footer_decode'
          /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: (.text+0x47e): undefined reference to `lzma_index_buffer_decode'
          /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: (.text+0x495): undefined reference to `lzma_index_size'
          /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: (.text+0x4ad): undefined reference to `lzma_index_end'
          /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: (.text+0x4c1): undefined reference to `lzma_index_uncompressed_size'
          /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: (.text+0x4d2): undefined reference to `lzma_index_end'
          /usr/lib/gcc/x86_64-gentoo-linux-musl/10.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld: (.text+0x550): undefined reference to `lzma_stream_buffer_decode'
          collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: could not compile `getrandom`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build --edition=2018 /var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8/vendor/getrandom/ --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -Cembed-bitcode=no -C debuginfo=2 --cfg 'feature="std"' -C metadata=376b4fa40dfde4ca -C extra-filename=-376b4fa40dfde4ca --out-dir /var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8-abi_x86_64.amd64/target/release/build/getrandom-376b4fa40dfde4ca -L dependency=/var/tmp/portage/gnome-base/librsvg-2.48.8/work/librsvg-2.48.8-abi_x86_64.amd64/target/release/deps --cap-lints allow -C target-cpu=native -C opt-level=3 -v` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: linking with `x86_64-gentoo-linux-musl-gcc` failed: exit code: 1

Maybe some rust toolchain related issue, so I'm CC'ing the rust team as well.

Full build information follows.
Comment 1 Andrew Savchenko gentoo-dev 2020-09-19 18:39:45 UTC
Created attachment 661506 [details]
Comment 2 Andrew Savchenko gentoo-dev 2020-09-19 18:40:49 UTC
Created attachment 661509 [details]
emerge --info
Comment 3 tt_1 2020-09-22 15:52:01 UTC
please head over to smaeul's overlay and open a bug here, this seems to be a major blocker for desktops. 

I've used rust-1.41.1 for compiling librsvg on musl, worked so fare on amd64
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-09-22 17:11:38 UTC
I see no smaeul overlay used here.
also smaeul's rust does not link to libunwind I think.

::gentoo rust on musl should be used with

> RUSTFLAGS="-C target-feature=-crt-static" in make.conf

or even better

> CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"

otherwise it will produce static for everything by default.

note that gcc's CHOST and rust target differs, vendor field is -unknown- for rust, it's expected for now. and rust-toolchain.eclass rust_abi() will enforce this target.

adding x86_64-gentoo-linux-musl as rust target requires custom bootstrap tarballs or compiling rust twice at bootstrap, or adding target spec jsons at bootstrap, it's not done yet. json specs are the easiest solution but I never managed to have bootstrap done with it, fails at stage2, stage1 works so far.
Comment 5 Georgy Yakovlev archtester gentoo-dev 2020-10-08 10:19:01 UTC
what's your flags on libunwind?

I can't reproduce with rust from ::gentoo, neither with rust or rust-bin, tried several versions, with or without system-llvm.

tried libunwind with and without lzma flag and with and without static-libs (it's set to + by default).

soo, I have no idea what's wrong here. maybe ricer flags? =)