From 3378a7d92ea361147f48513a748889f87ca52340 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 7 May 2026 08:35:20 +0300 Subject: [PATCH] all: fix more tests --- vlib/v/builder/builder_test.v | 2 +- vlib/v/builder/cc.v | 3 ++- vlib/v/gen/c/coutput_test.v | 2 +- vlib/v/gen/c/testdata/windows_callconv_generated_c.vv | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vlib/v/builder/builder_test.v b/vlib/v/builder/builder_test.v index e916a62b5..92f1f537a 100644 --- a/vlib/v/builder/builder_test.v +++ b/vlib/v/builder/builder_test.v @@ -376,6 +376,6 @@ fn test_macos_arch_flag_is_forwarded_to_c_compiler() { out_file := os.join_path(test_path, 'macos_arch_forwarding') os.write_file(src_file, 'fn main() {\n\tprintln("hello")\n}\n')! flags_output := - run_v_ok('${os.quoted_path(vexe)} -gc none -showcc -skip-running -arch amd64 -o ${os.quoted_path(out_file)} ${os.quoted_path(src_file)}') + run_v_ok('${os.quoted_path(vexe)} -cc clang -gc none -showcc -skip-running -arch amd64 -o ${os.quoted_path(out_file)} ${os.quoted_path(src_file)}') assert flags_output.contains('-arch x86_64') } diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 42307b265..07d2ed2dd 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -632,7 +632,8 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) { if ccoptions.cc == .unknown { eprintln('Compilation with unknown C compiler `${cc_file_name}`') } - if v.pref.os == .macos { + if v.pref.os == .macos && ccoptions.cc != .tcc { + // tcc does not understand -arch; it only targets the host arch. darwin_target_arch := darwin_target_arch_name(v.pref.arch) if darwin_target_arch != '' { ccoptions.args << ['-arch', darwin_target_arch] diff --git a/vlib/v/gen/c/coutput_test.v b/vlib/v/gen/c/coutput_test.v index a3e9515f0..db2cd2837 100644 --- a/vlib/v/gen/c/coutput_test.v +++ b/vlib/v/gen/c/coutput_test.v @@ -409,7 +409,7 @@ fn test_veb_implicit_ctx_alias_uses_user_context_name() { defer { os.rm(test_source) or {} } - cmd := '${os.quoted_path(vexe)} -o - ${os.quoted_path(test_source)}' + cmd := '${os.quoted_path(vexe)} -gc boehm_full_opt -o - ${os.quoted_path(test_source)}' compilation := os.execute(cmd) ensure_compilation_succeeded(compilation, cmd) mut normalized := compilation.output.replace('\t', ' ').replace('\n', ' ') diff --git a/vlib/v/gen/c/testdata/windows_callconv_generated_c.vv b/vlib/v/gen/c/testdata/windows_callconv_generated_c.vv index 5416bd8d7..89bf4e7c3 100644 --- a/vlib/v/gen/c/testdata/windows_callconv_generated_c.vv +++ b/vlib/v/gen/c/testdata/windows_callconv_generated_c.vv @@ -1,4 +1,4 @@ -// vtest vflags: -os windows -shared -gc none +// vtest vflags: -os windows -shared -gc none -no-skip-unused module test_print @[export: 'get_name'] -- 2.39.5