Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xuzhenglun opened this issue Aug 9, 2024 · 0 comments
Open

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

xuzhenglun opened this issue Aug 9, 2024 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. linking zig cc Zig as a drop-in C compiler feature
Milestone

Comments

@xuzhenglun
Copy link

xuzhenglun commented Aug 9, 2024

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.

@xuzhenglun xuzhenglun added the bug Observed behavior contradicts documented or intended behavior label Aug 9, 2024
@andrewrk andrewrk added the zig cc Zig as a drop-in C compiler feature label Aug 12, 2024
@andrewrk andrewrk added this to the 0.16.0 milestone Aug 12, 2024
@alexrp alexrp added enhancement Solving this issue will likely involve adding new logic or components to the codebase. linking and removed bug Observed behavior contradicts documented or intended behavior labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. linking zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

No branches or pull requests

3 participants