Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 912154 - www-client/firefox failing to compile on LLVM/ musl using rust-bin - thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at /usr/lib/llvm/16/lib/libclang.so.16.0.6+libcxx could not be opened: Dynamic loading not supported"'
Summary: www-client/firefox failing to compile on LLVM/ musl using rust-bin - thread '...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-08-11 23:27 UTC by abanoub
Modified: 2023-10-31 19:35 UTC (History)
0 users

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


Attachments
Build log of firefox (failed_firefox_ansi_filtered.log.xz,99.34 KB, application/x-xz)
2023-08-11 23:27 UTC, abanoub
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abanoub 2023-08-11 23:27:07 UTC
Created attachment 867669 [details]
Build log of firefox

On my ~amd64 musl/llvm installation, I cannot compile firefox using rust-bin without it failing due to a libclang error, which is seemingly unrelated considering the current work around i have is to just use manually compiled rust as the active rust target and compile firefox via that.

Steps to reproduce

1. Select rust-bin as rust target via eselect rust
2. emerge www-client/firefox

Reported error

thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at /usr/lib/llvm/16/lib/libclang.so.16.0.6+libcxx could not be opened: Dynamic loading not supported"'
Comment 1 abanoub 2023-08-11 23:30:47 UTC
My emerge --info

```
Portage 3.0.50 (python 3.11.4-final-0, default/linux/amd64/17.0/musl/clang, gcc-13, musl-1.2.3-r8, 6.4.9-gentoo x86_64)
=================================================================
System uname: Linux-6.4.9-gentoo-x86_64-AMD_Ryzen_5_1600_Six-Core_Processor-with-libc
KiB Mem:    16264872 total,   3718272 free
KiB Swap:    8388604 total,   8383228 free
Timestamp of repository gentoo: Fri, 11 Aug 2023 21:30:01 +0000
Head commit of repository gentoo: 11ca48169618e6ff6389697a25487def407d332e
sh bash 5.2_p15-r6
ld GNU ld (Gentoo 2.41 p2) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.4::gentoo, 3.12.0_rc1::gentoo
dev-lang/rust:             1.71.1::gentoo
dev-lang/rust-bin:         1.71.1::gentoo
dev-util/cmake:            3.27.1-r1::gentoo
dev-util/meson:            1.2.1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             13.2.0::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.4::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-gentoo-linux-musl"
CC="clang"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--ask"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="en_US.UTF-8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed  -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j8"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
SHELL="/bin/bash"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="acl amd64 bzip2 clang cli crypt dbus dri iconv libtirpc llvm-libunwind ncurses nls nptl openmp pam pcre pic pulseaudio readline seccomp split-usr ssl test-rust unicode wayland xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS, SIZE, YACC, YFLAGS

```
Comment 2 Joonas Niilola gentoo-dev 2023-08-14 05:04:03 UTC
Are you using libcxx? Can you show 

 emerge -pv --nodeps clang-runtime

I can imagine rust-bin being incompatible with libcxx, while rust should work since you compile it yourself.
Comment 3 abanoub 2023-08-14 11:43:13 UTC
(In reply to Joonas Niilola from comment #2)
> Are you using libcxx? Can you show 
> 
>  emerge -pv --nodeps clang-runtime
> 
> I can imagine rust-bin being incompatible with libcxx, while rust should
> work since you compile it yourself.

Sure, here is the output:

These are the packages that would be merged, in order:

[ebuild   R    ] sys-devel/clang-runtime-16.0.6:16::gentoo  USE="compiler-rt libcxx openmp -sanitize" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

As you can see, yes, libcxx is enabled
Comment 4 abanoub 2023-08-14 18:36:52 UTC
(In reply to Joonas Niilola from comment #2)
> Are you using libcxx? Can you show 
> 
>  emerge -pv --nodeps clang-runtime
> 
> I can imagine rust-bin being incompatible with libcxx, while rust should
> work since you compile it yourself.


Apologies for taking a while to send this, I thought I did before but apparently I didn't.

These are the packages that would be merged, in order:

[ebuild   R    ] sys-devel/clang-runtime-16.0.6:16::gentoo  USE="compiler-rt libcxx openmp -sanitize" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 5 Larry the Git Cow gentoo-dev 2023-08-19 05:31:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b2faea4bb5bb263808bab0029fcc58e35cffaa4

commit 5b2faea4bb5bb263808bab0029fcc58e35cffaa4
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-08-17 08:00:45 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-08-19 05:27:54 +0000

    profiles/features/llvm/package.mask: preliminary -bin masks
    
    Closes: https://bugs.gentoo.org/912154
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/32318

 profiles/features/llvm/package.mask | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2023-08-20 13:37:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dff53419da7380b55046807ba451d9199eecff46

commit dff53419da7380b55046807ba451d9199eecff46
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-08-20 13:35:14 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-08-20 13:36:59 +0000

    Revert "profiles/features/llvm/package.mask: preliminary -bin masks"
    
    This reverts commit 5b2faea4bb5bb263808bab0029fcc58e35cffaa4.
    
     - not all use cases were taken into consideration. Need to re-think
       this approach - reverting to previous state for time being.
    
    Bug: https://bugs.gentoo.org/912154
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 profiles/features/llvm/package.mask | 11 -----------
 1 file changed, 11 deletions(-)
Comment 7 abanoub 2023-08-21 01:13:56 UTC
(In reply to Larry the Git Cow from comment #6)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=dff53419da7380b55046807ba451d9199eecff46
> 
> commit dff53419da7380b55046807ba451d9199eecff46
> Author:     Joonas Niilola <juippis@gentoo.org>
> AuthorDate: 2023-08-20 13:35:14 +0000
> Commit:     Joonas Niilola <juippis@gentoo.org>
> CommitDate: 2023-08-20 13:36:59 +0000
> 
>     Revert "profiles/features/llvm/package.mask: preliminary -bin masks"
>     
>     This reverts commit 5b2faea4bb5bb263808bab0029fcc58e35cffaa4.
>     
>      - not all use cases were taken into consideration. Need to re-think
>        this approach - reverting to previous state for time being.
>     
>     Bug: https://bugs.gentoo.org/912154
>     Signed-off-by: Joonas Niilola <juippis@gentoo.org>
> 
>  profiles/features/llvm/package.mask | 11 -----------
>  1 file changed, 11 deletions(-)

I dont know if this still applies, but when I ran clang glibc I did not have any problems with rust-bin, so im thinking a temporary workaround could be to just mask rust-bin for the llvm + musl profile since thats where this happened I experienced this.