The Amd64 (not ~Amd64) GCC fails to compile using Clang of LLVM as the compiler on Muslc system. This is first time I have received this error on my system. checking for x86_64-pc-linux-musl-gcc... /var/tmp/portage/sys-devel/gcc-13.3.1_p20240614/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-13.3.1_p2> checking for suffix of object files... configure: error: in `/var/tmp/portage/sys-devel/gcc-13.3.1_p20240614/work/build/x86_64-pc-linux-musl/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details make[2]: *** [Makefile:18659: configure-stage1-target-libgcc] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-13.3.1_p20240614/work/build' make[1]: *** [Makefile:24887: stage1-bubble] Error 2 make: *** [Makefile:25219: bootstrap-lean] Error 2
all bugs need emerge --info in a comment and the requested build.log compressed as an attachment
Portage 3.0.65 (python 3.12.3-final-0, default/linux/amd64/23.0/split-usr/musl/llvm, gcc-13, musl-1.2.4-r2, 6.6.35-gentoo-dist x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.6.35-gentoo-dist-x86_64-AMD_Ryzen_3_3200G_with_Radeon_Vega_Graphics-with-libc KiB Mem: 14247016 total, 10901032 free KiB Swap: 15625212 total, 15625212 free Timestamp of repository gentoo: Fri, 19 Jul 2024 00:00:00 +0000 Head commit of repository gentoo: 41e7869c9373bc510a94fe2fbac923a785f88e90 sh bash 5.2_p26-r6 ld LLD 17.0.6 (compatible with GNU linkers) app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p26-r6::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.71-r7::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.28.5::gentoo dev-build/libtool: 2.4.7-r4::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.4.1::gentoo dev-lang/perl: 5.38.2-r3::gentoo dev-lang/python: 3.11.9-r1::gentoo, 3.12.3-r1::gentoo dev-lang/rust: 1.77.1::gentoo dev-lang/rust-bin: 1.77.1::gentoo sys-apps/baselayout: 2.15::gentoo sys-apps/openrc: 0.54.2::gentoo sys-apps/sandbox: 2.38::gentoo sys-devel/clang: 17.0.6::gentoo sys-devel/gcc: 13.2.1_p20240210::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/lld: 17.0.6::gentoo sys-devel/llvm: 17.0.6::gentoo sys-kernel/linux-headers: 6.6-r1::gentoo (virtual/os-headers) sys-libs/musl: 1.2.4-r2::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-extra-opts: sync-rsync-verify-metamanifest: yes sync-rsync-verify-jobs: 1 sync-rsync-verify-max-age: 3 Binary Repositories: gentoobinhost priority: 1 sync-uri: https://gentoo.osuosl.org/releases/amd64/binpackages/23.0/x86-64_musl_llvm ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" ADDR2LINE="llvm-addr2line" AR="llvm-ar" AS="clang -c" CBUILD="x86_64-pc-linux-musl" CC="clang" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-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="-O2 -pipe" 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="-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 merge-wait network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" INSTALL_MASK="charset.alias /usr/share/locale/locale.alias" LANG="C.UTF8" LD="ld.lld" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed" LEX="flex" MAKEOPTS="-j4 -l4" 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/mksh" STRINGS="llvm-strings" STRIP="llvm-strip" USE="X acl airplay alsa amd64 blueray bluetooth bzip2 caps cdr cec cet clang crypt css dbus dvd elogind iconv ipv6 libtirpc llvm-libunwind ncurses nls openmp pam pcre pic pie readline seccomp split-usr ssl test-rust unicode xattr zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto 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, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RUSTFLAGS, SIZE, YACC, YFLAGS
Created attachment 898001 [details] build.log zip Zip file of build.log
(In reply to Greg Kubaryk from comment #1) > all bugs need emerge --info in a comment and the requested build.log > compressed as an attachment Thanks. All items have been added.
Created attachment 898107 [details] config.log Compressed config file.
I think you attached the wrong config.log file. Please attach this file: > /var/tmp/portage/sys-devel/gcc-13.3.1_p20240614/work/build/x86_64-pc-linux-musl/libgcc/config.log
Created attachment 898293 [details] gcc-14.1.1 config.log I am able to reproduce this issue on gcc-14.1.1_p20240720. I've attached the config.log. /usr/lib/llvm/18/bin/ld.lld --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -pie -dynamic-linker /lib/ld-musl-x86_64.so.1 -o a.out /lib/Scrt1.o /lib/crti.o /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/clang_rt.crtbegin-x86_64.o -L/lib -L/usr/lib -z relro -z now /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind --no-as-needed -lc /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind --no-as-needed /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/clang_rt.crtend-x86_64.o /lib/crtn.o ld.lld: error: undefined symbol: main >>> referenced by /lib/Scrt1.o:(_start_c)
Created attachment 898300 [details] emerge--info lto Here is my emerge --info as well. Given the error in config.log, my first guess was some kind of incompatibility caused by LTO. OP doesn't seem to have LTO enabled, however, and I'm getting the same errors with LTO off. Maybe OP is using LTO elsewhere?
I'm 99% sure you have to use GNU binutils right now for GCC.
(In reply to Sam James from comment #9) > I'm 99% sure you have to use GNU binutils right now for GCC. (specifically, at least LLVM's assembler isn't sufficient.)
Created attachment 898321 [details] gcc-build-logs Complete build logs
(In reply to James McGeehan IV from comment #11) > Created attachment 898321 [details] > gcc-build-logs > > Complete build logs This log has USE=lto. OP's doesn't. I think you might be having different issues which just look similar on the face of it. Please file a new bug.
OP, we need /var/tmp/portage/sys-devel/gcc-13.3.1_p20240614/work/build/x86_64-pc-linux-musl/libgcc/config.log and gcc-build-logs.tar.xz.
I re-installed sys-devel/binutils and that solved this issue on my end.
See https://briancallahan.net/blog/20240122.html for how we could fix this eventually.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d99053c9327d72eb0e13de964b0b79355caebc5b commit d99053c9327d72eb0e13de964b0b79355caebc5b Author: Sam James <sam@gentoo.org> AuthorDate: 2024-09-11 22:17:22 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-09-11 22:20:19 +0000 toolchain.eclass: depend on sys-devel/binutils:* GCC doesn't build in Gentoo at least without GNU Binutils. It is possible but it requires some work. It's not clear to me if some of that work needs to happen in LLVM upstream too (see below). In commits 7011340a0f13dcada6f3be48054957035bc6e01a and a7c27596827072f586dc07e6d53531ecb2c7cd6e, I tried to get things building with Clang's assembler but didn't get it over the line. I think I remember Arfrever and I coming up with a few later drafts (?) on IRC in #gentoo-hardened but I didn't commit any of it as it didn't work in the end anyway. But see https://briancallahan.net/blog/20240122.html which tackles at least one of the issues I ended up hitting before. In any case, add the dependency for now to keep things working. Closes: https://bugs.gentoo.org/936271 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 1 + 1 file changed, 1 insertion(+)