about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-23 03:43:25 +0000
committerbors <bors@rust-lang.org>2024-06-23 03:43:25 +0000
commitd4cc01c2f2bdfe1eac2e0c9159ff45706c7cd5df (patch)
tree7b2639bb9a89ad7091323268a696fae66600782d /src
parentacb62737aca7045f331e7a05adc38bed213e278d (diff)
parenta19077d0f3339f31bd6b1b5d7b2b3006480c715a (diff)
downloadrust-d4cc01c2f2bdfe1eac2e0c9159ff45706c7cd5df.tar.gz
rust-d4cc01c2f2bdfe1eac2e0c9159ff45706c7cd5df.zip
Auto merge of #126715 - Rejyr:migrate-readelf-rmake, r=jieyouxu
Migrate `relro-levels`, `static-pie` to `rmake`

Part of #121876.

r? `@jieyouxu`

try-job: aarch64-gnu
try-job: arm-android
try-job: armhf-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: dist-various-1
try-job: test-various
Diffstat (limited to 'src')
-rw-r--r--src/tools/run-make-support/src/command.rs6
-rw-r--r--src/tools/run-make-support/src/llvm.rs20
-rw-r--r--src/tools/run-make-support/src/rustc.rs2
-rw-r--r--src/tools/run-make-support/src/rustdoc.rs2
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt2
5 files changed, 25 insertions, 7 deletions
diff --git a/src/tools/run-make-support/src/command.rs b/src/tools/run-make-support/src/command.rs
index f39bcfd60df..0a1bd9b0b34 100644
--- a/src/tools/run-make-support/src/command.rs
+++ b/src/tools/run-make-support/src/command.rs
@@ -36,8 +36,10 @@ impl Command {
         Self { cmd: StdCommand::new(program), stdin: None, drop_bomb: DropBomb::arm(program) }
     }
 
-    pub fn set_stdin(&mut self, stdin: Box<[u8]>) {
-        self.stdin = Some(stdin);
+    /// Specify a stdin input
+    pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
+        self.stdin = Some(input.as_ref().to_vec().into_boxed_slice());
+        self
     }
 
     /// Specify an environment variable.
diff --git a/src/tools/run-make-support/src/llvm.rs b/src/tools/run-make-support/src/llvm.rs
index 99bce08fc23..7f42223bf7f 100644
--- a/src/tools/run-make-support/src/llvm.rs
+++ b/src/tools/run-make-support/src/llvm.rs
@@ -102,6 +102,24 @@ impl LlvmReadobj {
         self
     }
 
+    /// Pass `--program-headers` to display program headers.
+    pub fn program_headers(&mut self) -> &mut Self {
+        self.cmd.arg("--program-headers");
+        self
+    }
+
+    /// Pass `--symbols` to display the symbol.
+    pub fn symbols(&mut self) -> &mut Self {
+        self.cmd.arg("--symbols");
+        self
+    }
+
+    /// Pass `--dynamic-table` to display the dynamic symbol table.
+    pub fn dynamic_table(&mut self) -> &mut Self {
+        self.cmd.arg("--dynamic-table");
+        self
+    }
+
     /// Specify the section to display.
     pub fn section(&mut self, section: &str) -> &mut Self {
         self.cmd.arg("--string-dump");
@@ -153,7 +171,7 @@ impl LlvmFilecheck {
 
     /// Pipe a read file into standard input containing patterns that will be matched against the .patterns(path) call.
     pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
-        self.cmd.set_stdin(input.as_ref().to_vec().into_boxed_slice());
+        self.cmd.stdin(input);
         self
     }
 
diff --git a/src/tools/run-make-support/src/rustc.rs b/src/tools/run-make-support/src/rustc.rs
index a377dad99d6..28ece1dff12 100644
--- a/src/tools/run-make-support/src/rustc.rs
+++ b/src/tools/run-make-support/src/rustc.rs
@@ -244,7 +244,7 @@ impl Rustc {
 
     /// Specify a stdin input
     pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
-        self.cmd.set_stdin(input.as_ref().to_vec().into_boxed_slice());
+        self.cmd.stdin(input);
         self
     }
 
diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-support/src/rustdoc.rs
index 93078561254..fb00427b1c1 100644
--- a/src/tools/run-make-support/src/rustdoc.rs
+++ b/src/tools/run-make-support/src/rustdoc.rs
@@ -92,7 +92,7 @@ impl Rustdoc {
 
     /// Specify a stdin input
     pub fn stdin<I: AsRef<[u8]>>(&mut self, input: I) -> &mut Self {
-        self.cmd.set_stdin(input.as_ref().to_vec().into_boxed_slice());
+        self.cmd.stdin(input);
         self
     }
 
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index c3a94d17cd9..07073ef5d40 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -151,7 +151,6 @@ run-make/raw-dylib-inline-cross-dylib/Makefile
 run-make/raw-dylib-link-ordinal/Makefile
 run-make/raw-dylib-stdcall-ordinal/Makefile
 run-make/redundant-libs/Makefile
-run-make/relro-levels/Makefile
 run-make/remap-path-prefix-dwarf/Makefile
 run-make/remap-path-prefix/Makefile
 run-make/reproducible-build-2/Makefile
@@ -177,7 +176,6 @@ run-make/split-debuginfo/Makefile
 run-make/stable-symbol-names/Makefile
 run-make/static-dylib-by-default/Makefile
 run-make/static-extern-type/Makefile
-run-make/static-pie/Makefile
 run-make/staticlib-blank-lib/Makefile
 run-make/staticlib-dylib-linkage/Makefile
 run-make/std-core-cycle/Makefile