summaryrefslogtreecommitdiff
path: root/tools/gccld/gccld.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-02 21:26:10 +0000
committerChris Lattner <sabre@nondot.org>2004-12-02 21:26:10 +0000
commit3f14fb1a0b3fac070714caa82bf938c410bbe232 (patch)
treeba857791ca3f57e59361ea8b82419d23961aa998 /tools/gccld/gccld.cpp
parente3ad43c828280cf11e8631f1a814a51a0b168016 (diff)
downloadllvm-3f14fb1a0b3fac070714caa82bf938c410bbe232.tar.gz
llvm-3f14fb1a0b3fac070714caa82bf938c410bbe232.tar.bz2
llvm-3f14fb1a0b3fac070714caa82bf938c410bbe232.tar.xz
Recognize --strip-all as a synonym for -s.
Add -S and --strip-debug option support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccld/gccld.cpp')
-rw-r--r--tools/gccld/gccld.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index 5a19866bca..c1f430affa 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -58,7 +58,10 @@ namespace {
cl::value_desc("library prefix"));
cl::opt<bool>
- Strip("s", cl::desc("Strip symbol info from executable"));
+ Strip("strip-all", cl::desc("Strip all symbol info from executable"));
+ cl::opt<bool>
+ StripDebug("strip-debug",
+ cl::desc("Strip debugger symbol info from executable"));
cl::opt<bool>
NoInternalize("disable-internalize",
@@ -90,6 +93,11 @@ namespace {
CO5("eh-frame-hdr", cl::Hidden, cl::desc("Compatibility option: ignored"));
cl::opt<std::string>
CO6("h", cl::Hidden, cl::desc("Compatibility option: ignored"));
+
+ cl::alias A0("s", cl::desc("Alias for --strip-all"),
+ cl::aliasopt(Strip));
+ cl::alias A1("S", cl::desc("Alias for --strip-debug"),
+ cl::aliasopt(StripDebug));
}
/// PrintAndReturn - Prints a message to standard error and returns true.
@@ -199,7 +207,8 @@ int main(int argc, char **argv, char **envp) {
sys::RemoveFileOnSignal(sys::Path(RealBytecodeOutput));
// Generate the bytecode file.
- if (GenerateBytecode(Composite.get(), Strip, !NoInternalize, &Out)) {
+ int StripLevel = Strip ? 2 : (StripDebug ? 1 : 0);
+ if (GenerateBytecode(Composite.get(), StripLevel, !NoInternalize, &Out)) {
Out.close();
return PrintAndReturn(argv[0], "error generating bytecode");
}