Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917422 - =sys-devel/gcc-13.2.1_p20231014 failed to compile with Arm64 Musl LLVM Stage3 rootfs
Summary: =sys-devel/gcc-13.2.1_p20231014 failed to compile with Arm64 Musl LLVM Stage3...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-16 13:41 UTC by labyrithfind
Modified: 2023-11-26 00:42 UTC (History)
1 user (show)

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


Attachments
Build log for gcc, under arm64 with LLVM+Musl clean rootfs (build.log.tar.xz,231.79 KB, application/x-xz)
2023-11-16 23:46 UTC, labyrithfind
Details

Note You need to log in before you can comment on or make changes to this bug.
Description labyrithfind 2023-11-16 13:41:29 UTC
Encounter the below error, when take trying to install gcc, for a Arm64 Gentoo rootfs (musl+LLVM) rootfs.

Error message is showing by below:

/var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
libtool: install: error: relink `liblsan.la' with the above command before installing it



Reproducible: Always

Steps to Reproduce:
1.Get a fresh Stage3 AArch64 Musl+LLVM Stage 3 Rootfs
2.Emerge =sys-devel/gcc-13.2.1_p20231014
3.Get the error message with the one we're shwoing
Actual Results:  
Looks like the system default LLVM+Clang compiler, is not able to properly link the libgcc_s.so.1 file, so here's the file metadata command check:

file /var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1
/var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1: DIY-Thermocam raw data (Lepton 2.x), scale 2048-0, spot sensor temperature 0.000000, unit celsius, color scheme 0, minimum point enabled, calibration: offset 0.000000, slope 590331839155724615680.000000





file /var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1
/var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1: DIY-Thermocam raw data (Lepton 2.x), scale 2048-0, spot sensor temperature 0.000000, unit celsius, color scheme 0, minimum point enabled, calibration: offset 0.000000, slope 590331839155724615680.000000
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-16 15:45:58 UTC
This is missing build.log, the tarball the gcc ebuild creates with additional logs, and emerge --info.
Comment 2 labyrithfind 2023-11-16 23:46:47 UTC
Created attachment 874911 [details]
Build log for gcc, under arm64 with LLVM+Musl clean rootfs
Comment 3 labyrithfind 2023-11-16 23:49:39 UTC
Hi Team,

I've updated the required info in this post, by below is the output for emerge --info, and in the attachment file, it's the build log for gcc.

Since this issue can be easily reproduce, you could also take try with the reproduce steps mentioned in the first post.

Thanks for great help on this!



Portage 3.0.51 (python 3.11.6-final-0, default/linux/arm64/17.0/musl/llvm, [unavailable], musl-1.2.3-r7, 6.6.0.2 aarch64)
=================================================================
System uname: Linux-6.6.0.2-aarch64-with-libc
KiB Mem:     xxx total,    139276 free
KiB Swap:   xxx total,  31448828 free
Timestamp of repository gentoo: Mon, 13 Nov 2023 00:45:01 +0000
Head commit of repository gentoo: 561d046c5fdbd2116da774a3744574f0c4e2a046
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.41 p2) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.6::gentoo, 3.12.0::gentoo
dev-util/cmake:            3.27.7::gentoo
dev-util/meson:            1.2.1-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::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.1::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3-r7::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-verify-jobs: 1
    sync-rsync-extra-opts: --new-compress
    sync-rsync-verify-metamanifest: yes

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://gentoo.osuosl.org/releases/arm64/binpackages/17.0/arm64_musl_llvm

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="aarch64-gentoo-linux-musl"
CC="clang"
CFLAGS=""
CHOST="aarch64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS=""
DISTDIR="/var/cache/distfiles"
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=""
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync news nodoc noinfo parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
INSTALL_MASK="/usr/share/locale /lib/systemd/*/*.* /usr/lib/systemd/*/*.*"
LANG="C.UTF8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j6"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--new-compress"
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 arm64 bzip2 clang cli crypt dri fortran iconv ipv6 libtirpc llvm-libunwind ncurses nptl openmp pam pcre pic readline seccomp split-usr ssl test-rust unicode xattr zlib" 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_ARM="edsp v8 vfp vfp-d32 vfpv3 vfpv4" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" 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="ruby32" VIDEO_CARDS="fbdev dummy v4l" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RUSTFLAGS, SIZE, YACC, YFLAGS
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-17 12:11:43 UTC
Try unsetting LD.
Comment 5 labyrithfind 2023-11-17 23:49:28 UTC
Hi @Sams,

Seems like clear the LD variable when compiling gcc, is not able to work.
The same issue happens during the link time:

libtool: relink:  /data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/./gcc/xgcc -shared-libgcc -B/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/./gcc -nostdinc++ -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libstdc++-v3/src -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libstdc++-v3/src/.libs -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libstdc++-v3/libsupc++/.libs -B/usr/aarch64-gentoo-linux-musl/bin/ -B/usr/aarch64-gentoo-linux-musl/lib/ -isystem /usr/aarch64-gentoo-linux-musl/include -isystem /usr/aarch64-gentoo-linux-musl/sys-include   -fchecking=1  -fPIC -DPIC -shared -nostdlib /usr/lib/../lib/crti.o /data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/./gcc/crtbeginS.o  .libs/lsan_common.o .libs/lsan_common_linux.o .libs/lsan_common_mac.o .libs/lsan.o .libs/lsan_linux.o .libs/lsan_mac.o .libs/lsan_malloc_mac.o .libs/lsan_allocator.o .libs/lsan_interceptors.o .libs/lsan_thread.o .libs/lsan_posix.o  -Wl,--whole-archive ../sanitizer_common/.libs/libsanitizer_common.a ../interception/.libs/libinterception.a ../libbacktrace/.libs/libsanitizer_libbacktrace.a -Wl,--no-whole-archive  -Wl,-rpath -Wl,/usr/lib/../lib -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libstdc++-v3/src/.libs -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libstdc++-v3/src -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libstdc++-v3/libsupc++/.libs -ldl -lrt -lpthread -Wl,--as-needed -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib -L/usr/lib/../lib -lstdc++ -lm -L/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/./gcc -L/usr/aarch64-gentoo-linux-musl/bin -L/usr/aarch64-gentoo-linux-musl/lib -L/lib/../lib -lssp_nonshared -lc -lgcc_s /data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/./gcc/crtendS.o /usr/lib/../lib/crtn.o  -Wl,-O1 -Wl,-O2   -Wl,-soname -Wl,liblsan.so.0 -o .libs/liblsan.so.0.0.0
/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
libtool: install: error: relink `liblsan.la' with the above command before installing it
make[4]: *** [Makefile:504: install-toolexeclibLTLIBRARIES] Error 1
make[4]: Leaving directory '/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libsanitizer/lsan'
make[3]: *** [Makefile:673: install-am] Error 2
make[3]: Leaving directory '/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libsanitizer/lsan'
make[2]: *** [Makefile:532: install-recursive] Error 1
make[2]: Leaving directory '/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build/aarch64-gentoo-linux-musl/libsanitizer'
make[1]: *** [Makefile:18289: install-target-libsanitizer] Error 2
make[1]: Leaving directory '/data/portage/portage/sys-devel/gcc-13.2.1_p20231014/work/build'
make: *** [Makefile:2624: install] Error 2
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-26 00:42:43 UTC
Did this ever work before on this system? Is there anything interesting about it?

What is /data/portage/portage/sys-devel/gcc-13.2.1_p20231014/image/usr/lib/../lib/libgcc_s.so.1? Could you upload it?