Skip to content

Commit 8a39851

Browse files
committed
llc: Make the output executable
To emulate the behavior of native linkers
1 parent abafb49 commit 8a39851

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/tools/llc/llc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,10 @@ static int compileModule(char **argv, LLVMContext &Context) {
760760

761761
// Declare success.
762762
Out->keep();
763+
// Make the output executable, some build systems depend on it
764+
sys::fs::perms NewPerms = static_cast<sys::fs::perms>(0755);
765+
std::error_code EC = sys::fs::setPermissions(OutputFilename, NewPerms);
766+
assert(!EC);
763767
if (DwoOut)
764768
DwoOut->keep();
765769

0 commit comments

Comments
 (0)