Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 736878 - cross-x86_64-w64-mingw32/gcc-9.3.0-r1 - In file included from .../work/gcc-9.3.0/libgcc/emutls.c:31: ./gthr-default.h:35:10: fatal error: pthread.h: No such file or directory
Summary: cross-x86_64-w64-mingw32/gcc-9.3.0-r1 - In file included from .../work/gcc-9....
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-12 13:53 UTC by Jeremy Sylvis
Modified: 2020-08-12 18:09 UTC (History)
0 users

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


Attachments
/var/log/portage/cross-x86_64-w64-mingw32-info.log (cross-x86_64-w64-mingw32-info.log,17.17 KB, text/plain)
2020-08-12 13:53 UTC, Jeremy Sylvis
Details
/var/log/portage/cross-x86_64-w64-mingw32-gcc-stage1.log.xz (cross-x86_64-w64-mingw32-gcc-stage1.log.xz,43.46 KB, application/x-xz)
2020-08-12 13:53 UTC, Jeremy Sylvis
Details
/var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/temp/gcc-config.logs.tar.xz (gcc-config.logs.tar.xz,52.12 KB, application/x-xz)
2020-08-12 13:55 UTC, Jeremy Sylvis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Sylvis 2020-08-12 13:53:02 UTC
Created attachment 654316 [details]
/var/log/portage/cross-x86_64-w64-mingw32-info.log

This fails both on version 20200326 and 20200801.

Command & output:

jsylvis@jsylvis-gentoo ~ $ sudo crossdev --stable --libc "~7.0.0" --target cross-x86_64-w64-mingw32
Password: 
LPKG=mingw64-runtime
LVER=~7.0.0
-                                                                                                                                                            
 * crossdev version:      20200801
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
 * Target Portage ARCH:   amd64
 * Target System:         x86_64-w64-mingw32
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           amd64

 * binutils:              binutils-[stable]
 * gcc:                   gcc-[stable]
 * libc:                  ~mingw64-runtime-7.0.0

 * CROSSDEV_OVERLAY:      /var/db/repos/localrepo-crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:         
                                                                                                                                                             
 * Autofixing mangled file: /var/db/repos/localrepo-crossdev/profiles/categories
 * leaving metadata/layout.conf alone in /var/db/repos/localrepo-crossdev
                                                                                                                                                             
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-binutils.log
 * Emerging cross-binutils ...                                                                                                                         [ ok ]
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-mingw64-runtime-headers.log
 * Emerging cross-mingw64-runtime-headers ...                                                                                                          [ ok ]
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...

 * error: gcc failed :(
 * 
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-x86_64-w64-mingw32-info.log
 * /var/log/portage/cross-x86_64-w64-mingw32-gcc-stage1.log.xz
 * /var/tmp/portage/cross-x86_64-w64-mingw32/gcc*/temp/gcc-config.logs.tar.xz

emerge --info:

jsylvis@jsylvis-gentoo ~ $ emerge --info '=cross-x86_64-w64-mingw32/gcc-9.3.0-r1::crossdev'        
Portage 2.3.103 (python 3.7.8-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-9.3.0, glibc-2.30-r8, 5.4.48-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.4.48-gentoo-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-gentoo-2.6
KiB Mem:    32852644 total,  21731084 free
KiB Swap:     525308 total,    525308 free
Timestamp of repository gentoo: Sun, 09 Aug 2020 23:00:01 +0000
Head commit of repository gentoo: 98ae81eb6cb40d4e52acc298381a1b91cc26eeb4
Head commit of repository overboard: be213c242b39e2076198140e265daf60a2e41061

sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.4-r1::gentoo
dev-util/cmake:           3.16.5::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 

overboard
    location: /var/db/repos/overboard
    sync-type: git
    sync-uri: https://github.com/piedar/overboard
    masters: gentoo

crossdev
    location: /var/db/repos/localrepo-crossdev
    masters: gentoo
    priority: 10

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE ValveSteamLicense"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver2 -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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=znver2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 8 --load-average 14.0"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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://gentoo.ussg.indiana.edu/ https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/ https://mirror.sjc02.svwh.net/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
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"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt cups curl dbus declarative dri dts dvd dvdr emboss encode exif ffmpeg flac fortran gdbm gif gpm gui iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify libtirpc mad mng mono mp3 mp4 mpeg multilib ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt5 raw rdp readline sdl seccomp semantic-desktop smp spell split-usr ssl startup-notification steamvr svg systemd tcpd tiff truetype udev udisks unicode upower usb vorbis vulkan widgets wxwidgets x264 xattr xcb xcomposite xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeremy Sylvis 2020-08-12 13:53:41 UTC
Created attachment 654318 [details]
/var/log/portage/cross-x86_64-w64-mingw32-gcc-stage1.log.xz
Comment 2 Jeremy Sylvis 2020-08-12 13:55:55 UTC
Created attachment 654320 [details]
/var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/temp/gcc-config.logs.tar.xz
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2020-08-12 17:16:33 UTC
In file included from /var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/work/gcc-9.3.0/libgcc/gthr.h:148,
                 from /var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/work/gcc-9.3.0/libgcc/emutls.c:31:
./gthr-default.h:35:10: fatal error: pthread.h: No such file or directory
   35 | #include <pthread.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [/var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/work/gcc-9.3.0/libgcc/static-object.mk:17: emutls.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/work/gcc-9.3.0/libgcc/unwind-c.c:240:1: warning: no previous prototype for ‘__gcc_personality_seh0’ [-Wmissing-prototypes]
  240 | __gcc_personality_seh0 (PEXCEPTION_RECORD ms_exc, void *this_frame,
      | ^~~~~~~~~~~~~~~~~~~~~~
In file included from /var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/work/gcc-9.3.0/libgcc/gthr.h:148,
                 from /var/tmp/portage/cross-x86_64-w64-mingw32/gcc-9.3.0-r1/work/gcc-9.3.0/libgcc/unwind-sjlj.c:31:
./gthr-default.h:35:10: fatal error: pthread.h: No such file or directory
   35 | #include <pthread.h>
      |          ^~~~~~~~~~~
compilation terminated.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-12 17:26:55 UTC
config.log says you have enabled --enable-threads=posix.

Looking at our toolchain.eclass It should not be: https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain.eclass#n936

For 2 reasons:
- it's a cross-compiler targets
- and it's a mingw target

Did you patch or override things locally? We need to find out where it comes from.
Comment 5 Jeremy Sylvis 2020-08-12 17:38:13 UTC
I was following this guide: https://wiki.gentoo.org/wiki/DXVK#From_source

The command immediately after the initial crossdev command was this:
echo "EXTRA_ECONF=\"--enable-threads=posix\"" >> /etc/portage/env/mingw-gcc.conf

So, if I'm understanding the toolchain right (and I'm new, I'm likely not), if the first run-through may have failed for something unrelated, this echo would have added the --enable-threads flag, and subsequent runthroughs would fail.

I'll purge those and try again.
Comment 6 Jeremy Sylvis 2020-08-12 18:09:35 UTC
That was exactly the issue. Thank you for the guidance and my apologies for wasting your time.

I'll update the wiki to provide some guidance for anyone else who gets stuck there and close this.