Disable PIE when linking statically
Static PIE support, while supported on musl, requires a patch to GCC. Until/unless it is merged, adding '-pie' to the linker command line will override '-static' and create a binary that requires a dynamic interpreter (ld.so).
This commit is contained in:
parent
12ceed013c
commit
054f310868
1 changed files with 1 additions and 1 deletions
|
@ -902,7 +902,7 @@ fn link_args(cmd: &mut Linker,
|
|||
let mut args = args.iter().chain(more_args.iter()).chain(used_link_args.iter());
|
||||
|
||||
if get_reloc_model(sess) == llvm::RelocMode::PIC
|
||||
&& !args.any(|x| *x == "-static") {
|
||||
&& !sess.crt_static() && !args.any(|x| *x == "-static") {
|
||||
cmd.position_independent_executable();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue