Hi, I am experiencing this problem since mesa-18.* hit the tree. At some point linking breaks due to errors quoted below. It is easy fixable by adding -lpthread to each _LINKER rule in build.ninja, since I have multilib I must update c_LINKER, cpp_LINKER, c_CROSS_LINKER and cpp_CROSS_LINKER. After update I was finishing installation with ebuild ... compile install ... I have no idea why I am experiencing this, since no one ever reporte the problem it might be something my system specified, though I have the same problem on my another gentoo installation in another machine. The bug is shown below, below it my emerge --info. Regards, Rafał FAILED: src/gallium/targets/d3dadapter9/d3dadapter9.so.1.0.0 x86_64-pc-linux-gnu-g++ -m32 -o src/gallium/targets/d3dadapter9/d3dadapter9.so.1.0.0 'src/gallium/targets/d3dadapter9/src@gallium@targets@d3dadapter9@@d3dadapter9@sha/description.c.o' 'src/gallium/targets/d3dadapter9/src@gallium@targets@d3dadapter9@@d3dadapter9@sha/getproc.c.o' 'src/gallium/targets/d3dadapter9/src@gallium@targets@d3dadapter9@@d3dadapter9@sha/drm.c.o' -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,d3dadapter9.so.1 src/gallium/auxiliary/libgalliumvl_stub.a src/gallium/auxiliary/libgallium.a src/gallium/state_trackers/nine/libnine_st.a src/util/libmesa_util.a src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/softpipe/libsoftpipe.a src/gallium/winsys/nouveau/drm/libnouveauwinsys.a src/gallium/drivers/nouveau/libnouveau.a -Wl,--gc-sections -Wl,--version-script /var/tmp/portage/media-libs/mesa-18.2.4/work/mesa-18.2.4/src/gallium/targets/d3dadapter9/d3dadapter9.sym -lexpat -ldrm -ldrm -ldl -lm /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib/libsensors.so -lz -ldrm -ldrm -lexpat -lm -ldrm -ldrm_nouveau -Wl,--end-group -ldrm -ldrm_nouveau -march=core-avx2 -O2 -pipe -Wl,-O1 -Wl,--as-needed /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/auxiliary/libgallium.a(driver_ddebug_dd_context.c.o): in function `u_thread_create.constprop.1': dd_context.c:(.text+0x170f): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: dd_context.c:(.text+0x1744): undefined reference to `pthread_create' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: dd_context.c:(.text+0x1758): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: dd_context.c:(.text+0x1789): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/auxiliary/libgallium.a(driver_ddebug_dd_context.c.o): in function `dd_thread_join': dd_context.c:(.text+0x1808): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/auxiliary/libgallium.a(driver_rbug_rbug_core.c.o): in function `u_thread_create.constprop.18': rbug_core.c:(.text+0x192f): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: rbug_core.c:(.text+0x1964): undefined reference to `pthread_create' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: rbug_core.c:(.text+0x1978): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: rbug_core.c:(.text+0x19a9): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/auxiliary/libgallium.a(driver_rbug_rbug_core.c.o): in function `rbug_stop': rbug_core.c:(.text+0x1a44): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/state_trackers/nine/libnine_st.a(nine_state.c.o): in function `nine_csmt_worker': nine_state.c:(.text+0xc1d): undefined reference to `pthread_setname_np' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/state_trackers/nine/libnine_st.a(nine_state.c.o): in function `u_thread_create.constprop.30': nine_state.c:(.text+0x20bf): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: nine_state.c:(.text+0x20f4): undefined reference to `pthread_create' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: nine_state.c:(.text+0x2108): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: nine_state.c:(.text+0x2139): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/state_trackers/nine/libnine_st.a(nine_state.c.o): in function `nine_csmt_destroy': nine_state.c:(.text+0x5508): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/state_trackers/nine/libnine_st.a(threadpool.c.o): in function `_mesa_threadpool_create': threadpool.c:(.text+0x129): undefined reference to `pthread_create' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/state_trackers/nine/libnine_st.a(threadpool.c.o): in function `_mesa_threadpool_destroy': threadpool.c:(.text+0x1c1): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/gallium/auxiliary/libgallium.a(hud_hud_cpu.c.o): in function `query_api_thread_busy_status': hud_cpu.c:(.text+0x672): undefined reference to `pthread_getcpuclockid' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: hud_cpu.c:(.text+0x6cf): undefined reference to `pthread_getcpuclockid' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `util_queue_killall_and_wait': u_queue.c:(.text+0x1f1): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `util_queue_finish_execute': u_queue.c:(.text+0x2b4): undefined reference to `pthread_barrier_wait' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `u_thread_create.constprop.3': u_queue.c:(.text+0x2ff): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: u_queue.c:(.text+0x334): undefined reference to `pthread_create' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: u_queue.c:(.text+0x348): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: u_queue.c:(.text+0x379): undefined reference to `pthread_sigmask' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `util_queue_thread_func': u_queue.c:(.text+0x408): undefined reference to `pthread_setname_np' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `util_queue_init': u_queue.c:(.text+0x878): undefined reference to `pthread_once' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `util_queue_finish': u_queue.c:(.text+0xe5f): undefined reference to `pthread_barrier_init' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: u_queue.c:(.text+0xf0d): undefined reference to `pthread_barrier_destroy' /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/util/libmesa_util.a(u_queue.c.o): in function `util_queue_get_thread_time_nano': u_queue.c:(.text+0xfa2): undefined reference to `pthread_getcpuclockid' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. # emerge --info Portage 2.3.49 (python 3.6.5-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-7.3.0, glibc-2.27-r6, 4.19.0-gentoo x86_64) ================================================================= System uname: Linux-4.19.0-gentoo-x86_64-Intel-R-_Core-TM-_i5-4300U_CPU_@_1.90GHz-with-gentoo-2.4.1 KiB Mem: 12195260 total, 1318280 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Thu, 01 Nov 2018 13:00:01 +0000 Head commit of repository gentoo: d1474fc8328bf8afcf6c2fe32dad4610808bf02b sh bash 4.4_p12 ld GNU ld (Gentoo 2.31.1 p3) 2.31.1 app-shells/bash: 4.4_p12::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.26.2::gentoo dev-lang/python: 2.7.15::gentoo, 3.6.5::gentoo dev-util/cmake: 3.9.6::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/openrc: 0.38.3::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo sys-devel/binutils: 2.31.1-r1::gentoo sys-devel/gcc: 5.4.0-r4::gentoo, 7.3.0-r3::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r3::gentoo sys-devel/make: 4.2.1-r4::gentoo sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers) sys-libs/glibc: 2.27-r6::gentoo Repositories: gentoo location: /usr/portage 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-extra-opts: sync-rsync-verify-max-age: 24 system_private location: /usr/local/portage masters: gentoo priority: 0 bumblebee location: /var/lib/layman/bumblebee masters: gentoo priority: 50 kde location: /var/lib/layman/kde masters: gentoo priority: 50 posativ location: /var/lib/layman/posativ masters: gentoo priority: 50 steam-overlay location: /var/lib/layman/steam-overlay masters: gentoo priority: 50 x11 location: /var/lib/layman/x11 masters: gentoo priority: 50 Installed sets: @steam ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x PUEL skype-4.0.0.7-copyright cadsoft Oracle-BCLA-JavaSE google-chrome Mendeley-EULA Mendeley-terms OPERA-2014 OPERA-12 RAR Google-TOS StarUML-EULA teamspeak3" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=core-avx2 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=core-avx2 -O2 -pipe" DISTDIR="/usr/portage/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en_US pl de_DE" MAKEOPTS="-j2 --quiet" PKGDIR="/usr/portage/packages" 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 acm acpi activities aes alsa amd64 aspell avx avx2 bash-completion bindist bluetooth branding bzip2 c++0x cairo cdr cli crypt cups cxx dbus declarative dri dts dvdr egl elogind emboss encode exif fam ffmpeg flac fma3 fortran gdbm gif glamor gles gles1 gmp gnutls gpm iconv icu jpeg kde kde4 kerberos kipi kwallet laptop lcms libnotify libtirpc lm_sensors mad midi minimal mmx mmxext mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl nsplugin ntp ntplonly nvidia ogg opengl openmp pam pango pcre pdf phonon plasma pmu png policykit popcnt ppds pulseaudio qml qt3support qt5 readline sdl seccomp slang spell sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg tcpd thinkpad threads tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vim-syntax vorbis wayland widgets wxwidgets x264 xattr xcb xcomposite xft xml xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_default authn_file authz_core 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 proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http slotmem_shm socache_shmcb unixd" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock 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="evdev synaptics" KERNEL="linux" L10N="en pl de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" RUBY_TARGETS="ruby23" STEAMGAMES="source_engine tf2 witcher2" USERLAND="GNU" VIDEO_CARDS="intel i965 nouveau 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Please attach a full build log.
Created attachment 553822 [details] build.log
Created attachment 553824 [details, diff] patch file
Somehow my comment got dropped, I can reproduce this specifically for cross compiling from x86_64 -> x86 without LLVM (I don't have a pure x86 system to test with). The patch I attached fixes the build for me, if you could test it I'd appreciate it.
Worked for me.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb3fef9a8f43d4b973eaad8b162e8dcd3d992a3f commit eb3fef9a8f43d4b973eaad8b162e8dcd3d992a3f Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2018-11-02 21:23:03 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2018-11-02 21:23:52 +0000 media-libs/mesa: Add upstream patch to avoid build failure Closes: https://bugs.gentoo.org/670094 Signed-off-by: Matt Turner <mattst88@gentoo.org> ...2.4-meson-link-gallium-nine-with-pthreads.patch | 34 ++++++++++++++++++++++ media-libs/mesa/mesa-18.2.4.ebuild | 4 +++ 2 files changed, 38 insertions(+)
Thanks for the report! The patch you tested is now upstream. I've applied it to the 18.2.4 ebuild as well.