Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 944417 - sys-block/thin-provisioning-tools-1.1.0-r2: fails to compile on musl due to rust dynamically loading libclang
Summary: sys-block/thin-provisioning-tools-1.1.0-r2: fails to compile on musl due to r...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-22 09:45 UTC by Fabian Groffen
Modified: 2025-03-09 09:13 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2024-11-22 09:45:32 UTC
error: failed to run custom build command for `devicemapper-sys v0.3.0`

Caused by:
  process didn't exit successfully: `/var/tmp/portage/sys-block/thin-provisionin
g-tools-1.1.0-r2/work/thin-provisioning-tools-1.1.0/target/release/build/devicem
apper-sys-03a7fd054925d38f/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /var/tmp/portage/sys-block/thin-provisioning-tools-1
.1.0-r2/work/cargo_home/gentoo/bindgen-0.69.4/lib.rs:622:31:
  Unable to find libclang: "the `libclang` shared library at /usr/lib/llvm/18/li
b/libclang.so.18.1.8 could not be opened: Dynamic loading not supported"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `devicemapper-sys v0.3.0`

% file /usr/lib/llvm/18/lib/libclang.so.18.1.8
/usr/lib/llvm/18/lib/libclang.so.18.1.8: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

I don't know if there is a way to build without rust or avoid it doing a dlopen which it apparently relies on.  I'll try building rust from source to see if it then figures out it cannot use dlopen() and just link against libclang or something.  I've been using rust-bin for now, which is just available for musl profiles AFAICT.



Portage 3.0.66.1 (python 3.12.7-final-0, default/linux/amd64/23.0/musl/hardened, gcc-14, musl-1.2.5-r1, 6.6.58-gentoo-r1 x86_64)
=================================================================
System uname: Linux-6.6.58-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-libc
KiB Mem:    32828440 total,   2673732 free
KiB Swap:    8388600 total,   7574264 free
Timestamp of repository gentoo: Fri, 22 Nov 2024 05:00:00 +0000
Head commit of repository gentoo: 1242875c59a10290f09d099f5cdf2ca214345534
sh bash 5.2_p37
ld GNU ld (Gentoo 2.42 p6) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.30.5::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.5.2::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.7_p1::gentoo, 3.13.0::gentoo
dev-lang/rust-bin:         1.81.0-r100::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang:           18.1.8::gentoo
sys-devel/gcc:             13.3.1_p20241025::gentoo, 14.2.1_p20241116::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.5-r1::gentoo
Comment 1 Kyle Elbert 2025-03-08 05:04:15 UTC
just ran into this myself with 1.1.0-r3 , and yeah for some reason building rust from source instead of rust-bin and trying again using that worked around the issue.
Comment 2 Fabian Groffen gentoo-dev 2025-03-09 09:13:58 UTC
sorry, I forgot to update, that using rust iso rust-bin indeeed solves the problem.  rust-bin apparently isn't compatible with musl.