aboutsummaryrefslogtreecommitdiff
path: root/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2003-09-02 20:17:20 +0000
committerJohn Criswell <criswell@uiuc.edu>2003-09-02 20:17:20 +0000
commitd35b5b542da2f4855856495fc28ddca8d9092979 (patch)
tree01785b017c745b0117803f101d0665737803c170 /tools/gccld/gccld.cpp
parent6991a03753db092e2e5b269ebdc898ff5cfc43a8 (diff)
Modified the code so that it uses the MakeFileExecutable() method. The new
library code now adds all execute bits that are allowed by the umask value to the file's current permission bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r--tools/gccld/gccld.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index 4133de547d..1fd1b741fa 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -21,6 +21,7 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
+#include "Support/FileUtilities.h"
#include "Support/CommandLine.h"
#include "Support/Signals.h"
#include <fstream>
@@ -433,9 +434,6 @@ int main(int argc, char **argv) {
Out.close();
if (!LinkAsLibrary) {
- // Permissions masking value of the user
- mode_t mask;
-
// Output the script to start the program...
std::ofstream Out2(OutputFilename.c_str());
if (!Out2.good())
@@ -444,22 +442,11 @@ int main(int argc, char **argv) {
Out2 << "#!/bin/sh\nlli -q -abort-on-exception $0.bc $*\n";
Out2.close();
- //
- // Grab the umask value from the operating system. We want to use it when
- // changing the file's permissions.
- //
- // Note:
- // Umask() is one of those annoying system calls. You have to call it
- // to get the current value and then set it back.
- //
- mask = umask (0);
- umask (mask);
-
// Make the script executable...
- chmod(OutputFilename.c_str(), (0755 & ~mask));
+ MakeFileExecutable (OutputFilename);
// Make the bytecode file directly executable in LLEE as well
- chmod(RealBytecodeOutput.c_str(), (0755 & ~mask));
+ MakeFileExecutable (RealBytecodeOutput);
}
return 0;