Skip to content

Commit bbe45ce

Browse files
committed
Haiku: make it explicit that Haiku uses position independent
executables on x86_64 With the switch to gcc 7 the linker scripts don't always explicitly add the `-pie` flag anymore. This creates build failures on x86_64. Interestingly enough, adding this flag on i686 will lead to executables that fail to run when ASLR is enabled, so let's keep it x86_64 only.
1 parent ecf4fe0 commit bbe45ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_target/spec/x86_64_unknown_haiku.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ pub fn target() -> TargetResult {
1616
base.max_atomic_width = Some(64);
1717
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
1818
base.stack_probes = true;
19+
// This option is required to build executables on Haiku x86_64
20+
base.position_independent_executables = true;
1921

2022
Ok(Target {
2123
llvm_target: "x86_64-unknown-haiku".to_string(),

0 commit comments

Comments
 (0)