Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 930947 - sys-fs/xfsprogs: LTO build fails with Clang (configure: error: LTO not supported by compiler.)
Summary: sys-fs/xfsprogs: LTO build fails with Clang (configure: error: LTO not suppor...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2024-04-29 22:41 UTC by Denis Strizhkin
Modified: 2024-05-07 13:32 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,8.60 KB, text/x-log)
2024-04-29 22:41 UTC, Denis Strizhkin
Details
config.log (config.log,59.37 KB, text/x-log)
2024-04-29 23:45 UTC, Denis Strizhkin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Strizhkin 2024-04-29 22:41:03 UTC
Created attachment 891984 [details]
build.log

Get this error while compile xfsprogs on musl/llvm profile.

!!! 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.63 (python 3.11.9-final-0, default/linux/amd64/23.0/musl/llvm, [unavailable], musl-1
=================================================================
System uname: Linux-6.8.7-gentoo-dist-hardened-x86_64-AMD_Ryzen_5_5600X_6-Core_Processor-with-li
KiB Mem:    32768780 total,    975644 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 28 Apr 2024 19:42:27 +0000
Head commit of repository gentoo: 1eb89186a3d901eda7a0cd81a3ccc3634bcebe7e

Head commit of repository den4ik: 7c852c1c9f78e3bbc96d6218e50044159c8212ff

Timestamp of repository guru: Sat, 27 Apr 2024 18:48:20 +0000
Head commit of repository guru: c01bf5ee7595452c28f789063c59b81a57994df9

sh bash 5.2_p26-r1
ld LLD 18.1.4 (compatible with GNU linkers)
app-misc/pax-utils:       1.3.7::gentoo
app-shells/bash:          5.2_p26-r1::gentoo
dev-build/autoconf:       2.72-r1::gentoo
dev-build/automake:       1.16.5-r2::gentoo
dev-build/cmake:          3.29.2::gentoo
dev-build/libtool:        2.4.7-r4::gentoo
dev-build/make:           4.4.1-r1::gentoo
dev-build/meson:          1.4.0-r1::gentoo
dev-lang/perl:            5.38.2-r2::gentoo
dev-lang/python:          3.11.9::gentoo, 3.12.3::gentoo
dev-lang/rust:            1.77.1::gentoo
sys-apps/baselayout:      2.15::gentoo
sys-apps/openrc:          0.54::gentoo
sys-apps/sandbox:         2.38::gentoo
sys-devel/clang:          18.1.4::gentoo
sys-devel/lld:            18.1.4::gentoo
sys-devel/llvm:           17.0.6::gentoo, 18.1.4::gentoo
sys-kernel/linux-headers: 6.8-r1::gentoo (virtual/os-headers)
sys-libs/musl:            1.2.4-r1::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

den4ik
    location: /var/db/repos/den4ik
    sync-type: git
    sync-uri: https://github.com/denisstrizhkin/den4ik-overlay.git
    masters: gentoo
    volatile: False

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

Binary Repositories:

binhost
    priority: 9999
    sync-uri: https://ftp.lysator.liu.se/gentoo/releases/amd64/binpackages/23.0/x86-64-v3

Installed sets: @den4ik-portage, @den4ik-system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-pc-linux-musl"
CC="clang"
CFLAGS="-march=native -O3 -pipe -flto=thin"
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/
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-march=native -O3 -pipe -flto=thin"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5
FCFLAGS="-march=native -O3 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buil
FFLAGS="-march=native -O3 -pipe"
GENTOO_MIRRORS="https://ftp.lysator.liu.se/gentoo/"
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"
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
PORTAGE_TMPDIR="/var/tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
RUSTFLAGS="-C opt-level=3 -C target-cpu=native"
SHELL="/bin/bash"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet clang crypt cups dbus dist-kernel dri dts dvd dvdr elogind encode exif firewalld flac gif gpm gtk hardened heif iconv icu ipv6 jpeg jpeg2k lcms libnotify libtirpc llvm-libunwind lto mad mng mp3 mp4 mpeg mtp ncurses nftables ogg opengl openmp opus pam pango pcre pdf pgo pic pie pipewire png policykit ppds pulseaudio readline screencast sdl seccomp sound spell ssl startup-notification svg test-rust tiff truetype udev udisks unicode upower usb verify-sig vorbis vpx vulkan wayland webp wxwidgets x264 xattr xcb xft xml xv xvid zeroconf zlib" ABI_X86="64" ADA_TARGET="gcc_12" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="ru en ja" 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" QEMU_SOFTMMU_TARGETS="aarch64 x86_64" QEMU_USER_TARGETS="aarch64" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu radeonsi"
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, SIZE, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-29 23:02:30 UTC
Please include /var/tmp/portage/sys-fs/xfsprogs-6.7.0/work/xfsprogs-6.7.0/config.log.
Comment 2 Denis Strizhkin 2024-04-29 23:45:03 UTC
Created attachment 891986 [details]
config.log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-30 06:46:34 UTC
https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/m4/package_libcdev.m4#n180

I wonder if we can just spoof the cache vars. Or we only pass the configure arg for gcc and just let LTO be used via CFLAGS otherwise for clang.
Comment 4 Eli Schwartz 2024-05-02 23:36:24 UTC
Is there a general value to passing it into the configure script at all, given it doesn't really work to begin with?

As far as I can tell it does literally nothing in terms of build system integration other than enforcing -ffat-lto-objects. And that much appears to be cargo culting.

commit e61f1552aae4819194ad603222eedef4b08710a2
Author:     Darrick J. Wong <darrick.wong@oracle.com>
AuthorDate: Thu Mar 8 21:35:20 2018
Commit:     Eric Sandeen <sandeen@redhat.com>
CommitDate: Thu Mar 8 21:35:20 2018

    misc: enable link time optimization, if requested
    
    Enable link time optimization (LTO) if the builder requests it.  The
    extra link optimization results in smaller binaries.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: Eric Sandeen <sandeen@redhat.com>
    Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

 configure.ac          | 12 ++++++++++++
 debian/rules          |  4 ++--
 include/builddefs.in  |  9 +++++++++
 m4/package_libcdev.m4 | 26 ++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 2 deletions(-)


No actual explanation for why they bothered adding this.

Just drop it and use CFLAGS / LDFLAGS for everything as is standard for all other packages.
Comment 5 Larry the Git Cow gentoo-dev 2024-05-07 13:32:58 UTC
The bug has been closed via the following commit(s):

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

commit 2f8515da6f9a003a209b3de4e76c0cd837c76631
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-07 13:28:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-07 13:32:41 +0000

    sys-fs/xfsprogs: drop useless LTO configure arg
    
    As Eli points out on the bug, it only adds -flto -ffat-lto-objects. It
    also breaks with Clang unnecessarily.
    
    Closes: https://bugs.gentoo.org/930947
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/xfsprogs/xfsprogs-6.4.0.ebuild | 10 +++-------
 sys-fs/xfsprogs/xfsprogs-6.6.0.ebuild | 10 +++-------
 sys-fs/xfsprogs/xfsprogs-6.7.0.ebuild | 10 +++-------
 3 files changed, 9 insertions(+), 21 deletions(-)