You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicitly include compiler-rt builtins library in linking
This makes the intrinsic symbols contained within considered as strong
symbols, so that when the Rust stdlib intrinsics are marked as weak,
the C++ ones will take precedence. Otherwise, even if they are marked
weak, the Rust stdlib intrinsics are selected by the linker.
It may be the Rust intrinsics are preferable, but we want to stay on
the C++ intrinsics (for C++ and Rust code in mixed binaries) unless we
can demonstrate a good reason to switch.
Upstream bug for marking Rust intrinsic symbols weak:
rust-lang/compiler-builtins#525
To test and verify this works:
1. Revert the changes to shift.rs in rust-lang/compiler-builtins@1634193 to third_party/rust-toolchain/lib/rustlib/src/rust/vendor/compiler_builtins-*/src/int/shift.rs
2. Apply https://chromium-review.googlesource.com/c/chromium/src/+/45461823
3. Follow the instructions in its description to build and run bad_intrinsics
4. The bad_intrinsics binary panics without this CL, but not with this CL, meaning the C++ intrinsics are used.
Bug: 1445978
Change-Id: Ib251660346d03902f531285999aeeabc28882049
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4546164
Commit-Queue: Arthur Eubanks <[email protected]>
Reviewed-by: Arthur Eubanks <[email protected]>
Auto-Submit: danakj <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1150647}
NOKEYCHECK=True
GitOrigin-RevId: 31b9cb886d359780569bc5e1281bc7515d16e9bb
0 commit comments