FYI: 32bit mode build uses 64bit assembly. [ebuild U ] media-libs/mesa-20.1.0_rc3::gentoo [20.0.6::gentoo] USE="X classic dri3 egl gallium gbm gles2 libglvnd llvm lm-sensors osmesa unwind vaapi vdpau vulkan vulkan-overlay wayland xa xvmc zstd -d3d9 -debug -gles1 -opencl (-selinux) -test -valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="radeonsi (-freedreno) -i915 -i965 -intel -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon (-vc4) -virgl (-vivante) -vmware" 0 KiB clang -m32 -Isrc/mapi/shared-glapi/e4b98b6@@glapi@sha -Isrc/mapi/shared-glapi -I../mesa-20.1.0-rc3/src/mapi/shared-glapi -Isrc -I../mesa-20.1.0-rc3/src -Iinclude -I../mesa-20.1.0-rc3/include -Isrc/mapi -I../mesa-20.1.0-rc3/src/mapi -Xclang -fcolor-diagnostics -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -std=c99 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="20.1.0-rc3"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/issues"' -DUSE_ELF_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_EXECINFO_H -DHAVE_SYS_SHM_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="10.0.0"' -DUSE_LIBGLVND=1 -DHAVE_LIBUNWIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_LIBSENSORS=1 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wno-missing-field-initializers -fno-math-errno -fno-trapping-math -Qunused-arguments -fno-common -Werror=format -Wformat-security -O3 -march=znver2 -fPIC -pthread -Werror=pointer-arith -Werror=vla -Werror=gnu-empty-initializer -fvisibility=hidden -DMAPI_MODE_GLAPI '-DMAPI_ABI_HEADER="/md1/portage/portage/media-libs/mesa-20.1.0_rc3/work/mesa-20.1.0-rc3-abi_x86_32.x86/src/mapi/shared-glapi/glapi_mapi_tmp.h"' -MD -MQ 'src/mapi/shared-glapi/e4b98b6@@glapi@sha/.._entry.c.o' -MF 'src/mapi/shared-glapi/e4b98b6@@glapi@sha/.._entry.c.o.d' -o 'src/mapi/shared-glapi/e4b98b6@@glapi@sha/.._entry.c.o' -c ../mesa-20.1.0-rc3/src/mapi/entry.c <inline asm>:9:36: error: register %rip is only available in 64-bit mode movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax ^ <inline asm>:10:12: error: register %rax is only available in 64-bit mode movl %fs:(%rax), %r11d ^ <inline asm>:11:11: error: register %r11d is only available in 64-bit mode movl 4*0(%r11d), %r11d ^ <inline asm>:12:7: error: register %r11 is only available in 64-bit mode jmp *%r11 ^ <inline asm>:18:36: error: register %rip is only available in 64-bit mode movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax ^ <inline asm>:19:12: error: register %rax is only available in 64-bit mode movl %fs:(%rax), %r11d ^ <inline asm>:20:11: error: register %r11d is only available in 64-bit mode movl 4*1(%r11d), %r11d ^ <inline asm>:21:7: error: register %r11 is only available in 64-bit mode jmp *%r11 ^ <inline asm>:27:36: error: register %rip is only available in 64-bit mode movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax ^ <inline asm>:28:12: error: register %rax is only available in 64-bit mode movl %fs:(%rax), %r11d ^ <inline asm>:29:11: error: register %r11d is only available in 64-bit mode movl 4*2(%r11d), %r11d ^ <inline asm>:30:7: error: register %r11 is only available in 64-bit mode jmp *%r11 ^ <inline asm>:36:36: error: register %rip is only available in 64-bit mode movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax ^ <inline asm>:37:12: error: register %rax is only available in 64-bit mode movl %fs:(%rax), %r11d ^ <inline asm>:38:11: error: register %r11d is only available in 64-bit mode movl 4*3(%r11d), %r11d ^ <inline asm>:39:7: error: register %r11 is only available in 64-bit mode jmp *%r11 ^ <inline asm>:45:36: error: register %rip is only available in 64-bit mode movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax ^ <inline asm>:46:12: error: register %rax is only available in 64-bit mode movl %fs:(%rax), %r11d ^ <inline asm>:47:11: error: register %r11d is only available in 64-bit mode movl 4*4(%r11d), %r11d Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.0/desktop/plasma/systemd, gcc-10.1.0, glibc-2.31-r3, 5.6.12 x86_64) ================================================================= System uname: Linux-5.6.12-x86_64-AMD_Ryzen_9_3900X_12-Core_Processor-with-gentoo-2.7 KiB Mem: 32810872 total, 3578860 free KiB Swap: 15998972 total, 15996668 free Timestamp of repository gentoo: Fri, 15 May 2020 10:15:01 +0000 Head commit of repository gentoo: ca83545979124b6896b8167da9744166c5ee0ef8 sh bash 5.0_p17 ld GNU ld (Gentoo 2.34 p1) 2.34.0 distcc 3.3.3 x86_64-pc-linux-gnu [disabled] ccache version 3.7.9 [disabled] app-shells/bash: 5.0_p17::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.30.2::gentoo dev-lang/python: 2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.3::gentoo, 3.9.0_alpha6::gentoo dev-util/ccache: 3.7.9::gentoo dev-util/cmake: 3.17.2::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/sandbox: 2.18::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.16.2::gentoo sys-devel/binutils: 2.34::gentoo sys-devel/gcc: 9.3.0::gentoo, 10.1.0::gentoo sys-devel/gcc-config: 2.2.1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.6::gentoo (virtual/os-headers) sys-libs/glibc: 2.31-r3::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 24 localrepo location: /usr/local/portage masters: gentoo ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA Intel-SDP" CBUILD="x86_64-pc-linux-gnu" CC="clang" CFLAGS="-O3 -march=znver2 -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/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="-O3 -march=znver2 -pipe " DISTDIR="/sdd/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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 collision-protect 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 splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.fau.de/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://mirror.netcologne.de/gentoo/" LANG="pl_PL.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en pl" MAKEOPTS="-j24" 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="/md1/portage" USE="X a52 aac acl acpi activities alsa amd64 autotype bash-completion berkdb bluetooth bluez branding browser bzip2 cairo cdda cdr clang cli cmake crypt cups curl dbus declarative dri dts dvd dvdr emboss encode epoll exif ffmpeg flac fortran gdbm gif git gles gles2 gpm grub gtk htmlreport iconv icu initramfs ipv6 jbig jemalloc jpeg jpeg2k kde kipi kwallet lcms ldap libatomic libnotify libtirpc lm-sensors lm_sensors logrotate lzma mad mmx mng mp3 mp4 mpeg multilib ncurses network networkmanager nls nptl odbc ogg okteta opengl openh264 openmax openmp osmesa pam pango pcre pdf phonon plasma png policykit postgres postproc ppds pulseaudio python qml qt5 readline reviewboard rfc3779 rsync-verify savedconfig sctp sdl seccomp semantic-desktop smp snappy spatialite spell split-usr sqlite sse sse2 ssl sslv2 startup-notification svg system-harfbuzz system-icu system-jpeg system-jsoncpp system-libevent system-libvpx system-sqlite systemd systemtap tcpd threads thumbnail tiff tk truetype udev udisks unicode unwind upower usb user-session vaapi vdpau vorbis vulkan wayland webp widgets wxwidgets x264 x265 xa xattr xcb xml xpm xv xvid xvmc zlib 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes sse4_1 sse4_2 avx avx2 ssse3 sse sse2 sse3 mmx mmxext f16c fma popcnt fma fma3" 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" L10N="en pl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LLVM_TARGETS="AMDGPU AArch64 ARM NVPTX BPF WebAssembly" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres12" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_6 python3_7" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby27 ruby24" USERLAND="GNU" VIDEO_CARDS="vesa amdgpu fbdev radeonsi" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Please attach a build log. Also, when you report bugs please explicitly point out the fact that you're using clang as the system compiler.
Created attachment 639388 [details] build logs clang sure I'll remember this. Logs attached Same error ocurs with mesa-20.0.7, propably it is connected with llvm/clang update from 9 to 10, as with earlier mesa-20.0.6 when clang-9 was main compiler there were no problem at all.
I also encountered this problem and I think this is a issue of meson. Here is my test: ❯ cd /tmp ❯ mkdir meson_clang_test ❯ cd meson_clang_test ❯ meson init Using "meson_clang_test" (name of current directory) as project name. Using "meson_clang_test" (project name) as name of executable to build. Defaulting to generating a C language project. Sample project created. To build it run the following commands: meson builddir ninja -C builddir ❯ mkdir build ❯ cd build ❯ export CC="clang -m32" CXX="clang++ -m32" ❯ meson ../ The Meson build system Version: 0.54.1 Source dir: /tmp/meson_clang_test Build dir: /tmp/meson_clang_test/build Build type: native build Project name: meson_clang_test Project version: 0.1 Using 'CC' from environment with value: 'clang -m32' Using 'CC' from environment with value: 'clang -m32' C compiler for the host machine: clang -m32 (clang 10.0.0 "clang version 10.0.0 ") C linker for the host machine: clang -m32 ld.lld 10.0.0 Host machine cpu family: x86_64 Host machine cpu: x86_64 Build targets in project: 1 Found ninja-1.10.0 at /usr/bin/ninja ❯ rm -rf * ❯ export CC="gcc -m32" CXX="g++ -m32" ❯ meson ../ The Meson build system Version: 0.54.1 Source dir: /tmp/meson_clang_test Build dir: /tmp/meson_clang_test/build Build type: native build Project name: meson_clang_test Project version: 0.1 Using 'CC' from environment with value: 'gcc -m32' Using 'CC' from environment with value: 'gcc -m32' C compiler for the host machine: gcc -m32 (gcc 9.3.0 "gcc (Gentoo 9.3.0 p2) 9.3.0") C linker for the host machine: gcc -m32 ld.lld 10.0.0 Host machine cpu family: x86 Host machine cpu: i686 Build targets in project: 1 Found ninja-1.10.0 at /usr/bin/ninja Look at the "Host machine cpu family" and the "Host machine cpu". Mesa use this to determine which flags( -DUSE_X86_ASM or -DUSE_X86_64_ASM) to use (mesa's meson.build,line 1111) src/mapi/entry.c use this flags to include the corresponding asm code.
Yes, there is macro USE_X86_ASM and USE_X86_64_ASM which are defined by meson config in which they are defined based AFIR on host_machine.cpu_type(). I dont know meson at all (I use autotools and cmake on daily basis only) but for me looks like meson should have something like target_machine.cpu_type() as x86 is cross build on x86_64 instead of host_machine used there. I don't know how to fix this config
Created attachment 641066 [details] compressed build log from amd64 multilib with clang-9
I've never tested compiling mesa with clang, but I felt bored and so gave it a try with clang-9: this gives me the same error as you've got with clang-10, and it also happens the same way with mesa-20.0.7 and clang-9 You might want to try to fiddle a bit with meson then, trying either the newest or an older version than in tree.
I tried few mesons even 9999, all produce same error
*** Bug 724890 has been marked as a duplicate of this bug. ***
Fix in Meson: https://github.com/mesonbuild/meson/pull/7182 https://github.com/mesonbuild/meson/commit/9dc3ca2c1c9fbb47e731551c6432df144f725261
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61fb31c86760964f605b8e78cf9c6450a8a0fbbd commit 61fb31c86760964f605b8e78cf9c6450a8a0fbbd Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2020-05-24 16:41:30 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2020-05-24 16:41:59 +0000 dev-util/meson: bump to 0.45.2 Closes: https://bugs.gentoo.org/721786 Closes: https://bugs.gentoo.org/723224 Signed-off-by: Mike Gilbert <floppym@gentoo.org> dev-util/meson/Manifest | 1 + dev-util/meson/files/0.54.2-multilib-clang.patch | 181 +++++++++++++++++++++++ dev-util/meson/meson-0.54.2.ebuild | 86 +++++++++++ dev-util/meson/meson-9999.ebuild | 15 ++ 4 files changed, 283 insertions(+)