diff --git a/.github/workflows/evil-build-pr.yml b/.github/workflows/evil-build-pr.yml index 54b7ca0d..663e8309 100644 --- a/.github/workflows/evil-build-pr.yml +++ b/.github/workflows/evil-build-pr.yml @@ -77,6 +77,11 @@ jobs: run: "sudo apt update && sudo apt install -y clang" if: ${{ !matrix.target.native}} + - name: Patch grammar build arguments + run: | + sed -i 's/command.arg("-Wl,-z,relro,-z,now");//g' helix-loader/src/grammar.rs + if: ${{ matrix.id == 'x86_64-pc-windows-gnu' }} + - name: Build (cross) # TODO: let's first see if this works #run: cargo xwin build --target ${{ matrix.target.id }} --profile release diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index fe1e5fb9..d7755608 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -544,16 +544,12 @@ fn build_tree_sitter_library( } command.arg("-xc").arg("-std=c11").arg(parser_path); - // HACK: relro is a linux hardening feature; - // it makes no sense (and tends to cause issues) when trying to enable for other targets - #[cfg(target_os = "linux")] - command.arg("-Wl,-z,relro,-z,now"); - /*if cfg!(all( + if cfg!(all( unix, - not(any(target_os = "macos", target_os = "illumos", target_os = "windows")) + not(any(target_os = "macos", target_os = "illumos")) )) { command.arg("-Wl,-z,relro,-z,now"); - }*/ + } } let output = command