-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
zig cc will not link to an external libunwind.so #10933
Copy link
Copy link
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.zig ccZig as a drop-in C compiler featureZig as a drop-in C compiler feature
Milestone
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.zig ccZig as a drop-in C compiler featureZig as a drop-in C compiler feature
Zig Version
0.9.1
Steps to Reproduce
Compile libunwind 1.6.2.
Make a simple C program using it:
zig cc:Expected Behavior
The program compiles and links to the libunwind copy that I specified.
Actual Behavior
The issue here is that
zig ccspecial cases-lunwind, to always use its internal vendored copy: https://github.com/ziglang/zig/blob/master/src/main.zig#L2031-L2035.However, the vendored version is LLVM's stripped down version and isn't actually compatible with the libunwind I'm trying to use! For reference, I care about using specifically this libunwind because it is safe to use in a signal handler, unlike (AFAIK) LLVM's version.
Would it be possible to add an extra CLI flag to suppress the libunwind special handling here? I can work around it right now by creating a
libunwind-real.sosymlink tolibunwind.soand passing-lunwind-real, but that feels a bit hacky.