Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877585 - musl Clang profile errors compiling without GCC installed
Summary: musl Clang profile errors compiling without GCC installed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-18 22:22 UTC by Dante Robinson
Modified: 2022-10-19 00:43 UTC (History)
0 users

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


Attachments
ncurses build.log (build.log,12.78 KB, text/x-log)
2022-10-18 22:39 UTC, Dante Robinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dante Robinson 2022-10-18 22:22:16 UTC
Removed GCC from the clang/musl profile as I should be able to compile everything on my system however I can't really compile much as most packages throw this error

checking for x86_64-gentoo-linux-musl-gcc... clang
checking whether the C compiler works... no

why it's looking for GCC on a clang profile I am unsure. I tried changing the CHOST in my make.conf and it throws this error

checking build system type... Invalid configuration `x86_64-gentoo-linux-musl-clang': more than four components

Assuming this is a simple profile fix.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-18 22:33:32 UTC
You'll need to attach the full build.log, config.log, and emerge --info.

That check is completely fine - it's just looking for a compiler and it happens to look for ${CHOST}-gcc first. We have symlinks to make sure it finds Clang first in such cases.

CC & CXX are exported in profiles so it should be a non-issue. It's just about the order autoconf tests in.
Comment 2 Dante Robinson 2022-10-18 22:39:08 UTC
Created attachment 824707 [details]
ncurses build.log
Comment 3 Dante Robinson 2022-10-18 22:39:33 UTC
(In reply to Sam James from comment #1)
> You'll need to attach the full build.log, config.log, and emerge --info.
> 
> That check is completely fine - it's just looking for a compiler and it
> happens to look for ${CHOST}-gcc first. We have symlinks to make sure it
> finds Clang first in such cases.
> 
> CC & CXX are exported in profiles so it should be a non-issue. It's just
> about the order autoconf tests in.

I figured it wasn't needed cause it's like every package. I attached a build.log for ncurses.
Comment 4 Dante Robinson 2022-10-18 22:44:47 UTC
!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
!!! No gcc found. You probably need to 'source /etc/profile'
!!! to update the environment of this terminal and possibly
!!! other terminals also.
Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.0/musl/clang, [unavailable], musl-1.2.3, 5.19.16-x86_64 x86_64)
=================================================================
System uname: Linux-5.19.16-x86_64-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-libc
KiB Mem:    32782972 total,  10997960 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 18 Oct 2022 18:30:01 +0000
Head commit of repository gentoo: c16537f9b0375835920b82c9f506456dd3d47f44
Head commit of repository 12101111-overlay: 0762076f27492b3aebad28471896a20b6df51bdc

Timestamp of repository ROKO__: Mon, 17 Oct 2022 22:33:56 +0000
Head commit of repository ROKO__: 2e4b7c05f61caf37ab0868807b117419edf4eedb

Head commit of repository clang-musl: 3de08c089877b94660142b534a1cbb6fb7b2e468

Timestamp of repository gentoo-zh: Tue, 18 Oct 2022 12:22:04 +0000
Head commit of repository gentoo-zh: 97d6e700f8f36314b3db500ede659cbb8d8b5366

Timestamp of repository gentoobr: Mon, 17 Oct 2022 18:18:48 +0000
Head commit of repository gentoobr: 4a8ab94d33c1b049671db25653a759b3e0bfd485

Timestamp of repository guru: Mon, 17 Oct 2022 22:34:01 +0000
Head commit of repository guru: 5b03557a988585510c57464d7fa02847dca13804

Head commit of repository lto-overlay: 9e7b681b98b77e1e7f6ceff24a0d05f5798ec3e7

Timestamp of repository mv: Mon, 17 Oct 2022 22:33:56 +0000
Head commit of repository mv: ba90d9bf986d7c570b5b09c125346bfaae90b594

Timestamp of repository src_prepare-overlay: Mon, 17 Oct 2022 22:34:01 +0000
Head commit of repository src_prepare-overlay: ccc5b4c81fe99108f3ad4de7fa9fea40ad68679b

Timestamp of repository tatsh-overlay: Tue, 18 Oct 2022 03:33:53 +0000
Head commit of repository tatsh-overlay: 1a6b221328d03734f1288ea278e31fb7cb6f8b02

Head commit of repository toolchain-clang: e2ddd0cf73d9d34d3ae77052c241d53c28ac4e20

Timestamp of repository wayland-desktop: Tue, 18 Oct 2022 03:47:59 +0000
Head commit of repository wayland-desktop: 91ec52610aa2bbdc3f9a927b4019db0afb46e66d

Timestamp of repository musl: Sat, 15 Oct 2022 17:49:05 +0000
Head commit of repository musl: b7cb287ba8a02c7610135e7fbb3fe05ad9b3081f

sh bash 5.1_p16-r1
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.10.8::gentoo
dev-lang/rust:             1.64.0-r1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45.2-r1::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6-r1::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.6::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3::gentoo
Repositories:

Repos removed

Installed sets: @llvm
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-gentoo-linux-musl"
CC="clang"
CFLAGS="-march=native -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -O2 -pipe "
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /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 -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -march=native -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -O2 -pipe "
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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 -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -march=native -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -O2 -pipe "
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news 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="-march=native -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -march=native -mtune=native -O3 -pipe -fomit-frame-pointer -fno-plt -O2 -pipe "
GENTOO_MIRRORS="https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ https://mirrors.rit.edu/gentoo/"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="C.UTF8"
LD="ld.lld"
LDFLAGS="-march=native -mtune=native -fuse-ld=mold -flto=thin -Wl,-O3,-zrelro,-znow"
MAKEOPTS="-j32 -l32"
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"
RUSTFLAGS="-Ctarget-cpu=native -Copt-level=3 -Clink-arg=-fuse-ld=/usr/bin/mold -Ctarget-feature=-crt-static -Clinker=clang -Clinker-plugin-lto -Clink-arg=-flto=thin"
SHELL="/bin/bash"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="alsa amd64 bzip2 clang cli crypt custom-cflags dri ffmpeg fortran gif hardened iconv ipv6 jpeg libedit libglvnd libnotify libtirpc llvm-libunwind lto minimal ncurses nptl opengl openmp opus pam pdf pic pie pipewire png readline screencast sdl seccomp split-usr ssl test-rust truetype udev unicode usb v4l vaapi vulkan wayland xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2020" 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" 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" L10N="en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="luajit lua5-4" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SIZE, YACC, YFLAGS
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-18 22:48:42 UTC
Note that you can't "just" change CHOST - it involves a complicated procedure, and cannot have an additional "-clang" suffix (it's a triple, not a tuple).

Anyway, there's no problem here, right?
Comment 6 Dante Robinson 2022-10-18 23:54:52 UTC
(In reply to Sam James from comment #5)
> Note that you can't "just" change CHOST - it involves a complicated
> procedure, and cannot have an additional "-clang" suffix (it's a triple, not
> a tuple).
> 
> Anyway, there's no problem here, right?

CHOST works without -clang but still looks for gcc first like you said I tried that first I'll remove it from my make.conf. Maybe the issue is LTO related then if its skipping over gcc and using clang just odd it compiles some packages and not others.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-19 00:00:34 UTC
(In reply to Dante Robinson from comment #6)
> (In reply to Sam James from comment #5)
> > Note that you can't "just" change CHOST - it involves a complicated
> > procedure, and cannot have an additional "-clang" suffix (it's a triple, not
> > a tuple).
> > 
> > Anyway, there's no problem here, right?
> 
> CHOST works without -clang but still looks for gcc first like you said I
> tried that first I'll remove it from my make.conf. Maybe the issue is LTO
> related then if its skipping over gcc and using clang just odd it compiles
> some packages and not others.

ncurses for example definitely respects CC but it uses a rather old autoconf, hence the odd messages.

If you find packages actually don't respect CC, please file bugs individually for them, but there's no issue here -- it's cosmetic.
Comment 8 Dante Robinson 2022-10-19 00:43:50 UTC
(In reply to Sam James from comment #7)
> (In reply to Dante Robinson from comment #6)
> > (In reply to Sam James from comment #5)
> > > Note that you can't "just" change CHOST - it involves a complicated
> > > procedure, and cannot have an additional "-clang" suffix (it's a triple, not
> > > a tuple).
> > > 
> > > Anyway, there's no problem here, right?
> > 
> > CHOST works without -clang but still looks for gcc first like you said I
> > tried that first I'll remove it from my make.conf. Maybe the issue is LTO
> > related then if its skipping over gcc and using clang just odd it compiles
> > some packages and not others.
> 
> ncurses for example definitely respects CC but it uses a rather old
> autoconf, hence the odd messages.
> 
> If you find packages actually don't respect CC, please file bugs
> individually for them, but there's no issue here -- it's cosmetic.

This is an LTO issue my bad.