From f17dd56f3fe95be92088535f7e6d197ce4106d99 Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Thu, 2 Oct 2025 10:11:41 -0700 Subject: [PATCH] fix(arm): update rust clanglib patch --- fedora_patches/rust-clanglib.patch | 54 +++++++----------------------- 1 file changed, 12 insertions(+), 42 deletions(-) diff --git a/fedora_patches/rust-clanglib.patch b/fedora_patches/rust-clanglib.patch index d758fa3d..b9142c85 100644 --- a/fedora_patches/rust-clanglib.patch +++ b/fedora_patches/rust-clanglib.patch @@ -1,62 +1,32 @@ -diff -up chromium-135.0.7049.84/build/config/clang/BUILD.gn.than chromium-135.0.7049.84/build/config/clang/BUILD.gn ---- chromium-135.0.7049.84/build/config/clang/BUILD.gn.than 2025-04-09 10:22:51.699058451 +0200 -+++ chromium-135.0.7049.84/build/config/clang/BUILD.gn 2025-04-09 10:43:06.524085005 +0200 -@@ -166,8 +166,8 @@ template("clang_lib") { - _prefix = "lib" - _suffix = "" - _ext = "a" -+ _libprefix = "" - -- _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib" - if (is_win) { - _dir = "windows" - _prefix = "" -@@ -197,7 +197,33 @@ template("clang_lib") { - } else { - assert(false) # Unhandled cpu type +diff -up chromium-141.0.7390.37/build/config/clang/BUILD.gn.rust-clang_lib chromium-141.0.7390.37/build/config/clang/BUILD.gn +--- chromium-141.0.7390.37/build/config/clang/BUILD.gn.rust-clang_lib 2025-09-23 22:21:14.000000000 +0200 ++++ chromium-141.0.7390.37/build/config/clang/BUILD.gn 2025-09-27 12:15:44.380395911 +0200 +@@ -168,7 +168,21 @@ 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) { -+ _suffix = "" -+ } else if (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") { -@@ -236,6 +262,7 @@ template("clang_lib") { - assert(false) # Unhandled target platform - } - -+ _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" ] - -diff -up chromium-135.0.7049.84/build/rust/rust_bindgen_generator.gni.than chromium-135.0.7049.84/build/rust/rust_bindgen_generator.gni ---- chromium-135.0.7049.84/build/rust/rust_bindgen_generator.gni.than 2025-04-09 10:46:48.772413981 +0200 -+++ chromium-135.0.7049.84/build/rust/rust_bindgen_generator.gni 2025-04-09 10:47:15.480900587 +0200 +diff -up chromium-141.0.7390.37/build/rust/rust_bindgen_generator.gni.rust-clang_lib chromium-141.0.7390.37/build/rust/rust_bindgen_generator.gni +--- chromium-141.0.7390.37/build/rust/rust_bindgen_generator.gni.rust-clang_lib 2025-09-23 22:21:14.000000000 +0200 ++++ chromium-141.0.7390.37/build/rust/rust_bindgen_generator.gni 2025-09-27 11:41:29.777786734 +0200 @@ -18,11 +18,11 @@ if (host_os == "win") { # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in @@ -71,9 +41,9 @@ diff -up chromium-135.0.7049.84/build/rust/rust_bindgen_generator.gni.than chrom } # Template to build Rust/C bindings with bindgen. -diff -up chromium-135.0.7049.84/build/rust/rust_bindgen.gni.than chromium-135.0.7049.84/build/rust/rust_bindgen.gni ---- chromium-135.0.7049.84/build/rust/rust_bindgen.gni.than 2025-04-09 10:45:53.577078718 +0200 -+++ chromium-135.0.7049.84/build/rust/rust_bindgen.gni 2025-04-09 10:46:29.974649891 +0200 +diff -up chromium-141.0.7390.37/build/rust/rust_bindgen.gni.rust-clang_lib chromium-141.0.7390.37/build/rust/rust_bindgen.gni +--- chromium-141.0.7390.37/build/rust/rust_bindgen.gni.rust-clang_lib 2025-09-23 22:21:14.000000000 +0200 ++++ chromium-141.0.7390.37/build/rust/rust_bindgen.gni 2025-09-27 11:41:29.777891843 +0200 @@ -19,11 +19,11 @@ if (host_os == "win") { # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in