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

zig cc fails to link Go plugin under Mac M1 due to -flat_namespace #14987

Open
misha-ridge opened this issue Mar 17, 2023 · 0 comments
Open

zig cc fails to link Go plugin under Mac M1 due to -flat_namespace #14987

misha-ridge opened this issue Mar 17, 2023 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. linking os-macos
Milestone

Comments

@misha-ridge
Copy link

misha-ridge commented Mar 17, 2023

Zig Version

0.11.0-dev.1987+a2c6ecd6d

Steps to Reproduce and Observed Behavior

Trying to compile+linux Go plugins (they require C compiler) under zig cc fails due to lack of -flat_namespace support.

Reproducer repository is here: https://github.com/misha-ridge/p, clone and make:

roman@C10 p % make
CC=“zig cc” LD=“zig cc” go build -buildmode=plugin .
# github.com/misha-ridge/p
/Users/roman/tectonic/_deps.darwin-arm64/go-1.20.1/pkg/tool/darwin_arm64/link: running zig failed: exit status 1
error: unsupported linker arg: -flat_namespace

make: *** [all] Error 1
roman@C10 p %

This happens with Go 1.20.1 (maybe others too, didn't check)

Expected Behavior

Go plugins can be linked by zig cc. They work well under Linux/x86-64.

@misha-ridge misha-ridge added the bug Observed behavior contradicts documented or intended behavior label Mar 17, 2023
@kubkon kubkon added this to the 0.12.0 milestone Mar 18, 2023
@kubkon kubkon added enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-macos linking and removed bug Observed behavior contradicts documented or intended behavior labels Mar 18, 2023
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 os-macos
Projects
None yet
Development

No branches or pull requests

2 participants