FastC generated C unit omits v_gc_get_abort_func prototype in Windows GCC -enable-globals build

Open
#32,726 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
18/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
compilers

Research direction

Start with vlib/v/gen/fastc/target_runtime.v, where native declaration selection happens, and compare it against the generated src.unit3.c and the fixture in vlib/v/gen/fastc/call_result_member_test.v. The open question is which generated unit owns the v_gc_get_abort_func prototype and why it is missing before the call. Done means the Windows GCC -enable-globals build compiles without an implicit declaration, with a generated-C regression test added and no test skipped.

Written by the indexing model from the issue text.

Description

Executed historical master compiler failure (R378)

Failing SHA: 11ecc52b8aa249eacd57f9c20d1922c858c35a3f (November 22, 2026). Windows GCC vlib shard 1: https://github.com/vlang/v/actions/runs/44968804254/job/137050984817. The job completed with 436 other tests passed and 158 skipped, then vlib/v/gen/fastc/call_result_member_test.v:37 test_fastc_map_field_of_pointer_call_result_is_evaluated_once failed its original build.exit_code == 0 assertion. The nested v -b fastc -enable-globals produced src.unit3.c:2558: error: implicit declaration of function 'v_gc_get_abort_func' from the native C compiler. This is a real generated-C declaration/ordering failure, not a GitHub timeout, dependency skip, or intentional fixture.

Source comparison: vlib/v/gen/fastc/call_result_member_test.v (blob 7131f1d7a32006992c68e8c504b6dcdabe9af0db) is unchanged at failing and current master 4d924f389f2aa0105f610126b8df4743b33fc0a3. vlib/builtin/builtin_d_gcboehm.c.v declares fn C.v_gc_get_abort_func() voidptr and vlib/builtin/gc_boehm_helpers.c defines the native helper. FastC target native declaration selection in vlib/v/gen/fastc/target_runtime.v is a relevant lead: a native declaration may exist in another C unit but be absent before the invocation in src.unit3.c. Which generated unit owns the prototype and why it was omitted is not yet proven. The same fixture has two additional Windows-only literal-newline mismatches after the failed build: expected value\\ntrue\\ntrue\\n vs actual CRLF and expected pointer sizes\\n vs CRLF. Preserve those semantic output assertions while normalizing host line endings only if proven necessary; do not hide the generated-C compiler error.

Next: on original Windows GCC, retain generated src.unit3.c, preprocess it, inspect the exact helper call/visible prototypes and linked gc_boehm_helpers.o; compare a C backend control and -gc none FastC control, then make the minimal declaration propagation/ordering correction and add a generated-C regression. Run ./v self, ./v fmt, original vlib/v/gen/fastc/call_result_member_test.v with Windows GCC/MSVC/TCC, and original -enable-globals integration. No test skip/diagnostic suppression.

Status: unresolved / still applicable / blocked on native patched V tooling. The failing file and relevant prototype ownership are unchanged on current master. The older red job is execution evidence, not proof of original introduction.

[!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.

Dominant language
V
Stars
38.1k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
682

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vlang/v

All issues in vlang/v

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.