From 80fd66f7f832317310c8a770eed2cad73265bda7 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 13 May 2026 16:16:48 +0300 Subject: [PATCH] ci: avoid tcc for prealloc self-build --- ci/freebsd_ci.vsh | 4 +++- ci/linux_ci.vsh | 5 ++++- ci/openbsd_ci.vsh | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/freebsd_ci.vsh b/ci/freebsd_ci.vsh index 48f2d2d8b..ae08ac2ff 100644 --- a/ci/freebsd_ci.vsh +++ b/ci/freebsd_ci.vsh @@ -31,7 +31,9 @@ fn build_v_with_prealloc() { println('### Build v with prealloc') } exec('v -cg -cstrict -o vstrict1 cmd/v') - exec('./vstrict1 -o vprealloc -prealloc cmd/v') + // -prealloc uses _Thread_local for g_memory_block; bundled tcc does not support it. + prealloc_cc_flag := if os.getenv('VFLAGS').contains('-cc tcc') { ' -cc cc' } else { '' } + exec('./vstrict1${prealloc_cc_flag} -o vprealloc -prealloc cmd/v') exec('./vprealloc run examples/hello_world.v') exec('./vprealloc -o v3 cmd/v') exec('./v3 -o v4 cmd/v') diff --git a/ci/linux_ci.vsh b/ci/linux_ci.vsh index 51887d38f..c2fd4959c 100644 --- a/ci/linux_ci.vsh +++ b/ci/linux_ci.vsh @@ -1,4 +1,5 @@ import common { Task, exec } +import os // Shared tasks/helpers fn all_code_is_formatted() { @@ -41,7 +42,9 @@ fn v_doctor() { fn build_v_with_prealloc() { exec('v -cg -cstrict -o vstrict1 cmd/v') - exec('./vstrict1 -o vprealloc -prealloc cmd/v') + // -prealloc uses _Thread_local for g_memory_block; bundled tcc does not support it. + prealloc_cc_flag := if os.getenv('VFLAGS').contains('-cc tcc') { ' -cc cc' } else { '' } + exec('./vstrict1${prealloc_cc_flag} -o vprealloc -prealloc cmd/v') exec('./vprealloc run examples/hello_world.v') exec('./vprealloc -o v3 cmd/v') exec('./v3 -o v4 cmd/v') diff --git a/ci/openbsd_ci.vsh b/ci/openbsd_ci.vsh index d25f251cc..0488b43b0 100644 --- a/ci/openbsd_ci.vsh +++ b/ci/openbsd_ci.vsh @@ -31,7 +31,9 @@ fn build_v_with_prealloc() { println('### Build v with prealloc') } exec('v -cg -cstrict -o vstrict1 cmd/v') - exec('./vstrict1 -o vprealloc -prealloc cmd/v') + // -prealloc uses _Thread_local for g_memory_block; bundled tcc does not support it. + prealloc_cc_flag := if os.getenv('VFLAGS').contains('-cc tcc') { ' -cc cc' } else { '' } + exec('./vstrict1${prealloc_cc_flag} -o vprealloc -prealloc cmd/v') exec('./vprealloc run examples/hello_world.v') exec('./vprealloc -o v3 cmd/v') exec('./v3 -o v4 cmd/v') -- 2.39.5