riscv – How can I disable Thread-Local Storage (TLS) support when building the RISC-V toolchain for the 64-bit rv64imafd architecture?

I’m trying to build a RISC-V 64-bit toolchain with the IMAFD architecture on my Ubuntu machine, but I need to disable Thread-Local Storage (TLS) support.

Here’s what I’ve tried so far:

I used --disable-tls in my ./configure command.
I’ve also tried setting CFLAGS and LDFLAGS to -mno-tls-direct-seg-refs.

Despite these attempts, I still encounter TLS-related errors, such as the following during the build process:

error: implicit declaration of function ‘__builtin_thread_pointer’

Has anyone successfully disabled TLS for the RISC-V 64-bit toolchain? If so, could you please provide guidance or share the correct configuration steps?

Here’s my current configuration command:

./configure –prefix=/home/user/toolchain –with-arch=rv64imafd –with-abi=lp64d –with-cmodel=medany -disable-tls

Read more here: Source link