Compiling cross-x86_64-w64-mingw32/gcc with posix threads on amdgcn triggers a bug in toolchain.eclass. The culprit is the following: ># toolchain.eclass > # TODO: amdgcn-amdhsa? > [[ ${CTARGET} == x86_64* ]] && confgcc+=( > --enable-offload-defaulted > --enable-offload-targets=nvptx-none > ) This does not happen with win32 threads for some reason, but is reproducible with posix threads and limited to the 64 bit target for obvious reasons. To reproduce this, just follow the wiki on enabling posix threads: https://wiki.gentoo.org/wiki/Mingw#POSIX_threads_for_Windows Reproducible: Always Steps to Reproduce: Environment: No nvptx offloading target available. 1. echo "cross-x86_64-w64-mingw32/gcc -fortran -vtv -sanitize -pie -hardened" >> /etc/portage/package.use/cross-x86_64-w64-mingw32-gcc 2. crossdev --target cross-x86_64-w64-mingw32 3. crossdev --genv 'EXTRA_ECONF="--enable-threads=posix"' --init-target --target cross-x86_64-w64-mingw32 # Wiki does not work here 4. sed -i -e '/mingw64-runtime/{d}' /etc/portage/package.use/cross-x86_64-w64-mingw32 5. echo "cross-x86_64-w64-mingw32/mingw64-runtime cet -selinux libraries idl tools -multilib" >>/etc/portage/package.use/cross-x86_64-w64-mingw32 6. emerge -1 --usepkg=n cross-x86_64-w64-mingw32/mingw64-runtime 7. emerge -1 --usepkg=n cross-x86_64-w64-mingw32/gcc Actual Results: gcc fails to compile with the config error: configure: error: Can't support offloading without support for plugins Expected Results: gcc should compile fine. toolchain.eclass should not add the offload-target nvptx-none, if it is not available. --enable-offload-defaulted should ignore missing plugins, but does not seem to work once posix is enabled for some reason. Maybe the environment gets messed up due to the EXTRA_ECONF. emerge --info Portage 3.0.66.1 (python 3.12.8-final-0, default/linux/amd64/23.0/hardened, gcc-14, glibc-2.40-r5, 6.6.62-gentoo-dist-hardened x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.6.62-gentoo-dist-hardened-x86_64-AMD_Ryzen_Threadripper_3990X_64-Core_Processor-with-glibc2.40 KiB Mem: 263748816 total, 231805324 free KiB Swap: 268435452 total, 268435452 free Timestamp of repository gentoo: Fri, 13 Dec 2024 00:45:00 +0000 Timestamp of repository arx-libertatis: Wed, 11 Dec 2024 12:06:12 +0000 Head commit of repository arx-libertatis: a9faaca6990d94aa4bc6570b644439bb0b11fae9 Timestamp of repository average: Wed, 11 Dec 2024 12:06:37 +0000 Head commit of repository average: e832735ae6cc1dcb8ad9b40813c4e155e43950cf Timestamp of repository guru: Fri, 13 Dec 2024 13:18:29 +0000 Head commit of repository guru: 5a54a80623a46978bb1990c7515398b53b7933f6 Timestamp of repository kde: Thu, 12 Dec 2024 22:48:21 +0000 Head commit of repository kde: 07d0ae629822ee3f0349b4e4ff150dbb4184d769 Timestamp of repository myrvolay: Wed, 11 Dec 2024 12:06:45 +0000 Head commit of repository myrvolay: ab0d4ffe6b4de0f7739825620fe8d1e89f0c0459 Timestamp of repository nest: Thu, 12 Dec 2024 22:05:15 +0000 Head commit of repository nest: fb3f904da5251d1ad7b6b3266532a229d6aa2fa6 Timestamp of repository pf4public: Thu, 12 Dec 2024 20:33:16 +0000 Head commit of repository pf4public: 549626a258acadaf024afac8dd2caa868c73d282 Timestamp of repository pg_overlay: Fri, 13 Dec 2024 00:33:19 +0000 Head commit of repository pg_overlay: 386bc17536922ec7d89e0413c8ec93b96322a3d2 Timestamp of repository robert7k: Fri, 13 Dec 2024 14:37:38 +0000 Head commit of repository robert7k: 3e80fefed11c1d35393f49d9cf4f6569664c03f0 Timestamp of repository steam-overlay: Wed, 11 Dec 2024 12:06:22 +0000 Head commit of repository steam-overlay: 94ba87e4a1cd7686d25b3520adee8a63e13785ee Timestamp of repository tastytea: Wed, 11 Dec 2024 12:06:33 +0000 Head commit of repository tastytea: 03198285f900305034d3bd74ba10b2aa7788f173 Timestamp of repository vaacus: Fri, 13 Dec 2024 13:18:29 +0000 Head commit of repository vaacus: 2da27d98f1b3a4c7e1c59e39d3522e233e10542a Timestamp of repository vapoursynth: Wed, 11 Dec 2024 12:06:23 +0000 Head commit of repository vapoursynth: 8cf99917da45eafcc643d45d1fedf4e391437d3b Timestamp of repository xoores: Wed, 11 Dec 2024 12:07:01 +0000 Head commit of repository xoores: 634f00216985b468bba4d751148c830a647999ed Timestamp of repository xwing: Thu, 12 Dec 2024 20:18:24 +0000 Head commit of repository xwing: ec06abeab131aa003f5127687263940538b11faa sh bash 5.2_p37 ld GNU ld (Gentoo 2.43 p3) 2.43.1 app-misc/pax-utils: 1.3.8::gentoo app-shells/bash: 5.2_p37::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.72-r1::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.30.6::gentoo dev-build/libtool: 2.4.7-r4::gentoo dev-build/make: 4.4.1-r100::gentoo dev-build/meson: 1.5.2::gentoo dev-java/java-config: 2.3.4::gentoo dev-lang/perl: 5.40.0-r1::gentoo dev-lang/python: 3.11.11_p1::gentoo, 3.12.8::gentoo, 3.13.1::gentoo dev-lang/rust-bin: 1.81.0-r101::gentoo, 1.82.0-r101::gentoo llvm-core/clang: 18.1.8-r6::gentoo, 19.1.4::gentoo llvm-core/lld: 18.1.8::gentoo, 19.1.4::gentoo llvm-core/llvm: 18.1.8-r6::gentoo, 19.1.4::gentoo sys-apps/baselayout: 2.17::gentoo sys-apps/openrc: 0.55.1::gentoo sys-apps/sandbox: 2.39::gentoo sys-devel/binutils: 2.43-r2::gentoo sys-devel/binutils-config: 5.5.2::gentoo sys-devel/gcc: 14.2.1_p20241116::gentoo sys-devel/gcc-config: 2.11::gentoo sys-kernel/linux-headers: 6.6-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.40-r5::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: webrsync sync-uri: https://ftp.fau.de/gentoo-portage priority: -1000 volatile: False sync-webrsync-verify-signature: yes arx-libertatis location: /var/db/repos/arx-libertatis sync-type: git sync-uri: https://github.com/gentoo-mirror/arx-libertatis.git masters: gentoo volatile: False average location: /var/db/repos/average sync-type: git sync-uri: https://github.com/gentoo-mirror/average.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 kde location: /var/db/repos/kde sync-type: git sync-uri: https://github.com/gentoo-mirror/kde.git masters: gentoo volatile: False myrvolay location: /var/db/repos/myrvolay sync-type: git sync-uri: https://github.com/gentoo-mirror/myrvolay.git masters: gentoo volatile: False nest location: /var/db/repos/nest sync-type: git sync-uri: https://github.com/gentoo-mirror/nest.git masters: gentoo volatile: False pf4public location: /var/db/repos/pf4public sync-type: git sync-uri: https://github.com/gentoo-mirror/pf4public.git masters: gentoo volatile: False pg_overlay location: /var/db/repos/pg_overlay sync-type: git sync-uri: https://github.com/gentoo-mirror/pg_overlay.git masters: gentoo volatile: False robert7k location: /var/db/repos/robert7k sync-type: git sync-uri: https://github.com/gentoo-mirror/robert7k.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 tastytea location: /var/db/repos/tastytea sync-type: git sync-uri: https://github.com/gentoo-mirror/tastytea.git masters: guru gentoo volatile: False vaacus location: /var/db/repos/vaacus sync-type: git sync-uri: https://github.com/gentoo-mirror/vaacus.git masters: gentoo volatile: False vapoursynth location: /var/db/repos/vapoursynth sync-type: git sync-uri: https://github.com/gentoo-mirror/vapoursynth.git masters: gentoo volatile: False xoores location: /var/db/repos/xoores sync-type: git sync-uri: https://github.com/gentoo-mirror/xoores.git masters: gentoo volatile: False xwing location: /var/db/repos/xwing sync-type: git sync-uri: https://github.com/gentoo-mirror/xwing.git masters: gentoo volatile: False zeuch location: /var/db/repos/zeuch masters: gentoo volatile: False crossdev location: /var/db/repos/crossdev masters: gentoo priority: 10 volatile: False Binary Repositories: fau-bin priority: 9999 sync-uri: https://ftp.fau.de/gentoo/releases/amd64/binpackages/23.0/x86-64_hardened bytemark-bin priority: 9998 sync-uri: https://mirror.bytemark.co.uk/gentoo/releases/amd64/binpackages/23.0/x86-64_hardened Installed sets: @steam ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -mtune=native -pipe -O2" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.9/conf /usr/share/sddm/scripts/Xsetup /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -mtune=native -pipe -O2" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS=" --autounmask-unrestricted-atoms=y --autounmask-keep-masks=y --autounmask=y --autounmask-continue=y --autounmask-write=y --buildpkg-exclude 'acct-*/* virtual/* sys-kernel/*-sources' --jobs=10 --load-average=10.0 --with-bdeps=y --usepkg=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 buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch parallel-install 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="-O2 -pipe" GENTOO_MIRRORS="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ https://mirror.dogado.de/gentoo https://ftp.agdsn.de/gentoo https://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ https://ftp.gwdg.de/pub/linux/gentoo/ https://ftp.uni-hannover.de/gentoo/ https://mirror.netcologne.de/gentoo/ https://mirror.netzwerge.de/gentoo/ https://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ https://ftp.halifax.rwth-aachen.de/gentoo/ https://ftp.tu-ilmenau.de/mirror/gentoo/ https://ftp.fau.de/gentoo https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ https://ftp.uni-stuttgart.de/gentoo-distfiles/" LANG="de_DE.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs" LEX="flex" LINGUAS="de de_DE en_US en" MAKEOPTS="-j128 -l96.0" 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" SHELL="/bin/bash" USE="a52 aac acl acpi alsa amd64 audiofile avi berkdb bzip2 cairo cdda cddb cdparanoia cdr cet clang cracklib crypt css cue cups cxx dbus dist-kernel djvu dri dv elogind emacs encode exif faac ffmpeg flac fontconfig fontforge foomaticdb ftp gd gdbm gif glamor gpm graphicsmagick gstreamer gtk gtk3 hardened iconv id3tag irc jpeg jpeg2k kf6compat ladspa libass libnotify libtirpc libwww lm_sensors logrotate lto lzo mad matroska mbox mng modules mp3 mpeg mtp multilib ncurses networkmanager nfs nls nptl nsplugin ogg oggvorbis openal opencl openexr opengl openmp oscar pam pcre pdf pgo pic pie png policykit portaudio python_single_targets_python3_12 qml qt6 raw readline samba sasl sdl seccomp session smp spell ssl ssp svg tcpd test-rust theora threads tiff udev udisks unicode usb v4l v4l2 vaapi vcd verify-sig vhosts vorbis vulkan wavpack wayland wimax wmf x264 x265 xattr xml xpm xtpax xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" AMDGPU_TARGETS="gfx1100" 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 navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="pc efi-64" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput evdev" KERNEL="linux" L10N="de en-US en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="X86 AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PERL_FEATURES="ithreads" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12 python3_11" RUBY_TARGETS="ruby32" VIDEO_CARDS="radeon radeonsi amdgpu zink" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= cross-x86_64-w64-mingw32/gcc-14.2.1_p20241116::crossdev was built with the following: USE="cet cxx lto nls openmp pgo (ssp) -ada -custom-cflags -d -debug (-default-stack-clash-protection) -default-znow -doc -fixed-point -fortran -go -graphite (-hardened) -ieee-long-double -jit -libssp -modula2 (-multilib) -objc -objc++ -objc-gc (-pch) (-pie) -rust -sanitize -systemtap -test (-time64) -valgrind -vanilla -vtv -zstd" ABI_X86="(64)" CFLAGS="-O2 -pipe" CXXFLAGS="-O2 -pipe"
Created attachment 913977 [details] Full gcc build log
(vadorovsky, could you add a CI job for this?)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4618bed8161e7e28c6704726cee0aebdf5f17109 commit 4618bed8161e7e28c6704726cee0aebdf5f17109 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-12-14 12:46:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-12-14 12:47:07 +0000 toolchain.eclass: don't try to enable offloading for non-linux --enable-offload-defaulted doesn't work with x86_64-w64-mingw32 and gets confused by plugin support not being available. Just disable it for non-Linux. Closes: https://bugs.gentoo.org/946397 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
(In reply to Sam James from comment #2) > (vadorovsky, could you add a CI job for this?) Sure thing, will do later today
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fa625c5967246ee3ffd59393b26379af4c91e8c commit 3fa625c5967246ee3ffd59393b26379af4c91e8c Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-02 23:30:56 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-02 23:31:57 +0000 toolchain.eclass: run fixincludes for x86_64-w32-mingw32 too This came up in a PR to add CI for mingw targets to crossdev, specifically https://github.com/gentoo/crossdev/actions/runs/12337160095/job/34430532180?pr=29. Bug: https://bugs.gentoo.org/925204 Bug: https://bugs.gentoo.org/946397 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57c187b2d74e2ac5a1a1dde590ba78f73d91f591 commit 57c187b2d74e2ac5a1a1dde590ba78f73d91f591 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-02 23:33:43 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-02 23:33:43 +0000 toolchain.eclass: run fixincludes for all mingw targets Same as 3fa625c5967246ee3ffd59393b26379af4c91e8c. x86_64-w64-mingw64 needs it too. Bug: https://bugs.gentoo.org/925204 Bug: https://bugs.gentoo.org/946397 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)