Skip to content

Commit

Permalink
Auto merge of #109945 - Kobzol:llvm-bolt-gnu-stack, r=nikic
Browse files Browse the repository at this point in the history
Remove the use of `-use-gnu-stack` when BOLTing LLVM

This flag was (counterintuitively) removing the `GNU_STACK` ELF attribute, which caused the optimized `libLLVM.so` file to be flagged as having an executable stack on SELinux.

Removing the flag might cause issues with `strip`. I'm not aware that we're stripping `libLLVM.so` though. Does it happen anywhere?

Fixes: #105783
  • Loading branch information
bors committed Apr 5, 2023
2 parents a412564 + c32953f commit 90a9f69
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/bootstrap/bolt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ pub fn optimize_with_bolt(path: &Path, profile_path: &Path, output_path: &Path)
.arg("-split-all-cold")
// Move jump tables to a separate section
.arg("-jump-tables=move")
// Use GNU_STACK program header for new segment (workaround for issues with strip/objcopy)
.arg("-use-gnu-stack")
// Fold functions with identical code
.arg("-icf=1")
// Update DWARF debug info in the final binary
Expand Down

0 comments on commit 90a9f69

Please sign in to comment.