Skip to content

Commit f092476

Browse files
committed
Revert "Enable lto for sysroot build to fix missing bitcode error (#70)"
This reverts commit 5eb0bc2.
1 parent 379de94 commit f092476

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/cargo.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ pub fn config() -> Result<Option<Config>> {
194194
}
195195
}
196196

197-
pub struct Profile {
198-
table: Value,
197+
pub struct Profile<'t> {
198+
table: &'t Value,
199199
}
200200

201-
impl Profile {
201+
impl<'t> Profile<'t> {
202202
pub fn hash<H>(&self, hasher: &mut H)
203203
where
204204
H: Hasher,
@@ -218,13 +218,9 @@ impl Profile {
218218

219219
v.to_string().hash(hasher);
220220
}
221-
222-
pub fn set_lto(&mut self) {
223-
self.table.as_table_mut().expect("[profile.release] not a table").insert("lto".into(), Value::Boolean(true));
224-
}
225221
}
226222

227-
impl fmt::Display for Profile {
223+
impl<'t> fmt::Display for Profile<'t> {
228224
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
229225
let mut map = toml::map::Map::new();
230226
map.insert("profile".to_owned(), {
@@ -247,7 +243,7 @@ impl Toml {
247243
self.table
248244
.get("profile")
249245
.and_then(|v| v.get("release"))
250-
.map(|t| Profile { table: t.clone() })
246+
.map(|t| Profile { table: t })
251247
}
252248
}
253249

src/sysroot.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ fn build_crate(
7474

7575
let target_dir = td.join("target");
7676

77-
if let Some(mut profile) = ctoml.profile() {
78-
profile.set_lto();
77+
if let Some(profile) = ctoml.profile() {
7978
stoml.push_str(&profile.to_string())
80-
} else {
81-
stoml.push_str("[profile.release]\nlto = true");
8279
}
8380

8481
util::write(&td.join("Cargo.toml"), &stoml)?;

0 commit comments

Comments
 (0)