[PATCH] D87901: [Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 26 17:05:52 PDT 2020


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:1964
       for (StringRef Candidate : CandidateBiarchTripleAliases)
         ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, Candidate,
                                /*NeedsBiarchSuffix=*/ true);
----------------
Its use of GCCDirExists is uninitialized. I suggest that you set GCCDirExists and  GCCCrossDirExists to be conservative.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2469
   } Suffixes[] = {
-      // This is the normal place.
-      {"gcc/" + CandidateTriple.str(), "../..", true},
+      // This is the normal place if Clang is installed alongside with GCC,
+      // probably with the same prefix. But it's likely does not exists in
----------------
> Clang is installed alongside with GCC

This is not correct. (1) clang does not need to be installed (it can be used in the build directory) (2) You can set --prefix (-B) and --sysroot to affect detected prefixes. Clang does not need to be beside GCC.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87901



More information about the cfe-commits mailing list