1bc897e
diff -up chromium-121.0.6167.57/build/config/clang/BUILD.gn.rust-clang_lib chromium-121.0.6167.57/build/config/clang/BUILD.gn
1bc897e
--- chromium-121.0.6167.57/build/config/clang/BUILD.gn.rust-clang_lib	2024-01-10 16:43:01.000000000 +0100
1bc897e
+++ chromium-121.0.6167.57/build/config/clang/BUILD.gn	2024-01-20 19:51:38.481992799 +0100
1bc897e
@@ -112,6 +112,7 @@ template("clang_lib") {
1bc897e
       _prefix = "lib"
1bc897e
       _suffix = ""
1bc897e
       _ext = "a"
1bc897e
+      _libprefix = ""
1bc897e
       if (is_win) {
1bc897e
         _dir = "windows"
1bc897e
         _prefix = ""
1bc897e
@@ -127,7 +128,33 @@ template("clang_lib") {
1bc897e
         }
1bc897e
       } else if (is_apple) {
1bc897e
         _dir = "darwin"
1bc897e
-      } else if (is_linux || is_chromeos) {
1bc897e
+      } else if (is_linux) {
1bc897e
+        if (current_cpu == "x64") {
1bc897e
+          _dir = "x86_64-redhat-linux-gnu"
1bc897e
+          _suffix ="-x86_64"
1bc897e
+        } else if (current_cpu == "x86") {
1bc897e
+          _dir = "i386-redhat-linux-gnu"
1bc897e
+          _suffix = "-i386"
1bc897e
+        } else if (current_cpu == "arm64") {
1bc897e
+          _dir = "aarch64-redhat-linux-gnu"
1bc897e
+          _suffix = "-aarch64"
1bc897e
+        } else if (current_cpu == "arm") {
1bc897e
+          _dir = "armhf-redhat-linux-gnu"
1bc897e
+          _suffix = "-armhf"
1bc897e
+        } else if (current_cpu == "ppc64") {
1bc897e
+          _dir = "powerpc64le-redhat-linux-gnu"
1bc897e
+          _suffix = "-powerpc64le"
1bc897e
+        } else {
1bc897e
+          assert(false)  # Unhandled cpu type
1bc897e
+        }
1bc897e
+        # different clang lib dir in fedora/epel
1bc897e
+        if (clang_version == "17") {
1bc897e
+          _suffix = ""
1bc897e
+        } else if (clang_version == "16" || clang_version == "14") {
1bc897e
+          _libprefix = "64"
1bc897e
+          _dir = ""
1bc897e
+        }
1bc897e
+      } else if (is_chromeos) {
1bc897e
         if (current_cpu == "x64") {
1bc897e
           _dir = "x86_64-unknown-linux-gnu"
1bc897e
         } else if (current_cpu == "x86") {
1bc897e
@@ -166,7 +193,7 @@ template("clang_lib") {
1bc897e
         assert(false)  # Unhandled target platform
1bc897e
       }
1bc897e
 
1bc897e
-      _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib"
1bc897e
+      _clang_lib_dir = "$clang_base_path/lib${_libprefix}/clang/$clang_version/lib"
1bc897e
       _lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}"
1bc897e
       libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ]
1bc897e
     }