Skip to content

Commit

Permalink
gccrs: Generate position independent executable
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Jul 21, 2021
1 parent 6691642 commit 3efda6a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gccrs/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ impl GccrsArgs {
.to_owned();

match self.crate_type {
CrateType::Bin => args.append(&mut vec![String::from("-o"), output_file]),
CrateType::Bin => args.append(&mut vec![
String::from("-o"),
output_file,
String::from("-fPIE"),
String::from("-pie"),
]),
CrateType::DyLib => args.append(&mut vec![
String::from("-fPIC"),
String::from("-shared"),
Expand Down

0 comments on commit 3efda6a

Please sign in to comment.