From a593713800352177ded2c56182cd81ec98d3f35c Mon Sep 17 00:00:00 2001 From: Brendan Hansknecht Date: Thu, 23 Sep 2021 21:29:53 -0700 Subject: [PATCH] Fix surgical linking for C hosts with extra arg --- compiler/build/src/link.rs | 1 + linker/README.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/build/src/link.rs b/compiler/build/src/link.rs index 528cb208a5..40a8f84cbf 100644 --- a/compiler/build/src/link.rs +++ b/compiler/build/src/link.rs @@ -275,6 +275,7 @@ pub fn build_c_host_native( command.args(&[ shared_lib_path.to_str().unwrap(), "-fPIE", + "-pie", "-lm", "-lpthread", "-ldl", diff --git a/linker/README.md b/linker/README.md index 24ee2a3f61..0d1e2d77ee 100644 --- a/linker/README.md +++ b/linker/README.md @@ -33,7 +33,6 @@ This linker is run in 2 phases: preprocessing and surigical linking. - Run CLI tests and/or benchmarks with the Roc Linker. - Test with an executable completely generated by Cargo (It will hopefully work out of the box like zig). -- Investigate why C is using absolute jumps to the main function from `_start`. This means our shifts break the executable. - Add Macho support - Honestly should be almost exactly the same code. This means we likely need to do a lot of refactoring to minimize the duplicate code.