[lld] 8045a8a - [COFF] Warn that LLD does not support /PDBSTRIPPED:

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 15:11:25 PST 2020


Author: Reid Kleckner
Date: 2020-01-15T15:11:19-08:00
New Revision: 8045a8a7f184b682bfb4e729a986a3c2bd3a5b4e

URL: https://github.com/llvm/llvm-project/commit/8045a8a7f184b682bfb4e729a986a3c2bd3a5b4e
DIFF: https://github.com/llvm/llvm-project/commit/8045a8a7f184b682bfb4e729a986a3c2bd3a5b4e.diff

LOG: [COFF] Warn that LLD does not support /PDBSTRIPPED:

Doesn't really fix PR44491, but it avoids treating it as an input.

Added: 
    lld/test/COFF/pdbstripped.test

Modified: 
    lld/COFF/Driver.cpp
    lld/COFF/Options.td

Removed: 
    


################################################################################
diff  --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index f770fff80bcb..a940683202bb 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -624,6 +624,7 @@ static std::string createResponseFile(const opt::InputArgList &args,
       break;
     case OPT_implib:
     case OPT_pdb:
+    case OPT_pdbstripped:
     case OPT_out:
       os << arg->getSpelling() << sys::path::filename(arg->getValue()) << "\n";
       break;
@@ -1265,6 +1266,10 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
       config->pdbSourcePath = arg->getValue();
   }
 
+  // Handle /pdbstripped
+  if (auto *arg = args.getLastArg(OPT_pdbstripped))
+    warn("ignoring /pdbstripped flag, it is not yet supported");
+
   // Handle /noentry
   if (args.hasArg(OPT_noentry)) {
     if (args.hasArg(OPT_dll))

diff  --git a/lld/COFF/Options.td b/lld/COFF/Options.td
index 468e4da7d054..328a120cb711 100644
--- a/lld/COFF/Options.td
+++ b/lld/COFF/Options.td
@@ -64,6 +64,7 @@ def natvis : P<"natvis", "Path to natvis file to embed in the PDB">;
 def no_color_diagnostics: F<"no-color-diagnostics">,
     HelpText<"Do not use colors in diagnostics">;
 def pdb : P<"pdb", "PDB file path">;
+def pdbstripped : P<"pdbstripped", "Stripped PDB file path">;
 def pdbaltpath : P<"pdbaltpath", "PDB file path to embed in the image">;
 def section : P<"section", "Specify section attributes">;
 def stack   : P<"stack", "Size of the stack">;

diff  --git a/lld/test/COFF/pdbstripped.test b/lld/test/COFF/pdbstripped.test
new file mode 100644
index 000000000000..573cccef2656
--- /dev/null
+++ b/lld/test/COFF/pdbstripped.test
@@ -0,0 +1,7 @@
+# RUN: yaml2obj < %p/Inputs/pdb1.yaml > %t1.obj
+# RUN: yaml2obj < %p/Inputs/pdb2.yaml > %t2.obj
+# RUN: rm -f %t.dll %t.pdb
+# RUN: lld-link /debug /pdb:%t.pdb /pdbstripped:%t2.pdb /pdbaltpath:test.pdb /dll /out:%t.dll \
+# RUN:   /entry:main /nodefaultlib %t1.obj %t2.obj 2>&1 | FileCheck %s
+
+CHECK: warning: ignoring /pdbstripped flag, it is not yet supported


        


More information about the llvm-commits mailing list