Open xen0n opened 4 weeks ago
When I built Glibc with -mtls-dialect=desc
there was no strange crashes. Note that the Glibc library code is built with -ftls-model=initial-exec
so only some tests use TLS descriptor.
Important finding: I have specifically enabled additional CFLAGS
for source debugging for glibc -- namely -ggdb3
.
These CFLAGS
work:
-O2 -pipe -march=la464 -mtune=la464 -mtls-dialect=desc
-O2 -pipe -march=la464 -mtune=la464 -mtls-dialect=desc -g
-O2 -pipe -march=la464 -mtune=la464 -mtls-dialect=desc -ggdb
-O2 -pipe -march=la464 -mtls-dialect=desc -ggdb
-O2 -pipe -march=loongarch64 -ggdb3
-O2 -pipe -march=la464 -ggdb3
These don't:
-O2 -pipe -march=la464 -mtls-dialect=desc -ggdb3
-O2 -pipe -march=loongarch64 -mtls-dialect=desc -ggdb3
So it's the combination of -mtls-dialect=desc -ggdb3
that produces the object code eventually crashing the BFD linker. Not related to code generation.
Is there a reduced test case (one or several .s file(s))?
This issue has been fixed, refefence:https://patchwork.sourceware.org/project/binutils/patch/20240906010012.910300-1-wangxin03@loongson.cn/
Example: Debian
mesa 24.2.0-2
build crashThis may be linked to the usage of TLSDESC, but I'm not sure at present.
On Gentoo I also noticed bus errors linking something while building
sys-libs/glibc
, with-mtls-dialect=desc
globally set. On another box without TLSDESC enabled, glibc built without problems, so this is again highly suspect.