about summary refs log tree commit diff
path: root/src/test/run-make-fulldeps
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-31 07:32:50 +0000
committerbors <bors@rust-lang.org>2021-05-31 07:32:50 +0000
commit7baa7afd0fc8061c5b815a7aab9b40d1cd406ce8 (patch)
tree22cc21763034d9b2febf8968d395a676be429fbd /src/test/run-make-fulldeps
parentdc08641128737ee0832bb61f24fe9212ca000f32 (diff)
parent61c1155d170292179568dce747afd9b8f91cc265 (diff)
downloadrust-7baa7afd0fc8061c5b815a7aab9b40d1cd406ce8.tar.gz
rust-7baa7afd0fc8061c5b815a7aab9b40d1cd406ce8.zip
Auto merge of #85395 - 12101111:build-crt, r=petrochenkov
Build crtbegin.o/crtend.o from source code

Build crtbengin.o/crtend.o from source code instead of copying from gcc.

The crtbegin and crtend implementation from llvm don't need `crtbeginS.o` for PIC. `crtbegin{,S,T}.o` is unified into one generic `crtbegin.o`. See the comments in https://reviews.llvm.org/D28791#1419436 and https://reviews.llvm.org/D28791#1420914

fix: https://github.com/rust-lang/rust/issues/85310 , fix: https://github.com/rust-lang/rust/issues/47551 , fix: https://github.com/rust-lang/rust/issues/84033
Diffstat (limited to 'src/test/run-make-fulldeps')
-rw-r--r--src/test/run-make-fulldeps/issue-47551/Makefile9
-rw-r--r--src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs23
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/issue-47551/Makefile b/src/test/run-make-fulldeps/issue-47551/Makefile
new file mode 100644
index 00000000000..f4495e6b671
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-47551/Makefile
@@ -0,0 +1,9 @@
+# only-linux
+# ignore-32bit
+
+-include ../tools.mk
+
+all:
+	$(RUSTC) eh_frame-terminator.rs
+	$(call RUN,eh_frame-terminator) | $(CGREP) '1122334455667788'
+	objdump --dwarf=frames $(TMPDIR)/eh_frame-terminator | $(CGREP) 'ZERO terminator'
diff --git a/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs b/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs
new file mode 100644
index 00000000000..2f740dc4fac
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs
@@ -0,0 +1,23 @@
+// run-pass
+
+#![feature(backtrace)]
+#[derive(Clone, Copy)]
+struct Foo {
+    array: [u64; 10240],
+}
+
+impl Foo {
+    const fn new() -> Self {
+        Self {
+            array: [0x1122_3344_5566_7788; 10240]
+        }
+    }
+}
+
+static BAR: [Foo; 10240] = [Foo::new(); 10240];
+
+fn main() {
+    let bt = std::backtrace::Backtrace::force_capture();
+    println!("Hello, world! {:?}", bt);
+    println!("{:x}", BAR[0].array[0]);
+}