[clang] Fix --print-libgcc-file-name on Darwin platforms (PR #98325)

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 10 09:15:56 PDT 2024


================
@@ -2230,6 +2239,7 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
   }
 
   if (C.getArgs().hasArg(options::OPT_print_runtime_dir)) {
+    initDarwinTarget();
----------------
ldionne wrote:

We should also add tests for this behavior. We were not printing the right directory in the embedded case before your patch, but we were printing the right path in the non-embedded case. I don't know if your patch fixes it. If your patch doesn't fix the embedded case, we could scale down the patch a bit and avoid touching the `OPT_print_runtime_dir` code path (like you did initially) just for the sake of landing this. The incorrect `-print-runtime-dir` result on embedded machO targets could be fixed separately.

https://github.com/llvm/llvm-project/pull/98325


More information about the cfe-commits mailing list