Skip to content

Test vlib/v/slow_tests/assembly/asm_test.amd64.v fails on OpenBSD with tcc #26447

@lcheylus

Description

@lcheylus

Describe the bug

On OpenBSD current/amd64, test vlib/v/slow_tests/assembly/asm_test.amd64.v fails with tcc compiler ; no error when run with Clang (version 19.1.7) compiler.

Reproduction Steps

  • Build V from Git repository on OpenBSD/amd64 with gmake rebuild
  • Run test with command ./v test vlib/v/slow_tests/assembly/asm_test.amd64.v

Expected Behavior

No compilation error and success for test vlib/v/slow_tests/assembly/asm_test.amd64.v

Current Behavior

  • Error when test run vlib/v/slow_tests/assembly/asm_test.amd64.v
$ ./v test vlib/v/slow_tests/assembly/asm_test.amd64.v
---- Testing... ----
 FAIL     0.000 ms vlib/v/slow_tests/assembly/asm_test.amd64.v
>> compilation failed:
================== C compilation error (from tcc): ==============
cc: /tmp/v_1000/tsession_2d54c8508_01KFXPRKE8Q7Q3QANSZXPAV6J4/asm_test.amd64.01KFXPRPCQDVE0KJFTE0WPAETB.tmp.c:8692: error: unknown constraint '*'
=================================================================
Try passing `-g` when compiling, to see a .v file:line information, that correlates more with the C error.
(Alternatively, pass `-show-c-output`, to print the full C error message).
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

----
To reproduce just failure 1 run:    '/home/fox/dev/vlang.git/v'  '/home/fox/dev/vlang.git/vlib/v/slow_tests/assembly/asm_test.amd64.v'
Summary for all V _test.v files: 1 failed, 1 total. Elapsed time: 4464 ms, on 1 job. Comptime: 4382 ms. Runtime: 0 ms.
  • Full output for v test with -showcc and -show-c-output
$ ./v -showcc -show-c-output run vlib/v/slow_tests/assembly/asm_test.amd64.v
> C compiler cmd: '/home/fox/dev/vlang.git/thirdparty/tcc/tcc.exe' '@/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c.rsp'
> C compiler response file "/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c.rsp":
  -fwrapv -o "/home/fox/dev/vlang.git/vlib/v/slow_tests/assembly/asm_test.amd64" -D GC_THREADS=1 -D GC_BUILTIN_ATOMIC=1 -I "/usr/local/include" "/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c" -std=c99 -D_DEFAULT_SOURCE -bt25 "/usr/local/lib/libgc.a" -lgc -lpthread
======== Output of the C Compiler (/home/fox/dev/vlang.git/thirdparty/tcc/tcc.exe) ========
/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c:8692: error: unknown constraint '*'
===========================================================================================
> C compiler cmd: 'cc' '@/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c.rsp'
> C compiler response file "/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c.rsp":
  -fwrapv -o '/home/fox/dev/vlang.git/vlib/v/slow_tests/assembly/asm_test.amd64' -D GC_THREADS=1 -D GC_BUILTIN_ATOMIC=1 -I "/usr/local/include" "/tmp/v_1000/asm_test.amd64.01KFXQ0BCZ4FA527XZSGSSA6R4.tmp.c" -std=c99 -D_DEFAULT_SOURCE "/usr/local/lib/libgc.a" -lgc -lpthread 
======== Output of the C Compiler (cc) ========
ld: error: unable to find library -lgc
cc: error: linker command failed with exit code 1 (use -v to see invocation)
===============================================
No such file or directory; code: 2

Possible Solution

During link with tcc / ld, error ld: error: unable to find library -lgc => problem to find path for libgc

In vlib/builtin/builtin_d_gcboehm.c.v, line 95 and beyond: case for OpenBSD OS and tcc compiler (without define dynamic_boehm), there is no flag -L to define path for libgc (/usr/local/lib/ after installation of OpenBSD package boehm-gc).

$ pkg-config --libs --cflags bdw-gc
-I/usr/local/include -L/usr/local/lib -lgc -pthread

=> need to add #flag -L/usr/local/lib/ for OpenBSD && tcc case.

Additional Information/Context

No response

V version

V 0.5.0 f479e98

Environment details (OS name and version, etc.)

V full version V 0.5.0 f479e98
OS openbsd, 7.8, GENERIC.MP#217
Processor 4 cpus, 64bit, little endian
Memory 2.2GB/3.98GB
V executable /home/fox/dev/vlang.git/v
V last modified time 2026-01-26 17:48:25
V home dir OK, value: /home/fox/dev/vlang.git
VMODULES OK, value: /home/fox/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/fox/dev/vlang.git
Git version git version 2.52.0
V git status weekly.2026.05-5-gf479e989
.git/config present true
cc version OpenBSD clang version 19.1.7
gcc version egcc (GCC) 11.2.0
clang version OpenBSD clang version 19.1.7
tcc version tcc version 0.9.28rc 2025-05-27 HEAD@cb39bc4c (x86_64 OpenBSD)
tcc git status thirdparty-openbsd-amd64 200e7752
emcc version N/A
glibc version N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions