Unnamed repository; edit this file 'description' to name the repository.
Compile the grammar libraries with full RELRO on Linux (#599)
* Compile the grammar libraries with full RELRO * Set RELRO compiler options for only Linux
Orhun Parmaksız 2021-08-17
parent 14c08e8 · commit 9912bd7
-rw-r--r--helix-syntax/build.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/helix-syntax/build.rs b/helix-syntax/build.rs
index 02c4bc0a..ca16f636 100644
--- a/helix-syntax/build.rs
+++ b/helix-syntax/build.rs
@@ -105,6 +105,9 @@ fn build_library(src_path: &Path, language: &str) -> Result<()> {
}
}
command.arg("-xc").arg(parser_path);
+ if cfg!(all(unix, not(target_os = "macos"))) {
+ command.arg("-Wl,-z,relro,-z,now");
+ }
}
let output = command