Skip to content

--unresolved-symbols seems not work for zig cc #21007

Description

@xuzhenglun

Zig Version

0.12.0

Steps to Reproduce and Observed Behavior

Please forgive my presumptuous question. But I don't know that is this by designed or just not in schedule, and I'm not sure where to ask.

Here is the issue, I'm using zig cc in bazel as hermetic cc toolchain to compiling cgo program and it fails with unsupported linker arg. (ref: uber/hermetic_cc_toolchain#186)

I did some research, and I can reproduce this issue by run zig cc manually:

  1. writing a hello world c program, and then save it into main.c;
  2. compiling with args zig cc main.c -Wl,--unresolved-symbols=ignore-in-object-files, the linker will complain error: unsupported linker arg: --unresolved-symbols.

I also tried clang and gcc with the same building arguments, and they work well.

Expected Behavior

zig cc can support link args --unresolved-symbols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.linkingzig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions