Skip to content

Weird bug around handling -v flag in zig cc -target #22269

@tesuji

Description

@tesuji

Zig Version

0.14.0-dev.2540+f857bf72e

Steps to Reproduce and Observed Behavior

  1. Download the required zig version
  2. Run zig cc -target x86_64-linux-gnu.2.35 with:
-v
# or
-xc -E -v -
  1. Confirm that zig fails with either zig: error: version '.2.35' in target triple 'x86_64-unknown-linux-gnu.2.35' is invalid or UnknownApplicationBinaryInterface.

Also reproducible on discord: https://discord.com/channels/605571803288698900/1319191118163873812/1319191118163873812

Expected Behavior

zig cc -target x86_64-linux-gnu.2.35 -v should succeed.
Other build systems like meson or cmake validates availability of a C compiler by running cc -xc -E -v -.
If zig cc -v fails, the build system will fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorregressionIt worked in a previous version of Zig, but stopped working.zig ccZig as a drop-in C compiler feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions