From 256b4ef63c90e502c4a51745b9cb798a5d447d4d Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Wed, 13 May 2026 12:28:58 +0800 Subject: [PATCH] fix: TLS test failures on osx/win32/armv7 - tccmacho.c: add STT_TLS to convert_symbol() for Mach-O output - tests/tests2/Makefile: skip 144_tls on Win32 (no pthread.h) and remove arm from TLS arch list (QEMU user-mode cannot emulate MRC p15 TLS register access) --- tccmacho.c | 1 + tests/tests2/Makefile | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tccmacho.c b/tccmacho.c index e4f2097c..cee09fd7 100644 --- a/tccmacho.c +++ b/tccmacho.c @@ -1058,6 +1058,7 @@ static void convert_symbol(TCCState *s1, struct macho *mo, struct nlist_64 *pn) case STT_NOTYPE: case STT_OBJECT: case STT_FUNC: + case STT_TLS: case STT_SECTION: n.n_type = N_SECT; break; diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile index 4bda9a4b..0be8cf88 100644 --- a/tests/tests2/Makefile +++ b/tests/tests2/Makefile @@ -19,7 +19,7 @@ ifeq (,$(filter i386 x86_64,$(ARCH))) SKIP += 85_asm-outside-function.test # x86 asm SKIP += 127_asm_goto.test # hardcodes x86 asm endif -ifeq (,$(filter x86_64 riscv64 arm64 arm i386,$(ARCH))) +ifeq (,$(filter x86_64 riscv64 arm64 i386,$(ARCH))) SKIP += 144_tls.test # TLS only implemented on these architectures so far endif ifeq ($(CONFIG_backtrace),no) @@ -50,6 +50,7 @@ ifeq (-$(CONFIG_WIN32)-,-yes-) SKIP += 114_bound_signal.test # No pthread support SKIP += 117_builtins.test # win32 port doesn't define __builtins SKIP += 124_atomic_counter.test # No pthread support + SKIP += 144_tls.test # No pthread support endif ifneq (,$(filter OpenBSD FreeBSD NetBSD,$(TARGETOS))) SKIP += 106_versym.test # no pthread_condattr_setpshared