[PATCH] D131214: [clang][Driver] Pass correct reproduce flag to lld-link

Alex Brachet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 18 13:12:38 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
abrachet marked an inline comment as done.
Closed by commit rG377dddf4a083: [clang][Driver] Pass correct reproduce flag to lld-link (authored by abrachet).
Herald added a project: clang.

Changed prior to commit:
  https://reviews.llvm.org/D131214?vs=450836&id=453763#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131214/new/

https://reviews.llvm.org/D131214

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/lld-repro.c


Index: clang/test/Driver/lld-repro.c
===================================================================
--- clang/test/Driver/lld-repro.c
+++ clang/test/Driver/lld-repro.c
@@ -1,6 +1,7 @@
-// REQUIRES: lld, x86-registered-target
+// REQUIRES: lld
+// UNSUPPORTED: ps4
 
-// RUN: not %clang %s -target x86_64-linux -nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t -fcrash-diagnostics=all 2>&1 \
+// RUN: not %clang %s -nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t -fcrash-diagnostics=all 2>&1 \
 // RUN:   | FileCheck %s
 
 // check that we still get lld's output
@@ -13,9 +14,9 @@
 // CHECK-NEXT: note: diagnostic msg:
 // CHECK: ********************
 
-// RUN: not %clang %s -target x86_64-linux -nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t -fcrash-diagnostics=compiler 2>&1 \
+// RUN: not %clang %s -nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t -fcrash-diagnostics=compiler 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=NO-LINKER
-// RUN: not %clang %s -target x86_64-linux -nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t 2>&1 \
+// RUN: not %clang %s -nostartfiles -nostdlib -fuse-ld=lld -gen-reproducer=error -fcrash-diagnostics-dir=%t 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=NO-LINKER
 
 // NO-LINKER-NOT: Preprocessed source(s) and associated run script(s) are located at:
Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -1631,7 +1631,11 @@
     const char *TmpName = CreateTempFile(C, "linker-crash", "tar");
     Command NewLLDInvocation = Cmd;
     llvm::opt::ArgStringList ArgList = NewLLDInvocation.getArguments();
-    ArgList.push_back(Saver.save(Twine{"--reproduce="} + TmpName).data());
+    StringRef ReproduceOption =
+        C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment()
+            ? "/reproduce:"
+            : "--reproduce=";
+    ArgList.push_back(Saver.save(Twine(ReproduceOption) + TmpName).data());
     NewLLDInvocation.replaceArguments(std::move(ArgList));
 
     // Redirect stdout/stderr to /dev/null.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131214.453763.patch
Type: text/x-patch
Size: 2280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220818/d1ae89af/attachment.bin>


More information about the cfe-commits mailing list