Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914849 - media-libs/mesa-23.2.0_rc4[video_cards_intel] fails with general protection fault
Summary: media-libs/mesa-23.2.0_rc4[video_cards_intel] fails with general protection f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard: Work around with USE=-llvm or USE=-vu...
Keywords:
Depends on:
Blocks: systemwide-mold
  Show dependency tree
 
Reported: 2023-09-27 18:31 UTC by Michelangelo Scopelliti
Modified: 2023-11-30 03:58 UTC (History)
2 users (show)

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


Attachments
build log (mesa-23.2.0_rc4:20230927-180405.log.gz,68.75 KB, application/gzip)
2023-09-27 18:31 UTC, Michelangelo Scopelliti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michelangelo Scopelliti 2023-09-27 18:31:43 UTC
Created attachment 871535 [details]
build log

when trying to compile mesa-23.2.0_rc4, the building fails with no apparent error (at least, to me). Instead, dmesg reports

traps: intel_clc[21187] general protection fault ip:55e19619e238 sp:7ffcb1fb4920 error:0 in intel_clc[55e195edd000+2ce000]

at the failure.

This happens with at least two different intel machines: a i7-7700 and a i5-11357G. I've also tried to switch to gentoo-kernel-bin, but nothing changed.

build log (MAKEOPTS="-j1") is attached.

emerge --info:

Portage 3.0.51 (python 3.11.5-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.38-r2, 6.5.5 x86_64)
=================================================================
System uname: Linux-6.5.5-x86_64-Intel-R-_Core-TM-_i7-7700_CPU_@_3.60GHz-with-glibc2.38
KiB Mem:    32574224 total,  24507504 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Wed, 27 Sep 2023 17:01:43 +0000
Head commit of repository gentoo: f2306275d19cbe3af31c08d70c126832f0e2d1d7

sh bash 5.2_p15-r6
ld GNU ld (Gentoo 2.41 p2) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.5::gentoo, 3.12.0_rc3::gentoo
dev-lang/rust:             1.72.0::gentoo
dev-util/cmake:            3.27.6-r1::gentoo
dev-util/meson:            1.2.1-r2::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.50::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.1::gentoo
sys-devel/gcc:             13.2.1_p20230826::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.6::gentoo, 17.0.1::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.1::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.5::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

kernelpanic
    location: /var/db/repos/kernelpanic
    masters: gentoo
    priority: 0
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native"
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"
CXXFLAGS="-O2 -pipe -march=native -mtune=native"
DISTDIR="/var/cache/distfiles"
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 -march=native -mtune=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live clean-logs compress-build-logs config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-elog split-log strict strict-keepdir unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr"
FFLAGS="-O2 -pipe -march=native -mtune=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--as-needed"
LEX="flex"
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"
RUSTFLAGS="-C target-cpu=native -C opt-level=3"
SHELL="/bin/bash"
USE="X acl acpi alsa amd64 amr ao avif bluray boost branding brotli bzip2 cairo cdda clang cli crypt cups curl dbus djvu dri dvb dvd elogind encode eselect-ldso exif fdk ffmpeg fftw flac fontconfig fortran fribidi gdbm gif gimp gmp gpm gsm gtk harfbuzz heif hwaccel iconv icu imlib inotify ipv6 jbig jemalloc jit jpeg jpeg2k jpegxl lapack lcms libass libnotify libproxy libsamplerate libtirpc llvm lto lz4 lzma lzo mng mp3 multilib natspec ncurses nls nptl offensive ogg openal opencl opencv openexr opengl openmp opus pam pango pcre pdf pipewire png policykit postproc postscript pulseaudio raw readline rubberband scanner seccomp smp sndfile sound sox speex spell split-usr ssl svg tbb test-rust theora threads tiff truetype udev udisks unicode usb v4l vaapi vdpau vidstab vim-syntax vorbis vpx vtk vulkan wavpack webp wmf x264 x265 xattr xcb xdg xetex xml xpm xv xvid zeroconf zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" 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 avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 wacom" KERNEL="linux" L10N="it en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="aarch64 arm x86_64" QEMU_USER_TARGETS="aarch64 arm x86_64" RUBY_TARGETS="ruby32" SANE_BACKENDS="hp" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Michelangelo Scopelliti 2023-09-28 14:50:42 UTC
Apparently, this is triggered by USE=vulkan.
USE=-vulkan allows for safe compilation
Comment 2 Michelangelo Scopelliti 2023-09-28 15:22:41 UTC
A few tests later..

I tried to rebuild both vulkan and opencl infrastructure (vulkan-headers, vulkan-tools, vulkan-loader; libclc; intel-compute-runtime) without success, I tried to disable mold linker for mesa. That solved the issue.

So, in conclusion: mesa-23.2.0_rc4 does not build with mold (2.2.0 at least)
Comment 3 Søren Dalby Larsen 2023-09-28 16:13:22 UTC
I can confirm on my intel laptop. Works fine on my AMD laptop with mold 2.2.
Comment 4 Matt Turner gentoo-dev 2023-09-29 01:26:02 UTC
I've been working on this issue for the past few days. Here's what I know so far:

- It happens only with llvm-17
- An issue has been filed with SPIRV-LLVM-Translator here (https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2153)
- Reverting upstream Mesa commit https://cgit.freedesktop.org/mesa/mesa/commit/?id=fb5ecbb4fe9d9f58afee341116def699f3bb8341 avoids the problem


... but your build log shows that you're using llvm-16! So, could it be a different issue...?

Can you post a backtrace by cd'ing to the build directory and running the failing command under `gdb --args <cmd>`, then "r<enter>" to start the program. It should run and crash, and then "bt<enter>" will print a backtrace. "q<enter>" will quit gdb.

That should tell me whether this is the same issue that I've been working on.

Thanks!
Comment 5 Matt Turner gentoo-dev 2023-09-29 01:27:16 UTC
Oh, another thing to mention: you can also work around this build failure by using USE=-llvm on mesa (though USE=-vulkan works too, as you discovered)
Comment 6 Michelangelo Scopelliti 2023-09-29 09:26:37 UTC
(In reply to Matt Turner from comment #4)
> I've been working on this issue for the past few days. Here's what I know so
> far:
> 
> - It happens only with llvm-17
> - An issue has been filed with SPIRV-LLVM-Translator here
> (https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2153)
> - Reverting upstream Mesa commit
> https://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=fb5ecbb4fe9d9f58afee341116def699f3bb8341 avoids the problem
> 
> 
> ... but your build log shows that you're using llvm-16! So, could it be a
> different issue...?

Well, it's not exactly me: LLVM_MAX_SLOT is set to 16 in the ebuild, while spirv requires 17... I think it was covered by other bugs and commit https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90da97e78ade65753dfb2e0fb30ec9067c5aa766
> 
> Can you post a backtrace by cd'ing to the build directory and running the
> failing command under `gdb --args <cmd>`, then "r<enter>" to start the
> program. It should run and crash, and then "bt<enter>" will print a
> backtrace. "q<enter>" will quit gdb.
> 
> That should tell me whether this is the same issue that I've been working on.
> 
> Thanks!

I've not experience with gdb. anyhow, I get

(gdb) r
Starting program: /usr/bin/env MESA_SHADER_CACHE_DISABLE=true /var/tmp/portage/media-libs/mesa-23.2.0_rc4/work/mesa-23.2.0-rc4-abi_x86_64.amd64/src/intel/compiler/intel_clc -p dg2 --prefix gfx125_bvh_build_BFS_BFS_pass1_indexed -e BFS_pass1_indexed --in ../mesa-23.2.0-rc4/src/intel/vulkan/grl/gpu/bvh_build_BFS.cl --in /var/tmp/portage/media-libs/mesa-23.2.0_rc4/work/mesa-23.2.0-rc4/src/intel/vulkan/grl/gpu/libs/lsc_intrinsics_fallback.cl -o src/intel/vulkan/grl/gfx125_bvh_build_BFS_BFS_pass1_indexed.h -- -cl-std=cl2.0 -D__OPENCL_VERSION__=200 -DMAX_HW_SIMD_WIDTH=16 -DMAX_WORKGROUP_SIZE=16 -I/var/tmp/portage/media-libs/mesa-23.2.0_rc4/work/mesa-23.2.0-rc4/src/intel/vulkan/grl/gpu -I/var/tmp/portage/media-libs/mesa-23.2.0_rc4/work/mesa-23.2.0-rc4/src/intel/vulkan/grl/include -include opencl-c.h
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
process 3890 is executing new program: /var/tmp/portage/media-libs/mesa-23.2.0_rc4/work/mesa-23.2.0-rc4-abi_x86_64.amd64/src/intel/compiler/intel_clc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000555555ba1238 in clc_initialize_llvm ()
(gdb) bt
#0  0x0000555555ba1238 in clc_initialize_llvm ()
#1  0x0000555555baad6b in clc_c_to_spirv ()
#2  0x0000555555b9f4e9 in clc_compile_c_to_spirv ()
#3  0x00005555558e2c10 in main ()


I hope that helps.

Meanwhile, 23.2.1 is out, and maybe spirv-llvm-translator fix would work. I'll give it a try later.
Comment 7 Michelangelo Scopelliti 2023-09-29 12:39:22 UTC
and, with mesa-23.2.1, with mold

U ] media-libs/mesa-23.2.1 [23.2.0_rc4] USE="X gles2 llvm opencl proprietary-codecs vulkan wayland zstd -d3d9 -debug -gles1 -lm-sensors -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan-overlay -xa -zink" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2" VIDEO_CARDS="intel -d3d12 (-freedreno) -lavapipe (-lima) -nouveau (-panfrost) -r300 -r600 -radeon -radeonsi (-v3d) (-vc4) -virgl (-vivante) -vmware"

I get the same results (this time, two fqailures):

FAILED: src/intel/vulkan/grl/gfx125_bvh_build_BFS_BFS_pass1_indexed.h
FAILED: src/intel/vulkan/grl/gfx125_bvh_build_BFS_BFS_pass1_indexed_batchable.h

gdb on the first:

(gdb) r
Starting program: /usr/bin/env MESA_SHADER_CACHE_DISABLE=true /var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1-abi_x86_64.amd64/src/intel/compiler/intel_clc -p dg2 --prefix gfx125_bvh_build_BFS_BFS_pass1_indexed_batchable -e BFS_pass1_indexed_batchable --in ../mesa-23.2.1/src/intel/vulkan/grl/gpu/bvh_build_BFS.cl --in /var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1/src/intel/vulkan/grl/gpu/libs/lsc_intrinsics_fallback.cl -o src/intel/vulkan/grl/gfx125_bvh_build_BFS_BFS_pass1_indexed_batchable.h -- -cl-std=cl2.0 -D__OPENCL_VERSION__=200 -DMAX_HW_SIMD_WIDTH=16 -DMAX_WORKGROUP_SIZE=16 -I/var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1/src/intel/vulkan/grl/gpu -I/var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1/src/intel/vulkan/grl/include -include opencl-c.h
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
process 23409 is executing new program: /var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1-abi_x86_64.amd64/src/intel/compiler/intel_clc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000555555ba0198 in clc_initialize_llvm ()
(gdb) bt
#0  0x0000555555ba0198 in clc_initialize_llvm ()
#1  0x0000555555ba9ccb in clc_c_to_spirv ()
#2  0x0000555555b9e449 in clc_compile_c_to_spirv ()
#3  0x00005555558e0f30 in main ()



on the second one:

(gdb) r
Starting program: /usr/bin/env MESA_SHADER_CACHE_DISABLE=true /var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1-abi_x86_64.amd64/src/intel/compiler/intel_clc -p dg2 --prefix gfx125_bvh_build_BFS_BFS_pass1_indexed_batchable -e BFS_pass1_indexed_batchable --in ../mesa-23.2.1/src/intel/vulkan/grl/gpu/bvh_build_BFS.cl --in /var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1/src/intel/vulkan/grl/gpu/libs/lsc_intrinsics_fallback.cl -o src/intel/vulkan/grl/gfx125_bvh_build_BFS_BFS_pass1_indexed_batchable.h -- -cl-std=cl2.0 -D__OPENCL_VERSION__=200 -DMAX_HW_SIMD_WIDTH=16 -DMAX_WORKGROUP_SIZE=16 -I/var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1/src/intel/vulkan/grl/gpu -I/var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1/src/intel/vulkan/grl/include -include opencl-c.h
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
process 23448 is executing new program: /var/tmp/portage/media-libs/mesa-23.2.1/work/mesa-23.2.1-abi_x86_64.amd64/src/intel/compiler/intel_clc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000555555ba0198 in clc_initialize_llvm ()
(gdb) bt
#0  0x0000555555ba0198 in clc_initialize_llvm ()
#1  0x0000555555ba9ccb in clc_c_to_spirv ()
#2  0x0000555555b9e449 in clc_compile_c_to_spirv ()
#3  0x00005555558e0f30 in main ()
Comment 8 Michelangelo Scopelliti 2023-11-10 14:20:34 UTC
mesa-23.3.0_rc3.ebuild is out, and I hit the same bug even disabling mold. I have the feeling that VIDEOCARDS=intel and USE=vulkan (and/or llvm) are not working well together.
Comment 9 Michelangelo Scopelliti 2023-11-10 18:25:27 UTC
(In reply to Michelangelo Scopelliti from comment #8)
> mesa-23.3.0_rc3.ebuild is out, and I hit the same bug even disabling mold. I
> have the feeling that VIDEOCARDS=intel and USE=vulkan (and/or llvm) are not
> working well together.

update: I didn't realize that dev-util/intel_clc had a separate ebuild. Building just intel_clc *without* mold allows mesa to be built with both llvm and vulkan in USE.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-25 13:06:20 UTC
Are the latest Mesa RCs ok now? I suspect they should be (see my comments in bug 918516).
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-25 13:06:30 UTC
(In reply to Sam James from comment #10)
> Are the latest Mesa RCs ok now? I suspect they should be (see my comments in
> bug 918516).

Maybe use latest mold + latest intel_clc too.
Comment 12 Michelangelo Scopelliti 2023-11-25 16:26:54 UTC
(In reply to Sam James from comment #11)
> (In reply to Sam James from comment #10)
> > Are the latest Mesa RCs ok now? I suspect they should be (see my comments in
> > bug 918516).
> 
> Maybe use latest mold + latest intel_clc too.

Testing with mold-2.3.3.
Building intel_clc-23.3.0_rc5 with mold, I've seen no issues; 

ebuild `equery w intel_clc` test

passes all the tests.

Building mesa-23.3.0_rc5 with intel_clc (built using mold) fails with the general protection fault trapped.

Rebuilding intel_clc _without_ mold allows mesa (using mold) to be built.
Comment 13 Rui Ueyama 2023-11-26 09:54:45 UTC
Hi, mold author here. I only have an AMD machine, so I fire up an Intel VM on AWS and tried to build mesa, and it indeed failed only when compiled wiht mold.

The cause seems to be that the mold linker failed to handle the object files compiled with `-mtls-model=gnu2` correctly.

I fixed the issue in https://github.com/rui314/mold/commit/000ce0ee52b8ded59a6f8f4fba6939a20b56449c. Can you try again with the above commit?
Comment 14 Michelangelo Scopelliti 2023-11-27 12:05:54 UTC
(In reply to Rui Ueyama from comment #13)
> Hi, mold author here. I only have an AMD machine, so I fire up an Intel VM
> on AWS and tried to build mesa, and it indeed failed only when compiled wiht
> mold.
> 
> The cause seems to be that the mold linker failed to handle the object files
> compiled with `-mtls-model=gnu2` correctly.
> 
> I fixed the issue in
> https://github.com/rui314/mold/commit/
> 000ce0ee52b8ded59a6f8f4fba6939a20b56449c. Can you try again with the above
> commit?

Tested, and it works: the patched mold built intel_clc, which in turn successfully built mesa.

Thank you.
Comment 15 Rui Ueyama 2023-11-27 12:25:14 UTC
Thank you for confirming. I'll release mold 2.4.0 shortly.
Comment 16 Larry the Git Cow gentoo-dev 2023-11-30 03:49:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23a47cce8ca65e27f5408aa0b4e6d6eb8fb77eab

commit 23a47cce8ca65e27f5408aa0b4e6d6eb8fb77eab
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-11-30 03:48:01 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-30 03:48:01 +0000

    sys-devel/mold: add 2.4.0
    
    Closes: https://bugs.gentoo.org/914849
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/mold/Manifest          |  1 +
 sys-devel/mold/mold-2.4.0.ebuild | 95 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+)
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-30 03:58:25 UTC
Thank you Rui!