Summary: | gui-libs/gtk-4.10.4 fails to compile on ~amd64 llvm profile ld.lld: error: target emulation unknown: -m or at least one .o file required | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Denis Strizhkin <strdenis02> |
Component: | Current packages | Assignee: | Gentoo Linux Gnome Desktop Team <gnome> |
Status: | CONFIRMED --- | ||
Severity: | major | CC: | darwinskernel, gentoo.bugs, gentoo.qxrin, leio, thymelizabeth, unhappy-ending, vimproved, w12101111 |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
See Also: |
https://gitlab.gnome.org/GNOME/gtk/-/issues/5672 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6156 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3186 https://github.com/gentoo/gentoo/pull/32204 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 920660 | ||
Bug Blocks: | 408963 | ||
Attachments: |
build.log
build.log (amd64, 4.10.4) gtk-4.10.4 build error build system ignores -fuse-ld |
Description
Denis Strizhkin
2023-06-08 20:18:27 UTC
Created attachment 863587 [details]
build.log
Created attachment 865090 [details]
build.log (amd64, 4.10.4)
Same here on amd64 musl/clang.
Does not seem to be a clang-16 issue, happens with clang-15 too on my machine. The same with my machine: gtk-4.10.4, but gtk-4.10.3 emerged without any bugs. [329/908] /usr/bin/msgfmt ../gtk-4.10.4/po/zh_HK.po -o po/zh_HK/LC_MESSAGES/gtk40.mo [330/908] /usr/bin/msgfmt ../gtk-4.10.4/po/zh_TW.po -o po/zh_TW/LC_MESSAGES/gtk40.mo [331/908] /usr/bin/glib-compile-resources --generate-header --internal --target=gtk/gtkresources.h --dependency-file=gtk/gtkresources.h.d --sourcedir=/var/tmp/portage/gui-libs/gtk-4.10.4/work/gtk-4.10.4/gtk --sourcedir=/var/tmp/portage/gui-libs/gtk-4.10.4/work/gtk-4.10.4-build/gtk --external-data --c-name _gtk --manual-register gtk/gtk.gresources.xml [332/908] /usr/bin/glib-compile-resources --generate --internal --target=gtk/gtk.gresource --dependency-file=gtk/gtk.gresource.d --sourcedir=/var/tmp/portage/gui-libs/gtk-4.10.4/work/gtk-4.10.4/gtk --sourcedir=/var/tmp/portage/gui-libs/gtk-4.10.4/work/gtk-4.10.4-build/gtk gtk/gtk.gresources.xml [333/908] /usr/lib/llvm/16/bin/ld.lld -z noexecstack -r -b binary gtk/gtk.gresource -o gtk/gtkresources_blob.o FAILED: gtk/gtkresources_blob.o /usr/lib/llvm/16/bin/ld.lld -z noexecstack -r -b binary gtk/gtk.gresource -o gtk/gtkresources_blob.o ld.lld: error: target emulation unknown: -m or at least one .o file required [334/908] /usr/bin/glib-compile-resources --generate-source --internal --target=gtk/gtkresources.c --dependency-file=gtk/gtkresources.c.d --sourcedir=/var/tmp/portage/gui-libs/gtk-4.10.4/work/gtk-4.10.4/gtk --sourcedir=/var/tmp/portage/gui-libs/gtk-4.10.4/work/gtk-4.10.4-build/gtk --external-data --c-name _gtk --manual-register gtk/gtk.gresources.xml [335/908] /usr/lib/python-exec/python3.11/meson --internal exe --capture docs/reference/gtk/gtk4-builder-tool.1 -- /usr/bin/rst2man.py --syntax-highlight=none ../gtk-4.10.4/docs/reference/gtk/gtk4-builder-tool.rst [336/908] /usr/lib/python-exec/python3.11/meson --internal exe --capture docs/reference/gtk/gtk4-broadwayd.1 -- /usr/bin/rst2man.py --syntax-highlight=none ../gtk-4.10.4/docs/reference/gtk/gtk4-broadwayd.rst emerge --info Portage 3.0.46 (python 3.11.4-final-0, default/linux/amd64/17.1/clang, gcc-12, glibc-2.37-r3, 6.1.31-gentoo-x86_64 x86_64) ================================================================= System uname: Linux-6.1.31-gentoo-x86_64-x86_64-AMD_Ryzen_7_5800X3D_8-Core_Processor-with-glibc2.37 KiB Mem: 32779908 total, 26117828 free KiB Swap: 31998972 total, 31998972 free Timestamp of repository gentoo: Mon, 03 Jul 2023 15:00:01 +0000 Head commit of repository gentoo: 2a0dca499f38a1f9f6f16076231376dbb1be64aa sh bash 5.1_p16-r6 ld GNU ld (Gentoo 2.40 p5) 2.40.0 ccache version 4.8.2 [disabled] app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r6::gentoo dev-lang/perl: 5.36.1-r2::gentoo dev-lang/python: 3.11.4::gentoo dev-lang/rust: 1.70.0::gentoo dev-util/ccache: 4.8.2::gentoo dev-util/cmake: 3.26.4-r1::gentoo dev-util/meson: 1.1.1::gentoo sys-apps/baselayout: 2.13-r1::gentoo sys-apps/openrc: 0.46::gentoo sys-apps/sandbox: 2.32::gentoo sys-devel/autoconf: 2.13-r7::gentoo, 2.71-r6::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.39-r5::gentoo, 2.40-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 16.0.5::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: 16.0.5::gentoo sys-devel/llvm: 16.0.5::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: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: False sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" ADDR2LINE="llvm-addr2line" AR="llvm-ar" AS="clang -c" CBUILD="x86_64-pc-linux-gnu" CC="clang" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" 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/revdep-rebuild /etc/sandbox.d /etc/terminfo" CPP="clang-cpp" CXX="clang++" CXXFLAGS="-O2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps y --complete-graph y" 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 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="-O2 -pipe" GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo https://ftp.jaist.ac.jp/pub/Linux/Gentoo/ https://ftp.riken.jp/Linux/gentoo/ https://mirror.ps.kz/gentoo/pub https://mirror.yandex.ru/gentoo-distfiles/" LANG="C.UTF8" LD="ld.lld" LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed " LEX="flex" MAKEOPTS="-j16" NM="llvm-nm" OBJCOPY="llvm-objcopy" OBJDUMP="llvm-objdump" PKGDIR="/var/cache/binpkgs" PORTAGE_BINHOST="https://ftp.jaist.ac.jp/pub/Linux/Gentoo/experimental/amd64/binpkg/default/linux/17.1/x86-64/" 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/bash" STRINGS="llvm-strings" STRIP="llvm-strip" USE="10bit 8bit acl amd64 bzip2 clang cli cpudetection crypt dbus dri elogind firmware fortran gdbm h264 iconv ipv6 libtirpc libvirt libvirtd llvm-libunwind multilib ncurses nls nptl opengl openh264 openmp pam pcre pipewire readline seccomp split-usr ssl test-rust truetype unicode vdpau verify-sig vulkan xattr zfs zlib zstd" 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput synaptics" KERNEL="linux" L10N="en-GB ja zh-CN zh-TW" 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="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu radeonsi virgl nvidia" 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, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS, SIZE, YACC, YFLAGS Created attachment 865108 [details]
gtk-4.10.4 build error
I can confirm the same error. However, this doesn't happen in gtk-4.10.3, which compiles fine. Something changed on the point release to cause this. I tried to use -fuse-ld=bfd to see if I got the same error and for some reason the build system is completely ignoring it and I'm still getting ld.lld: error: target emulation unknown: -m or at least one .o file required. Not sure what's going on with that, but that shouldn't happen. Created attachment 865212 [details]
build system ignores -fuse-ld
See build flags contain -fuse-ld=bfd, but still gets ld.lld error.
Interestingly I also added the gui-libs/gtk build to my GCC override profile (I'm on LLVM) in an attempt to work around the problem, and I run into the same issue - even with the environment settings forcing GCC toolkit, the ebuild seems to ignore it and forces a build against LLVM. (In reply to Chris from comment #9) > Interestingly I also added the gui-libs/gtk build to my GCC override profile > (I'm on LLVM) in an attempt to work around the problem, and I run into the > same issue - even with the environment settings forcing GCC toolkit, the > ebuild seems to ignore it and forces a build against LLVM. What happens when you use GCC but pass -fuse-ld=lld to your LDFLAGS? (In reply to unhappy-ending from comment #10) > (In reply to Chris from comment #9) > > Interestingly I also added the gui-libs/gtk build to my GCC override profile > > (I'm on LLVM) in an attempt to work around the problem, and I run into the > > same issue - even with the environment settings forcing GCC toolkit, the > > ebuild seems to ignore it and forces a build against LLVM. > > What happens when you use GCC but pass -fuse-ld=lld to your LDFLAGS? Sadly it's the same behavior. Here's the env file that I was pointing my compiler override at... CC="gcc" CXX="g++" AR="${CHOST}-ar" NM="${CHOST}-nm" RANLIB="${CHOST}-ranlib" COMMON_FLAGS="-O3 -march=native" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" LDFLAGS="-Wl,--as-needed -fuse-ld=lld" (In reply to Chris from comment #11) > (In reply to unhappy-ending from comment #10) > > (In reply to Chris from comment #9) > > > Interestingly I also added the gui-libs/gtk build to my GCC override profile > > > (I'm on LLVM) in an attempt to work around the problem, and I run into the > > > same issue - even with the environment settings forcing GCC toolkit, the > > > ebuild seems to ignore it and forces a build against LLVM. > > > > What happens when you use GCC but pass -fuse-ld=lld to your LDFLAGS? > > Sadly it's the same behavior. > > Here's the env file that I was pointing my compiler override at... > > CC="gcc" > CXX="g++" > > AR="${CHOST}-ar" > NM="${CHOST}-nm" > RANLIB="${CHOST}-ranlib" > > COMMON_FLAGS="-O3 -march=native" > CFLAGS="${COMMON_FLAGS}" > CXXFLAGS="${COMMON_FLAGS}" > LDFLAGS="-Wl,--as-needed -fuse-ld=lld" Same issue for me. Funny, 4.11.4 compiles just fine :( Must be something in the 4.10.4 build system. For a quick test I unmerged lld from my system and then used -fuse-ld=bfd and it compiled without a problem. Really not sure what's going on. I'm just going to mask 4.10.4 since the next release doesn't have the issue. That's not unexpected at all, as it got fixed upstream in 4.11.x. (In reply to Sam James from comment #13) > That's not unexpected at all, as it got fixed upstream in 4.11.x. Or, rather, it's workedaroundededed as it still needs Binutils. Seems like it's fixed in gui-libs/gtk-4.11.4 This came up as a support question in Discord today reported by who. I've confirmed the issue now only exists on stable gentoo llvm systems as using gui-libs/gtk-4.12.5 will solve the solve the issue however a further test is required if the STABLEREQ will be enough to close this in Gentoo or if it's just a workaround needing binutils as Sam highlighted. Steps to reproduce now are as follows: 1. Setup new llvm stage3 2. emerge -va gui-libs/gtk Result: [308/946] /usr/lib/llvm/16/bin/ld.lld -z noexecstack -r -b binary gtk/gtk.gresource -o gtk/gtkresources_blob.o FAILED: gtk/gtkresources_blob.o /usr/lib/llvm/16/bin/ld.lld -z noexecstack -r -b binary gtk/gtk.gresource -o gtk/gtkresources_blob.o ld.lld: error: target emulation unknown: -m or at least one .o file required Workaround currently tested as works for me: 1. add `=gui-libs/gtk-4.12.5 ~amd64` to /etc/portage/package.accept_keywords 2. emerge -va1 =gui-libs/gtk-4.12.5 Fixed in gtk-4.12.4. So can this bug and the associated GitHub PR be closed now? |