Skip to content

mac: segfault with bare main when compiling with tcc #28030

Description

@rilaaax

Describe the bug

An empty main() compiled with tcc generates a binary that triggers a segfault.

Notes

  1. Adding -g or -gc boehm flag does prevent any error
  2. Adding -cg flag triggers bus error

Reproduction Steps

fn main() {
}
v -cc tcc .
./<bin>

Expected Behavior

success

Current Behavior

segmentation fault

Possible Solution

No response

Additional Information/Context

No response

V version

0.5.2 a5a89d5

Environment details (OS name and version, etc.)

V full version V 0.5.2 76f77e3.a5a89d5
OS macos, macOS, 27.0, 26A5388g
V git status 0.5.2-210-ga5a89d56
cc version Apple clang version 21.0.0 (clang-2100.1.1.101)
gcc version Apple clang version 21.0.0 (clang-2100.1.1.101)
clang version Apple clang version 21.0.0 (clang-2100.1.1.101)
tcc version tcc version 0.9.28rc 2026-07-24 HEAD@85ba3ae8 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 274abd24
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