Skip to content

Commit 1d4b118

Browse files
RINNE-TANChronostasys
authored andcommitted
fix: linker
1 parent 9ba2a5f commit 1d4b118

File tree

2 files changed

+36
-21
lines changed

2 files changed

+36
-21
lines changed

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pl_linker/src/linker.rs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ struct LdLinker {
6969
impl LdLinker {
7070
fn new(target: &spec::Target) -> Self {
7171
LdLinker {
72-
args: target.options.pre_link_args.clone(),
72+
args: target
73+
.options
74+
.pre_link_args
75+
.iter()
76+
.map(|x| x.to_string())
77+
.collect(),
7378
}
7479
}
7580
}
@@ -156,14 +161,19 @@ impl Ld64Linker {
156161
.next()
157162
.expect("LLVM target must have a hyphen");
158163

159-
let mut args = target.options.pre_link_args.clone();
164+
let mut args: Vec<String> = target
165+
.options
166+
.pre_link_args
167+
.iter()
168+
.map(|x| x.to_string())
169+
.collect();
160170
args.push(format!("-arch"));
161171
args.push(format!("{}", arch_name));
162-
let (a, b, c) = target.options.min_os_version.unwrap();
163-
args.push(format!("-platform_version"));
164-
args.push(format!("{}", target.options.os));
165-
args.push(format!("{}.{}.{}", a, b, c));
166-
args.push(format!("{}.{}.{}", a, b + 1, c));
172+
// let (a, b, c) = target.options.min_os_version.unwrap();
173+
// args.push(format!("-platform_version"));
174+
// args.push(format!("{}", target.options.os));
175+
// args.push(format!("{}.{}.{}", a, b, c));
176+
// args.push(format!("{}.{}.{}", a, b + 1, c));
167177

168178
Ld64Linker {
169179
args,
@@ -238,7 +248,12 @@ struct MsvcLinker {
238248
impl MsvcLinker {
239249
fn new(target: &spec::Target) -> Self {
240250
MsvcLinker {
241-
args: target.options.pre_link_args.clone(),
251+
args: target
252+
.options
253+
.pre_link_args
254+
.iter()
255+
.map(|x| x.to_string())
256+
.collect(),
242257
}
243258
}
244259
}

0 commit comments

Comments
 (0)