-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Closed as not planned
Copy link
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorlinking
Description
Zig Version
0.12.0-dev.414+461036069
Steps to Reproduce and Observed Behavior
In my understanding, meson build system has limited support for linkers. It seems to check what linker you are using with:
CC -Wl,--version
If it cannot find a supported linker, it will not build. As of now, it does not support the zig linker:
$ zig cc -Wl,--version
zig ld 0.12.0-dev.414+461036069
This is problematic, as meson can't handle this.
A typical workaround would be as follows.
When running this with clang (the zig compiler backend as I understand it), I obtain:
$ clang -Wl,--version
GNU ld (GNU Binutils for Debian) 2.40
Apparently, it's using ld. If hypothetically this is undesirable, this can be changed by specifying the linker directly:
$ clang -fuse-ld=lld -Wl,--version
Debian LLD 14.0.6 (compatible with GNU linkers)
This trick doesn't work with zig, however:
$ zig cc -fuse-ld=lld -Wl,--version
zig ld 0.12.0-dev.414+461036069
Expected Behavior
For interop with meson, it would be nice if zig acted as clang does, i.e.:
$ zig cc -fuse-ld=lld -Wl,--version
Debian LLD 14.0.6 (compatible with GNU linkers)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorlinking