You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chromium/chromium-122-rust-clang_lib...

56 lines
2.1 KiB

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