[flang] Add driver install directory to AIX toolchain program paths list.
authorPaul Scoropan <1paulscoropan@gmail.com>
Wed, 25 Jan 2023 23:23:42 +0000 (23:23 +0000)
committerWael Yehia <wyehia@ca.ibm.com>
Thu, 26 Jan 2023 00:39:51 +0000 (00:39 +0000)
flang-new encounters an issue where its unable to invoke itself because the
install directory was missing from the program paths on AIX.

Reviewed By: w2yehia

Differential Revision: https://reviews.llvm.org/D140628

clang/lib/Driver/ToolChains/AIX.cpp

index abbd3ef..f62b566 100644 (file)
@@ -287,6 +287,10 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
 /// AIX - AIX tool chain which can call as(1) and ld(1) directly.
 AIX::AIX(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
     : ToolChain(D, Triple, Args) {
+  getProgramPaths().push_back(getDriver().getInstalledDir());
+  if (getDriver().getInstalledDir() != getDriver().Dir)
+    getProgramPaths().push_back(getDriver().Dir);
+
   ParseInlineAsmUsingAsmParser = Args.hasFlag(
       options::OPT_fintegrated_as, options::OPT_fno_integrated_as, true);
   getLibraryPaths().push_back(getDriver().SysRoot + "/usr/lib");