[clang] [Clang][Hexagon] Use flat library directory layout for Picolibc (PR #201326)

Alexey Karyakin via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 08:17:34 PDT 2026


================
@@ -584,14 +584,30 @@ void HexagonToolChain::getLibraryDir(const ArgList &Args,
     llvm::sys::path::append(Dir, "lib");
   }
   std::string CpuVer = GetTargetCPUVersion(Args).str();
-  llvm::sys::path::append(Dir, CpuVer);
-  if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args))
-    if (*G == 0)
-      llvm::sys::path::append(Dir, "G0");
+  bool IsPicolibc = GetCStdlibType(Args) == ToolChain::CST_Picolibc;
+  bool IsG0 =
+      toolchains::HexagonToolChain::getSmallDataThreshold(Args).value_or(1) ==
+      0;
   bool IsStatic = Args.hasArg(options::OPT_static);
   bool IsShared = Args.hasArg(options::OPT_shared);
-  if (IsShared && !IsStatic)
-    llvm::sys::path::append(Dir, "pic");
+  bool IsPic = (IsShared && !IsStatic) ||
----------------
quic-akaryaki wrote:

This check was already redundant, but now it's even more redundant? Is it possible to have both IsShared and IsStatic? Or -fPIC and !IsShared?

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


More information about the cfe-commits mailing list