Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 760777

Summary: dev-util/glslang-10.11.0.0_pre*: AST file was compiled with the target feature ...
Product: Gentoo Linux Reporter: Markus Peloquin <markus>
Component: Current packagesAssignee: Nick Sarnie <sarnex>
Status: UNCONFIRMED ---    
Severity: normal CC: jstein
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
glslang-10.11.0.0_pre20200924.ebuild.patch

Description Markus Peloquin 2020-12-19 20:30:29 UTC
It looks like the PCH CMakeFiles/MachineIndependent.dir/cmake_pch.hxx.pch was compiled with different flags than the rest of the code. My CPU doesn't support the LWP instruction set, so it's confusing how this could occur. See *Actual Results* below and the attached build log.

I noticed that if I go into the build directory and run `sudo -u portage ninja -j10` repeatedly, it eventually builds, suggesting some sort of race condition (I noticed that the PCH target file was cmake_pch.hxx.cxx, which seems like it should be cmake_pch.hxx.pch?). I think that the PCH file doesn't complete building before other targets begin using it.

Regardless, an easy fix is to disable PCH, and the build provided an option for that:

--- glslang-10.11.0.0_pre20200924.ebuild.old    2020-12-19 12:24:27.837598623 -0800
+++ glslang-10.11.0.0_pre20200924.ebuild        2020-12-19 12:16:41.324580528 -0800
@@ -28,3 +28,5 @@

 # Bug 698850
 RESTRICT="test"
+
+MYCMAKEARGS="-DENABLE_PCH=OFF"


Reproducible: Always

Actual Results:  
[16/69] /usr/lib/llvm/11/bin/clang++ -DENABLE_HLSL -DENABLE_OPT=0 -DGLSLANG_OSINCLUDE_UNIX -Iinclude  -march=native -mno-xop -O3 -pipe -flto=thin -fPIC   -Wall -Wuninitialized -Wunused -Wunused-local-typedefs -Wunused-parameter -Wunused-value -Wunused-variable -Wno-reorder -fno-rtti -fno-exceptions -pthread -std=c++11 -Xclang -include-pch -Xclang /var/tmp/portage/dev-util/glslang-10.11.0.0_pre20200924/work/glslang-10.11.0.0_pre20200924_build-abi_x86_64.amd64/glslang/CMakeFiles/MachineIndependent.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /var/tmp/portage/dev-util/glslang-10.11.0.0_pre20200924/work/glslang-10.11.0.0_pre20200924_build-abi_x86_64.amd64/glslang/CMakeFiles/MachineIndependent.dir/cmake_pch.hxx -MD -MT glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o -MF glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o.d -o glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o -c /var/tmp/portage/dev-util/glslang-10.11.0.0_pre20200924/work/glslang-bacaef3237c515e40d1a24722be48c0a0b30f75f/glslang/MachineIndependent/attribute.cpp
FAILED: glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o
/usr/lib/llvm/11/bin/clang++ -DENABLE_HLSL -DENABLE_OPT=0 -DGLSLANG_OSINCLUDE_UNIX -Iinclude  -march=native -mno-xop -O3 -pipe -flto=thin -fPIC   -Wall -Wuninitialized -Wunused -Wunused-local-typedefs -Wunused-parameter -Wunused-value -Wunused-variable -Wno-reorder -fno-rtti -fno-exceptions -pthread -std=c++11 -Xclang -include-pch -Xclang /var/tmp/portage/dev-util/glslang-10.11.0.0_pre20200924/work/glslang-10.11.0.0_pre20200924_build-abi_x86_64.amd64/glslang/CMakeFiles/MachineIndependent.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /var/tmp/portage/dev-util/glslang-10.11.0.0_pre20200924/work/glslang-10.11.0.0_pre20200924_build-abi_x86_64.amd64/glslang/CMakeFiles/MachineIndependent.dir/cmake_pch.hxx -MD -MT glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o -MF glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o.d -o glslang/CMakeFiles/MachineIndependent.dir/MachineIndependent/attribute.cpp.o -c /var/tmp/portage/dev-util/glslang-10.11.0.0_pre20200924/work/glslang-bacaef3237c515e40d1a24722be48c0a0b30f75f/glslang/MachineIndependent/attribute.cpp
error: AST file was compiled with the target feature '-lwp' but the current translation unit is not
error: current translation unit is compiled with the target feature '+lwp' but the AST file was not
2 errors generated.



Portage 3.0.9 (python 3.9.0-final-0, default/linux/amd64/17.1, gcc-9.3.0, glibc-2.32-r3, 5.10.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.0-gentoo-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-glibc2.32
KiB Mem:    16407372 total,   8423232 free
KiB Swap:   33554428 total,  33543860 free
Timestamp of repository gentoo: Sat, 19 Dec 2020 01:45:01 +0000
Head commit of repository gentoo: cdf57f779c7c6d4950229619bfbc46b33a6d69e4
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.8.7_rc1::local, 3.9.0::local
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            9.3.0-r2::gentoo
sys-devel/gcc-config:     2.3.2-r1::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.32-r3::gentoo
Repositories:

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

local
    location: /usr/local/portage
    masters: gentoo

libressl
    location: /var/lib/layman/libressl
    masters: gentoo
    priority: 50

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

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -mno-xop -O3 -pipe -flto=thin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXX="clang++"
CXXFLAGS="-march=native -mno-xop -O3 -pipe -flto=thin"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
ENV_UNSET="CARGO_HOME 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="-march=native -mno-xop -O3 -pipe -flto=thin"
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="-march=native -mno-xop -O3 -pipe -flto=thin"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O3 -fuse-ld=lld -rtlib=compiler-rt"
MAKEOPTS="-j9"
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 acl amd64 berkdb bzip2 cli crypt dri fontconfig iconv icu idn ipv6 libedit libglvnd libressl libtirpc lzma maildir mmx multilib ncurses nls nptl openmp pam pcre pic seccomp split-usr sse sse2 ssl tcpd udev unicode vim-syntax wayland xattr xcb zlib zsh-completion zstd" 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" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="libressl" 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="pc" INPUT_DEVICES="evdev keyboard libinput mouse" KERNEL="linux" L10N="de en fr nb nn no" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-util/glslang-10.11.0.0_pre20200924::gentoo was built with the following:
USE="" ABI_X86="(64) -32 (-x32)"
Comment 1 Markus Peloquin 2020-12-19 20:32:33 UTC
Created attachment 678838 [details]
build.log
Comment 2 Markus Peloquin 2020-12-19 20:35:02 UTC
Created attachment 678841 [details, diff]
glslang-10.11.0.0_pre20200924.ebuild.patch

This is the same patch from the bug description. It just adds ENABLE_PCH=OFF to the cmake options.
Comment 3 Nick Sarnie gentoo-dev 2020-12-20 17:05:27 UTC
I don't know what is going on but given this codebase, a race condition seems possible and the remedy is minor

Can you make a pull request please? 

https://wiki.gentoo.org/wiki/GitHub_Pull_Requests#Step_1:_User_updates_the_local_repository