Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913661 - dev-libs/jansson-2.14-r1 fails to compile with LLVM 16 with LTO
Summary: dev-libs/jansson-2.14-r1 fails to compile with LLVM 16 with LTO
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: David Zero
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-04 23:09 UTC by Christopher Fore
Modified: 2023-09-05 14:45 UTC (History)
2 users (show)

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


Attachments
Build log for dev-libs/jansson-2.14-r1 (build.log,3.50 KB, text/x-log)
2023-09-04 23:09 UTC, Christopher Fore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Fore 2023-09-04 23:09:53 UTC
Created attachment 869749 [details]
Build log for dev-libs/jansson-2.14-r1

It compiles fine with GCC, GCC LTO, and LLVM w/o LTO. I also made sure the LDFLAGS matched each time.


emerge --info:

Portage 3.0.49 (python 3.11.5-final-0, default/linux/amd64/17.1/clang, gcc-12, glibc-2.37-r3, 6.1.46-gentoo-dist-hardened x86_64)
=================================================================
System uname: Linux-6.1.46-gentoo-dist-hardened-x86_64-AMD_Ryzen_9_5900HX_with_Radeon_Graphics-with-glibc2.37
KiB Mem:    32179120 total,  25498168 free
KiB Swap:    8011772 total,   8011772 free
Head commit of repository gentoo: 3a02b1fde32969bde68160e31dd3f30462aa87d2

Timestamp of repository guru: Sun, 03 Sep 2023 12:31:46 +0000
Head commit of repository guru: f6022b89db3d996fb78ce025b61e203337902997

Head commit of repository librewolf: 2e75069a7228b74506da4e4e63fdb46998a09840

Head commit of repository miapersonal: a42b6555ca8e100243e439f6b90d3b8c98c3dc9e

sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.5::gentoo
dev-lang/rust:             1.69.0-r1::gentoo
dev-util/cmake:            3.26.5-r2::gentoo
dev-util/meson:            1.1.1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.37::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/gcc:             12.3.1_p20230526::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:

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

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

librewolf
    location: /var/db/repos/librewolf
    sync-type: git
    sync-uri: https://codeberg.org/librewolf/gentoo.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

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

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://gentoo.osuosl.org/releases/amd64/binpackages/17.1/x86-64_llvm

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -O3 -flto=thin -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-march=native -O3 -flto=thin -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="-march=native -O3 -flto=thin -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict 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 -O3 -flto=thin -pipe"
GENTOO_MIRRORS="https://mirrors.rit.edu/gentoo/"
LANG="en_US.utf8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O2 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j14"
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/zsh"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet clang cli crypt cups dbus dri dts dvd dvdr elogind encode exif flac fortran gdbm gif gpm gtk gui hardened iconv icu ipv6 jpeg lcms libnotify libtirpc llvm-libunwind lto mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf pie pipewire png policykit ppds qt5 readline screencast sdl seccomp sound spell ssl ssp startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wayland wifi wxwidgets x264 xattr xcb xft xml xtpax xv xvid 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 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" 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" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, 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 1 Ionen Wolkens gentoo-dev 2023-09-04 23:27:41 UTC
!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-libs/jansson-2.14-r1/work/jansson-2.14/config.log

Albeit even without that I can guess what happened. It does tc-ld-force-bfd (I forget why, or if still needed -- think it was some version script junk), and then there's probably errors because it tried to use ThinLTO with bfd.

Ideally ebuild "should" strip-unsupported-flags to sort this out, but it wouldn't work right now. Had talked about this a bit back in:
https://github.com/gentoo/gentoo/pull/28355#discussion_r1032998656

tl;dr not much you can do right now but just not do lto with clang for this package.
Comment 2 Christopher Fore 2023-09-05 00:04:51 UTC
(In reply to Ionen Wolkens from comment #1)
> !!! Please attach the following file when seeking support:
> !!! /var/tmp/portage/dev-libs/jansson-2.14-r1/work/jansson-2.14/config.log
> 
> Albeit even without that I can guess what happened. It does tc-ld-force-bfd
> (I forget why, or if still needed -- think it was some version script junk),
> and then there's probably errors because it tried to use ThinLTO with bfd.
> 
> Ideally ebuild "should" strip-unsupported-flags to sort this out, but it
> wouldn't work right now. Had talked about this a bit back in:
> https://github.com/gentoo/gentoo/pull/28355#discussion_r1032998656
> 
> tl;dr not much you can do right now but just not do lto with clang for this
> package.

Sounds good! Apologies for not attaching the file, I'll remember that for next time.