[PATCH] D52050: [Driver] Fix architecture triplets and search paths for Linux x32

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 29 19:50:58 PDT 2021


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:2091
+  static const char *const X32Triples[] = {
+      "x86_64-linux-gnux32",    "x86_64-unknown-linux-gnux32",
+      "x86_64-pc-linux-gnux32"};
----------------
Just add `x86_64-linux-gnux32`. It is sufficient for Debian. Only add others when needed.


================
Comment at: clang/lib/Driver/ToolChains/Linux.cpp:90
       return "x86_64-linux-android";
-    // We don't want this for x32, otherwise it will match x86_64 libs
-    if (TargetEnvironment != llvm::Triple::GNUX32 &&
-        D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu"))
-      return "x86_64-linux-gnu";
+    if (TargetEnvironment == llvm::Triple::GNUX32) {
+      if (D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnux32"))
----------------
I have cleaned up the code a bit. You may need to rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D52050



More information about the cfe-commits mailing list