Skip to content

Commit 07bb89a

Browse files
committed
Fix it
1 parent aa48c14 commit 07bb89a

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

Cargo.lock

+11-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ object = "0.12.0"
4141
cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" }
4242

4343
[patch.crates-io]
44-
faerie = { path = "../faerie" }
45-
object = { path = "../object" }
44+
faerie = { git = "https://github.com/m4b/faerie.git" }
45+
object = { git = "https://github.com/gimli-rs/object.git" }
4646

4747
[profile.dev.overrides."*"]
4848
opt-level = 3

src/metadata.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ pub fn write_metadata<'a, 'gcx>(
9393
artifact.declare(".rustc", faerie::Decl::section(faerie::SectionKind::Data)).unwrap();
9494
artifact.define_with_symbols(".rustc", compressed, {
9595
let mut map = std::collections::BTreeMap::new();
96-
map.insert(rustc::middle::exported_symbols::metadata_symbol_name(tcx), 0);
96+
// FIXME implement faerie elf backend section custom symbols
97+
// For MachO this is necessary to prevent the linker from throwing away the .rustc section,
98+
// but for ELF it isn't.
99+
if tcx.sess.target.target.options.is_like_osx {
100+
map.insert(rustc::middle::exported_symbols::metadata_symbol_name(tcx), 0);
101+
}
97102
map
98103
}).unwrap();
99104

test.sh

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ mkdir -p target/out/clif
77
echo "[BUILD] mini_core"
88
$RUSTC example/mini_core.rs --crate-name mini_core --crate-type dylib -Csave-temps
99

10-
objdump -section-headers target/out/libmini_core.dylib
11-
1210
echo "[BUILD] example"
1311
$RUSTC example/example.rs --crate-type lib
1412

0 commit comments

Comments
 (0)