Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 07cef6f

Browse files
committedAug 6, 2024
rewrite split-debuginfo to rmake
1 parent 60d1465 commit 07cef6f

File tree

6 files changed

+461
-374
lines changed

6 files changed

+461
-374
lines changed
 

‎src/tools/run-make-support/src/external_deps/llvm.rs

+30
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ pub fn llvm_bcanalyzer() -> LlvmBcanalyzer {
4848
LlvmBcanalyzer::new()
4949
}
5050

51+
/// Construct a new `llvm-dwarfdump` invocation. This assumes that `llvm-dwarfdump` is available
52+
/// at `$LLVM_BIN_DIR/llvm-dwarfdump`.
53+
pub fn llvm_dwarfdump() -> LlvmDwarfdump {
54+
LlvmDwarfdump::new()
55+
}
56+
5157
/// A `llvm-readobj` invocation builder.
5258
#[derive(Debug)]
5359
#[must_use]
@@ -97,13 +103,21 @@ pub struct LlvmBcanalyzer {
97103
cmd: Command,
98104
}
99105

106+
/// A `llvm-dwarfdump` invocation builder.
107+
#[derive(Debug)]
108+
#[must_use]
109+
pub struct LlvmDwarfdump {
110+
cmd: Command,
111+
}
112+
100113
crate::macros::impl_common_helpers!(LlvmReadobj);
101114
crate::macros::impl_common_helpers!(LlvmProfdata);
102115
crate::macros::impl_common_helpers!(LlvmFilecheck);
103116
crate::macros::impl_common_helpers!(LlvmObjdump);
104117
crate::macros::impl_common_helpers!(LlvmAr);
105118
crate::macros::impl_common_helpers!(LlvmNm);
106119
crate::macros::impl_common_helpers!(LlvmBcanalyzer);
120+
crate::macros::impl_common_helpers!(LlvmDwarfdump);
107121

108122
/// Generate the path to the bin directory of LLVM.
109123
#[must_use]
@@ -317,3 +331,19 @@ impl LlvmBcanalyzer {
317331
self
318332
}
319333
}
334+
335+
impl LlvmDwarfdump {
336+
/// Construct a new `llvm-dwarfdump` invocation. This assumes that `llvm-dwarfdump` is available
337+
/// at `$LLVM_BIN_DIR/llvm-dwarfdump`.
338+
pub fn new() -> Self {
339+
let llvm_dwarfdump = llvm_bin_dir().join("llvm-dwarfdump");
340+
let cmd = Command::new(llvm_dwarfdump);
341+
Self { cmd }
342+
}
343+
344+
/// Provide an input file.
345+
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
346+
self.cmd.arg(path.as_ref());
347+
self
348+
}
349+
}

‎src/tools/run-make-support/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ pub use c_build::{build_native_dynamic_lib, build_native_static_lib, build_nativ
4949
pub use clang::{clang, Clang};
5050
pub use htmldocck::htmldocck;
5151
pub use llvm::{
52-
llvm_ar, llvm_bcanalyzer, llvm_filecheck, llvm_nm, llvm_objdump, llvm_profdata, llvm_readobj,
53-
LlvmAr, LlvmBcanalyzer, LlvmFilecheck, LlvmNm, LlvmObjdump, LlvmProfdata, LlvmReadobj,
52+
llvm_ar, llvm_bcanalyzer, llvm_dwarfdump, llvm_filecheck, llvm_nm, llvm_objdump, llvm_profdata,
53+
llvm_readobj, LlvmAr, LlvmBcanalyzer, LlvmDwarfdump, LlvmFilecheck, LlvmNm, LlvmObjdump,
54+
LlvmProfdata, LlvmReadobj,
5455
};
5556
pub use python::python_command;
5657
pub use rustc::{aux_build, bare_rustc, rustc, Rustc};

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ run-make/remap-path-prefix-dwarf/Makefile
2929
run-make/reproducible-build/Makefile
3030
run-make/rlib-format-packed-bundled-libs/Makefile
3131
run-make/simd-ffi/Makefile
32-
run-make/split-debuginfo/Makefile
3332
run-make/staticlib-dylib-linkage/Makefile
3433
run-make/symbol-mangling-hashed/Makefile
3534
run-make/sysroot-crates-are-unstable/Makefile
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.