From 9f76fd047dfac89e5b7328183dc7b75432de45d2 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 8 May 2026 07:46:17 +0300 Subject: [PATCH] builtin: boehm fix for intel macs --- vlib/builtin/builtin_d_gcboehm.c.v | 11 ++++++++--- vlib/v/builder/gc_flags_test.v | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/vlib/builtin/builtin_d_gcboehm.c.v b/vlib/builtin/builtin_d_gcboehm.c.v index 6ecb775b2..53a20d729 100644 --- a/vlib/builtin/builtin_d_gcboehm.c.v +++ b/vlib/builtin/builtin_d_gcboehm.c.v @@ -56,9 +56,14 @@ $if dynamic_boehm ? { $if !use_bundled_libgc ? { $if macos { $if tinyc { - // tcc on macOS can leave the bundled GC archive symbols unresolved. - #flag @VEXEROOT/thirdparty/tcc/lib/libgc.dylib - #flag -Wl,-rpath,"@VEXEROOT/thirdparty/tcc/lib" + $if arm64 { + // tcc on macOS arm64 can leave the bundled GC archive symbols unresolved. + #flag @VEXEROOT/thirdparty/tcc/lib/libgc.dylib + #flag -Wl,-rpath,"@VEXEROOT/thirdparty/tcc/lib" + } $else { + // macOS amd64 tccbin only ships libgc.a (no .dylib). + #flag @VEXEROOT/thirdparty/tcc/lib/libgc.a + } } $else { #flag -L@VEXEROOT/thirdparty/tcc/lib #flag -lgc diff --git a/vlib/v/builder/gc_flags_test.v b/vlib/v/builder/gc_flags_test.v index e9f2867ac..b9ab08d0a 100644 --- a/vlib/v/builder/gc_flags_test.v +++ b/vlib/v/builder/gc_flags_test.v @@ -2,7 +2,7 @@ module builder import os -fn test_macos_tcc_boehm_uses_bundled_libgc_dylib() { +fn test_macos_tcc_boehm_uses_bundled_libgc() { $if !macos { return } @@ -18,7 +18,7 @@ fn test_macos_tcc_boehm_uses_bundled_libgc_dylib() { os.rm(exe_path) or {} } assert res.exit_code == 0 - assert res.output.contains('thirdparty/tcc/lib/libgc.dylib') - assert res.output.contains('-rpath') + // macOS amd64 tccbin only ships libgc.a (no .dylib). + assert res.output.contains('thirdparty/tcc/lib/libgc.a') assert !res.output.contains(' -lgc') } -- 2.39.5