Uh oh!
There was an error while loading. Please reload this page.
Build crtbegin.o/crtend.o from source code - #85395
Conversation
rust-highfive
commented
May 17, 2021
(rust-highfive has picked a reviewer for you, use r? to override) |
12101111
commented
May 19, 2021
Test with the code from #47551 : Details#![feature(backtrace)]#[derive(Clone,Copy)]structFoo{array:[u64;10240],}implFoo{constfnnew() -> Self{Self{array:[0x1122_3344_5566_7788;10240]}}}staticBAR:[Foo;10240] = [Foo::new();10240];fnmain(){let bt = std::backtrace::Backtrace::force_capture();println!("Hello, world! {:?}", bt);println!("{:x}",BAR[0].array[0]);}The broken rustc that don't link to crtbeginS.o/crtendS.o: rustc in this PR: |
Mark-Simulacrum
commented
May 26, 2021
r? @nagisa or @petrochenkov perhaps? I don't know too much about our crtbegin self-contained objects story, and whether building them ourselves (vs. using the ones in system roots) makes sense. |
petrochenkov
commented
May 26, 2021
12101111
commented
May 26, 2021
gcc's crtbegin.o/crtend.o is built when gcc bootstrap. Those target use And the current copy mechanism don't work well when using clang as C compiler. |
petrochenkov
commented
May 26, 2021
A working clang toolchain will still link these objects from somewhere, so they can be copied from the same place. |
12101111
commented
May 26, 2021
They are the same file. rust/src/ci/docker/host-x86_64/dist-various-1/Dockerfile Lines 63 to 78 in 1969c2e
Clang don't provided a command line to get the location of compiler-rt. And compiler-rt is optional for clang. |
nagisa
commented
May 26, 2021
mati865
commented
May 26, 2021
It does: |
12101111
commented
May 26, 2021
This is intrinsics, not crtbegin.o/crtend.o. The logic in clang is at A full clang installation should have |
petrochenkov
commented
May 29, 2021
The files must always exist somewhere, otherwise the C toolchain will be non-functional. My main question is what is simpler, less error-prone and requires less support - implementing the object search for all platforms on which |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
May 29, 2021
petrochenkov
commented
May 29, 2021
@12101111 |
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
May 30, 2021
@bors r+ |
bors
commented
May 30, 2021
📌 Commit 5b44522ff115b8a2ac82217c6a69233988aae84e has been approved by |
bors
commented
May 30, 2021
⌛ Testing commit 5b44522ff115b8a2ac82217c6a69233988aae84e with merge 5168f9db7cf61a646190550e7fd0c1165898ca49... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
petrochenkov
commented
May 31, 2021
@bors r+ |
bors
commented
May 31, 2021
📌 Commit 61c1155 has been approved by |
bors
commented
May 31, 2021
bors
commented
May 31, 2021
☀️ Test successful - checks-actions |
…ulacrum [beta] backports * Disable the machine outliner by default rust-lang#86020 * Fix incorrect gating of nonterminals in key-value attributes rust-lang#85445 * Build crtbegin.o/crtend.o from source code rust-lang#85395 * Bring back x86_64-sun-solaris target to rustup rust-lang#85252 * Preserve SyntaxContext for invalid/dummy spans in crate metadata rust-lang#85211 * [beta] backport: Remove unsound TrustedRandomAccess implementations rust-lang#86222 r? `@Mark-Simulacrum`
Build crtbengin.o/crtend.o from source code instead of copying from gcc.
The crtbegin and crtend implementation from llvm don't need
crtbeginS.ofor PIC.crtbegin{,S,T}.ois unified into one genericcrtbegin.o. See the comments in https://reviews.llvm.org/D28791#1419436 and https://reviews.llvm.org/D28791#1420914fix: #85310 , fix: #47551 , fix: #84033