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/SOURCES/chromium-127-rust-clanglib....

68 lines
2.7 KiB

4 months ago
diff -up chromium-127.0.6533.72/build/rust/rust_bindgen.gni.me chromium-127.0.6533.72/build/rust/rust_bindgen.gni
--- chromium-127.0.6533.72/build/rust/rust_bindgen.gni.me 2024-07-25 16:11:18.754551595 +0200
+++ chromium-127.0.6533.72/build/rust/rust_bindgen.gni 2024-07-25 16:11:33.997837660 +0200
@@ -22,7 +22,7 @@ _libclang_path = rust_bindgen_root
if (host_os == "win") {
_libclang_path += "/bin"
} else {
- _libclang_path += "/lib"
+ _libclang_path += "/lib64"
}
# Template to build Rust/C bindings with bindgen.
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" || clang_version == "19") {
+ _suffix = ""
+ } else if (clang_version == "14" || clang_version == "15" || clang_version == "16") {
+ _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" ]
}