Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions srcpkgs/chromium/patches/angle-wayland-include.patch

This file was deleted.

112 changes: 0 additions & 112 deletions srcpkgs/chromium/patches/chromium-147-musl-toolchain.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,19 @@ also does not ship the rust stdlib for every target, so add an additional
if (!use_thin_lto || !toolchain_supports_rust_thin_lto) {
# Don't include bitcode if it won't be used.
rustflags += [ "-Cembed-bitcode=no" ]
--- a/build/rust/rust_bindgen_generator.gni
+++ b/build/rust/rust_bindgen_generator.gni
@@ -214,6 +214,13 @@
]
}

+ if (current_cpu != host_cpu && rust_cross_sysroot_absolute != "") {
+ args += [
+ "--sysroot",
+ rust_cross_sysroot_absolute,
+ ]
+ }
+
args += [
"{{defines}}",
"{{include_dirs}}",
40 changes: 40 additions & 0 deletions srcpkgs/chromium/patches/chromium-150-empty-ar.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 96e74ccdbab3edda23ca04c28cdfd9c25f622663 Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Tue, 16 Jun 2026 21:57:07 -0700
Subject: [PATCH] build: Fix get_path_info on empty ar in unbundle toolchain

Some toolchains leave ar empty during initial setup, causing GN to error
when get_path_info() is called with an empty string. Guard the check to
only run when ar is not empty.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
Change-Id: I87615806ddfda6f262a7500b0c5b6fed1f452985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7949777
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Matt Stark <msta@google.com>
Cr-Commit-Position: refs/heads/main@{#1648076}
---
build/toolchain/gcc_toolchain.gni | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index 1f434d4ead440..f82ee44f323e2 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -407,8 +407,13 @@ template("single_gcc_toolchain") {
command = "cmd /s /c \"\"$python_path\" $tool_wrapper_path delete-file {{output}} && $command\""
} else {
command = "rm -f {{output}} && $command"
- inputs =
- [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
+
+ # Add ar to inputs if it's not from $PATH. Some toolchains leave
+ # |ar| empty during toolchain setup, so guard get_path_info() here.
+ if (ar != "" && get_path_info(ar, "file") != ar) {
+ inputs =
+ [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
+ }
}

# Almost all targets build with //build/config/compiler:thin_archive which
128 changes: 128 additions & 0 deletions srcpkgs/chromium/patches/chromium-150-musl-toolchain.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
--- /dev/null 2026-04-08 02:08:03.222890460 +0200
+++ b/build/config/linux/musl.gni 2026-04-10 01:18:23.479529250 +0200
@@ -0,0 +1,3 @@
+declare_args() {
+ is_musl = false
+}
--- a/build/config/compiler_cpu_abi.gn
+++ b/build/config/compiler_cpu_abi.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.

import("//build/config/chromeos/args.gni")
+import("//build/config/linux/musl.gni")
import("//build/toolchain/toolchain.gni")

if (current_cpu == "arm" || current_cpu == "arm64") {
@@ -49,8 +50,13 @@
# simplicity we always explicitly set the architecture.
if (current_cpu == "x64") {
if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
- cpu_abi_cflags += [ "--target=x86_64-unknown-linux-gnu" ]
- cpu_abi_ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
+ if (is_musl) {
+ cpu_abi_cflags += [ "--target=x86_64-unknown-linux-musl" ]
+ cpu_abi_ldflags += [ "--target=x86_64-unknown-linux-musl" ]
+ } else{
+ cpu_abi_cflags += [ "--target=x86_64-unknown-linux-gnu" ]
+ cpu_abi_ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
+ }
} else {
cpu_abi_cflags += [ "-m64" ]
cpu_abi_ldflags += [ "-m64" ]
@@ -63,8 +69,13 @@
}
} else if (current_cpu == "x86") {
if (is_clang && !is_android && !is_chromeos_device) {
- cpu_abi_cflags += [ "--target=i386-unknown-linux-gnu" ]
- cpu_abi_ldflags += [ "--target=i386-unknown-linux-gnu" ]
+ if (is_musl) {
+ cpu_abi_cflags += [ "--target=i386-unknown-linux-musl" ]
+ cpu_abi_ldflags += [ "--target=i386-unknown-linux-musl" ]
+ } else {
+ cpu_abi_cflags += [ "--target=i386-unknown-linux-gnu" ]
+ cpu_abi_ldflags += [ "--target=i386-unknown-linux-gnu" ]
+ }
} else {
cpu_abi_cflags += [ "-m32" ]
cpu_abi_ldflags += [ "-m32" ]
@@ -75,8 +86,13 @@
]
} else if (current_cpu == "arm") {
if (is_clang && !is_android && !is_chromeos_device) {
- cpu_abi_cflags += [ "--target=arm-linux-gnueabihf" ]
- cpu_abi_ldflags += [ "--target=arm-linux-gnueabihf" ]
+ if (is_musl) {
+ cpu_abi_cflags += [ "--target=arm-linux-musl" ]
+ cpu_abi_ldflags += [ "--target=arm-linux-musl" ]
+ } else {
+ cpu_abi_cflags += [ "--target=arm-linux-gnueabihf" ]
+ cpu_abi_ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
}
cpu_abi_cflags += [
"-march=$arm_arch",
@@ -100,8 +100,13 @@
]
} else if (current_cpu == "arm64") {
if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
- cpu_abi_cflags += [ "--target=aarch64-linux-gnu" ]
- cpu_abi_ldflags += [ "--target=aarch64-linux-gnu" ]
+ if (is_musl) {
+ cpu_abi_cflags += [ "--target=aarch64-linux-musl" ]
+ cpu_abi_ldflags += [ "--target=aarch64-linux-musl" ]
+ } else {
+ cpu_abi_cflags += [ "--target=aarch64-linux-gnu" ]
+ cpu_abi_ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
}
if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
is_a_target_toolchain) {
--- a/buildtools/third_party/libc++/__config_site
+++ b/buildtools/third_party/libc++/__config_site
@@ -26,12 +26,6 @@
#define _LIBCPP_HAS_MONOTONIC_CLOCK 1
#define _LIBCPP_HAS_TERMINAL 1

-#ifdef ANDROID_HOST_MUSL
-#define _LIBCPP_HAS_MUSL_LIBC 1
-#else
-#define _LIBCPP_HAS_MUSL_LIBC 0
-#endif
-
#ifdef _WIN32
#define _LIBCPP_HAS_THREAD_API_PTHREAD 0
#define _LIBCPP_HAS_THREAD_API_EXTERNAL 0
--- a/build/config/rust.gni
+++ b/build/config/rust.gni
@@ -5,6 +5,7 @@
import("//build/config/chrome_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/sanitizers/sanitizers.gni")
+import("//build/config/linux/musl.gni")
import("//build/toolchain/toolchain.gni")

if (is_android) {
--- a/build/config/c++/BUILD.gn
+++ b/build/config/c++/BUILD.gn
@@ -3,6 +3,7 @@
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
+import("//build/config/linux/musl.gni")
import("//buildtools/deps_revisions.gni")

assert(use_custom_libcxx, "should only be used if use_custom_libcxx is set")
@@ -60,6 +61,12 @@

defines += [ "CR_LIBCXX_REVISION=$libcxx_revision" ]

+ if (is_musl) {
+ defines += [ "_LIBCPP_HAS_MUSL_LIBC=1" ]
+ } else {
+ defines += [ "_LIBCPP_HAS_MUSL_LIBC=0" ]
+ }
+
if (is_win) {
# Intentionally not using libc++abi on Windows because libc++abi only
# implements the Itanium C++ ABI, and not the Microsoft ABI which we use on
33 changes: 33 additions & 0 deletions srcpkgs/chromium/patches/chromium-150-no-sysroot-modules.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 0bd622221d825f254dbe85dfd3cb7716f4763ecd Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Sun, 14 Jun 2026 11:25:31 +1000
Subject: [PATCH] modules: Only set --sysroot if sysroot is set

This enables downstream distro builds that don't use the sysroot to
evaluate the file without GN getting upset.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
Change-Id: If6a9efe52d6707fd0bfaddeddd9e5b72e756147f
---

diff --git a/build/modules/BUILD.gn b/build/modules/BUILD.gn
index 0c1cf49..77911d1 100644
--- a/build/modules/BUILD.gn
+++ b/build/modules/BUILD.gn
@@ -230,10 +230,12 @@
} else {
# We need to pass the sysroot in so that it can scan it to generate a
# modulemap for the sysroot headers.
- args += [
- "--sysroot",
- rebase_path(sysroot, root_build_dir),
- ]
+ if (defined(sysroot) && sysroot != "") {
+ args += [
+ "--sysroot",
+ rebase_path(sysroot, root_build_dir),
+ ]
+ }
}
args += [
"--",
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1503,21 +1503,6 @@
@@ -1487,22 +1487,6 @@
}
}

Expand All @@ -13,7 +13,8 @@
- target_os != "ios" && target_os != "mac" &&
- (target_os != "linux" || use_libfuzzer || !build_with_chromium)
-
- # Note: v8_target_cpu == arm allows using the V8 arm simulator on x86 for fuzzing.
- # Note: v8_target_cpu == arm allows using the V8 arm simulator on x86 for
- # fuzzing.
- assert(
- is_valid_x86_target || target_cpu != "x86" || v8_target_cpu == "arm",
- "'target_cpu=x86' is not supported for 'target_os=$target_os'. Consider omitting 'target_cpu' (default) or using 'target_cpu=x64' instead.")
Expand Down
Loading
Loading