Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924681 - games-util/mangohud-9999 - Fails to Compile Regardless of Compiler (LLVM Profile)
Summary: games-util/mangohud-9999 - Fails to Compile Regardless of Compiler (LLVM Prof...
Status: UNCONFIRMED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Adel KARA SLIMANE
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-15 23:55 UTC by Neko-san
Modified: 2024-02-18 00:17 UTC (History)
3 users (show)

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


Attachments
LLVM Build Log (emerge_mangohud-guru_build.log,61.03 KB, text/x-log)
2024-02-15 23:56 UTC, Neko-san
Details
GCC Build Log (emerge_mangohud-guru_GCC-build.log,143.18 KB, text/x-log)
2024-02-15 23:56 UTC, Neko-san
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neko-san 2024-02-15 23:55:44 UTC
Mangohud fails to build under LLVM profiles; with Clang, it's due to what seems like libc++ and, for GCC, mangled symbols.

Reproducible: Always

Steps to Reproduce:
1. emerge mangohud::guru
Actual Results:  
Package fails to emerge both with Clang and GCC

Expected Results:  
Package to build with at least one compiler

Portage 3.0.61 (python 3.11.7-final-0, default/linux/amd64/17.1/clang, gcc-13, glibc-2.38-r10, 6.7.1-tkg-pds-gentoo-llvm-zen2 x86_64)
=================================================================
System uname: Linux-6.7.1-tkg-pds-gentoo-llvm-zen2-x86_64-AMD_Ryzen_7_3700X_8-Core_Processor-with-glibc2.38
KiB Mem:    32776968 total,   5714684 free
KiB Swap:   16777212 total,  16683260 free
Timestamp of repository gentoo: Thu, 15 Feb 2024 23:19:00 +0000
Head commit of repository gentoo: 9e54a0900b6188a463f97109c1d636a71f05ab4e

Timestamp of repository guru: Thu, 15 Feb 2024 15:05:21 +0000
Head commit of repository guru: 8adf4d292538166c497c1133cfb04134a8440b9c

Timestamp of repository steam-overlay: Mon, 12 Feb 2024 16:35:44 +0000
Head commit of repository steam-overlay: d984553a1549c63a93d840bd1ecbadbe54a582a8

Head commit of repository bobwya: 38abc7e7348cc7881b0ffc97db749893f06380ce

Head commit of repository farmboy0: b936baea493b2b35b79c5a3ed3dbfbd582b70df0

Head commit of repository librewolf: 1ca22da1c168b765ef877e9e21258d84438ab66a

Head commit of repository oxen-overlay: caa06ee33866f344b827f2bf7105839272cd7b3e

Head commit of repository src_prepare-overlay: fda6ae67fa8d7970fc31d1b63beffe6b38e67b32

Head commit of repository tatsh-overlay: 640fd2a2b49b9b5e01794a1d83323871790a39a8

Head commit of repository tezeta: 7a74149b63fb8ab04f61ea527374a9c9e7e70a76

Head commit of repository thegreatmcpain: 811dcfe54086e8aa17285f821b641b2f4c351506

Head commit of repository x0rzavi: e560dddb58c5baebc899623129a9db37f9a8da4b

Timestamp of repository xwing: Mon, 12 Feb 2024 16:35:46 +0000
Head commit of repository xwing: bc33c0fcc49c63f699459c539f77720da3d79014

sh lksh
ld GNU ld (Gentoo 2.41 p4) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r6::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.27.9::gentoo
dev-build/libtool:         2.4.7-r1::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.3.2::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1_p1::gentoo
dev-lang/rust:             1.74.1::gentoo
sys-apps/baselayout:       2.14-r2::gentoo
sys-apps/openrc:           0.53::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.41-r3::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20240113-r1::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.7::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r10::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    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

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

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

farmboy0
    location: /var/db/repos/farmboy0
    sync-type: git
    sync-uri: https://github.com/farmboy0/portage-overlay.git
    masters: gentoo
    priority: 50
    volatile: False

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

oxen-overlay
    location: /var/db/repos/oxen-overlay
    sync-type: git
    sync-uri: https://github.com/XutaxKamay/oxen-overlay.git
    masters: gentoo
    priority: 50
    volatile: False

src_prepare-overlay
    location: /var/db/repos/src_prepare-overlay
    sync-type: git
    sync-uri: https://gitlab.com/src_prepare/src_prepare-overlay.git
    masters: gentoo
    priority: 50
    volatile: False

tatsh-overlay
    location: /var/db/repos/tatsh-overlay
    sync-type: git
    sync-uri: https://github.com/Tatsh/tatsh-overlay.git
    masters: gentoo
    priority: 50
    volatile: False

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

thegreatmcpain
    location: /var/db/repos/thegreatmcpain
    sync-type: git
    sync-uri: https://gitlab.com/TheGreatMcPain/thegreatmcpain-overlay.git
    masters: gentoo
    priority: 50
    volatile: False

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

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="llvm-as"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=znver2 -pipe -minline-all-stringops -ftree-vectorize -O3 -fno-plt -ftrivial-auto-var-init=pattern -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fstack-protector-strong -fcf-protection -fPIC -ggdb3"
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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-march=znver2 -pipe -minline-all-stringops -ftree-vectorize -O3 -fno-plt -ftrivial-auto-var-init=pattern -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fstack-protector-strong -fcf-protection -fPIC -ggdb3"
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=znver2 -pipe -minline-all-stringops -ftree-vectorize -O3 -fno-plt -ftrivial-auto-var-init=pattern -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fstack-protector-strong -fcf-protection -fPIC -ggdb3"
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 multilib-strict network-sandbox news nostrip 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="-march=znver2 -pipe -minline-all-stringops -ftree-vectorize -O3 -fno-plt -ftrivial-auto-var-init=pattern -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fstack-protector-strong -fcf-protection -fPIC -ggdb3"
GENTOO_MIRRORS="https://gentoo.osuosl.org/"
LANG="en_US.utf8"
LD="ld.lld"
LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
LEX="flex"
MAKEOPTS="-j7"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="gzip"
PORTAGE_COMPRESS_FLAGS="-9 -R -p4"
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="-C opt-level=3 -C target-cpu=native -C codegen-units=1"
SHELL="/bin/bash"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="7z X a52 aac acl acpi activities alsa amd64 autotype bash-completion bluetooth branding browser browser-integration bzip2 cairo cdda cdr clang cli colord crash-handler crypt cups dbus declarative default-compiler-rt default-libcxx default-lld desktop-portal dhclient discover dri dts dvd dvdr echo-cancel elogind encode exif ffmpeg firewall flac flatpak fluidsynth fortran gbm gdbm gif gles2 gles3 gpm gstreamer gtk gui hardened iconv icu ipv6 iwd jack jack-client jpeg kde kwallet lcms legacy-systray libcxx libnotify libtirpc llvm-libunwind lm-sensors mad mgba mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openh264 openmp openssl opus pam pango pcre pdf pic pie pipewire pipewire-alsa plasma png policykit ppds pulseaudio qml qt5 raw readline resolvconf retroachievements rtc screencast sddm sdl seccomp sechash semantic-desktop share smart sound sound-server spell split-usr ssl startup-notification svg system-crontab system-man test-rust threads tiff timidity truetype udev udisks unicode upnp upower usb v4l vaapi vdpau vorbis vulkan wallpapers wav wayland widgets wired wxwidgets x264 xattr xcb xcsecurity xft xml xorg xscreensaver xv xvid zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2021" 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" 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" GRUB_PLATFORMS="efi-64" 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-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby31" SANE_BACKENDS="hp" VIDEO_CARDS="fbdev vesa dummy v4l lavapipe amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
YACC="byacc"
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_RSYNC_EXTRA_OPTS, PYTHONPATH, SIZE, YFLAGS
Comment 1 Neko-san 2024-02-15 23:56:38 UTC
Created attachment 885089 [details]
LLVM Build Log
Comment 2 Neko-san 2024-02-15 23:56:58 UTC
Created attachment 885090 [details]
GCC Build Log
Comment 3 Gonçalo Negrier Duarte 2024-02-16 16:55:30 UTC
@Neko-san That is a LD error in the linking stage, I don't know how to really solve it.
Most probably is a bug upstream to solve I the full gcc toolchain, using ld.bfd instead of ld.lld.

Bellow is my gcc-full.conf env, pls update for your make.conf settings:
```
COMMON_FLAGS="-march=native -O3 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
LDFLAGS="-Wl,--as-needed"

CC="gcc"
CXX="g++"
CPP="gcc -E"
AR="ar"
NM="nm"
RANLIB="ranlib"
LD=ld.bfd
OBJCOPY="objcopy"
```
Comment 4 Neko-san 2024-02-16 23:29:36 UTC
With some experimentation, it appears that `-fPIE` and `-pie` are the reason why with GCC. Not ideal, but removing those solves it.

As for Clang, it's straight up a source code issue.
Comment 5 Gonçalo Negrier Duarte 2024-02-17 00:40:53 UTC
Strange I don’t use that COMMON_FLAGS and still have problems linking using the llvm linker
Comment 6 Gonçalo Negrier Duarte 2024-02-17 00:41:19 UTC
Using gcc as the compiler
Comment 7 Adel KARA SLIMANE 2024-02-17 00:47:55 UTC
I just tested mangohud-9999 using gcc (Gentoo 13.2.1_p20240113-r1 p12) with 

COMMON_FLAGS="-O3 -march=native -pipe -fno-plt"

And not other setting and I had no issue emerging and installing. 

I will try llvm now.
Comment 8 Adel KARA SLIMANE 2024-02-17 00:59:51 UTC
Just tested with clang 17.0.6 (CC and CXX overrides), same flags as my previous message, no issues. 

I cannot build as soon as I use lld. This is most definitely an upstream issue.
Comment 9 Neko-san 2024-02-17 01:32:26 UTC
Are you using stdlibc++ or libc++?
On LLVM profiles, this is a big difference and that reflects in the Clang build log
Comment 10 Gonçalo Negrier Duarte 2024-02-17 02:00:58 UTC
(In reply to Neko-san from comment #9)
> Are you using stdlibc++ or libc++?
> On LLVM profiles, this is a big difference and that reflects in the Clang
> build log

Yes libc++ can get a big effect, for exemple even using the full gcc stack, obs-studio fail to compile in the LLVM profile (Bug 922163)
Comment 11 Adel KARA SLIMANE 2024-02-17 20:53:14 UTC
Okay I tried to build directly from source and got the same errors, it's an upstream issue. I opened a bug report in Github [1] please chime in if you can help.

[1] https://github.com/flightlessmango/MangoHud/issues/1240
Comment 12 Neko-san 2024-02-17 21:21:28 UTC
That's not the same Clang error associated with this issue but it's good to know regardless.
Comment 13 Adel KARA SLIMANE 2024-02-17 21:23:02 UTC
For now I did not even attempt using `libc++`, one thing at a time :P
Comment 14 Gonçalo Negrier Duarte 2024-02-18 00:17:36 UTC
@adel.ks@zegrapher.com I can try the patch and see if works with libc++