From 9912bd7821213235c03944f85af6365155fb3247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Tue, 17 Aug 2021 03:52:25 +0300 Subject: [PATCH] Compile the grammar libraries with full RELRO on Linux (#599) * Compile the grammar libraries with full RELRO * Set RELRO compiler options for only Linux --- helix-syntax/build.rs | 3 +++ 1 file changed, 3 insertions(+) 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