Repository navigation
Conversation
Use the same object handoff for binaries, tests, and shared libraries. Build Zig compiler-rt separately when enabled so Zig 0.16 and 0.17 share one path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before
With
cc_common.link, Zig compiled binaries and shared libraries to intermediate archives. Tests already emitted an object withtest-obj, then ranbuild-libto package it with compiler-rt. The final C/C++ link consumed an archive in all three cases.After
Binaries and shared libraries use
build-obj, and tests usetest-obj. The shared C/C++ link from #716 takes those objects directly, removing the archive step.When compiler-rt is enabled, the same Zig SDK emits it as a separate object for all three rule kinds.
We need to compile compile-rt as a separate action because of 2 bugs zig when using
-fcompiler-rt.build-obj -fcompiler-rt -fstack-protectortriggers an assertion in LLVM’s StackProtector pass when it encounters the runtime’s__stack_chk_failalias. Zig issue #31702