CFI: Fix LTO for #![no_builtins] crates with CFI#156024
CFI: Fix LTO for #![no_builtins] crates with CFI#156024rust-bors[bot] merged 1 commit intorust-lang:mainfrom
#![no_builtins] crates with CFI#156024Conversation
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
58c916f to
02987f4
Compare
This comment has been minimized.
This comment has been minimized.
02987f4 to
49f46f9
Compare
This comment has been minimized.
This comment has been minimized.
49f46f9 to
1a3cf09
Compare
This comment has been minimized.
This comment has been minimized.
c338aae to
6650fd5
Compare
|
r? bjorn3 (since you're already reviewing this, and know way more about this than I do) |
6650fd5 to
994844b
Compare
This comment has been minimized.
This comment has been minimized.
1e9d441 to
c9526ae
Compare
c9526ae to
b3be83c
Compare
|
|
||
| #[link(name = "foo")] | ||
| extern "C" { | ||
| fn do_twice(f: unsafe extern "C" fn(i32) -> i32, arg: i32) -> i32; |
There was a problem hiding this comment.
Should these perhaps use std::ffi::c_int to ensure the bit width matches C on all targets?
There was a problem hiding this comment.
This test is mainly to emphasize how the C integer types are encoded by their respective sizes when using integer normalization so I think it makes more sense the Rust side to have a sized integer types. Note all these tests are gated to only-x86_64-unknown-linux-gnu because of the naked_asm in the invalid-branch-target-abort test and to save CI resources anyway.
8baf995 to
1a2d398
Compare
|
I also added the indirect-return-type-mismatch-abort and indirect-type-qualifier-mismatch-abort tests for completeness. |
This comment has been minimized.
This comment has been minimized.
Fixes LTO for `#![no_builtins]` crates with CFI enabled by using rustc's `EmitObj::Bitcode` path (and emitting LLVM bitcode in the `.o` for linker-based LTO).
1a2d398 to
acc33fe
Compare
|
@bors r+ |
CFI: Fix LTO for `#![no_builtins]` crates with CFI Fixes LTO for `#![no_builtins]` crates with CFI enabled by using rustc's `EmitObj::Bitcode` path (and emitting LLVM bitcode in the `.o` for linker-based LTO). It also adds tests that verify that the examples in [rust-cfi-examples](https://github.com/rcvalle/rust-cfi-examples) build and run with `-Zbuild-std` to prevent other future regressions.
…uwer Rollup of 5 pull requests Successful merges: - #146273 (lint ImproperCTypes: refactor linting architecture (part 2)) - #156024 (CFI: Fix LTO for `#![no_builtins]` crates with CFI) - #156243 (Move CrateInfo computation after codegen_crate) - #156245 (Move invocation_temp into OutputFilenames) - #156265 (Remove unused `ToStableHashKey` impls.)
…uwer Rollup of 10 pull requests Successful merges: - #146273 (lint ImproperCTypes: refactor linting architecture (part 2)) - #154025 (Add `keepalive`, `set_keepalive` to `TcpStream` implementations) - #156024 (CFI: Fix LTO for `#![no_builtins]` crates with CFI) - #156243 (Move CrateInfo computation after codegen_crate) - #154846 (Add better default spans for the `Ty` impl of `QueryKey`) - #155220 (cg_clif: Don't show verbose run-make cmd output for passing tests) - #156204 (Implemented `PathBuf::into_string`) - #156245 (Move invocation_temp into OutputFilenames) - #156250 (add a few new solver normalization tests) - #156265 (Remove unused `ToStableHashKey` impls.)
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#146273 (lint ImproperCTypes: refactor linting architecture (part 2)) - rust-lang/rust#154025 (Add `keepalive`, `set_keepalive` to `TcpStream` implementations) - rust-lang/rust#156024 (CFI: Fix LTO for `#![no_builtins]` crates with CFI) - rust-lang/rust#156243 (Move CrateInfo computation after codegen_crate) - rust-lang/rust#154846 (Add better default spans for the `Ty` impl of `QueryKey`) - rust-lang/rust#155220 (cg_clif: Don't show verbose run-make cmd output for passing tests) - rust-lang/rust#156204 (Implemented `PathBuf::into_string`) - rust-lang/rust#156245 (Move invocation_temp into OutputFilenames) - rust-lang/rust#156250 (add a few new solver normalization tests) - rust-lang/rust#156265 (Remove unused `ToStableHashKey` impls.)
View all comments
Fixes LTO for
#![no_builtins]crates with CFI enabled by using rustc'sEmitObj::Bitcodepath (and emitting LLVM bitcode in the.ofor linker-based LTO).It also adds tests that verify that the examples in rust-cfi-examples build and run with
-Zbuild-stdto prevent other future regressions.