--- /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/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -20,6 +20,7 @@
 import("//build/config/rust.gni")
 import("//build/config/ui.gni")
 import("//build/config/unwind.gni")
+import("//build/config/linux/musl.gni")
 import("//build/toolchain/rbe.gni")
 import("//build/toolchain/toolchain.gni")
 import("//build_overrides/build.gni")
@@ -1282,8 +1282,13 @@
     # simplicity we always explicitly set the architecture.
     if (current_cpu == "x64") {
       if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
-        cflags += [ "--target=x86_64-unknown-linux-gnu" ]
-        ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
+        if (is_musl) {
+          cflags += [ "--target=x86_64-unknown-linux-musl" ]
+          ldflags += [ "--target=x86_64-unknown-linux-musl" ]
+        } else {
+          cflags += [ "--target=x86_64-unknown-linux-gnu" ]
+          ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
+        }
       } else {
         cflags += [ "-m64" ]
         ldflags += [ "-m64" ]
@@ -1291,8 +1296,13 @@
       cflags += [ "-msse3" ]
     } else if (current_cpu == "x86") {
       if (is_clang && !is_android && !is_chromeos_device) {
-        cflags += [ "--target=i386-unknown-linux-gnu" ]
-        ldflags += [ "--target=i386-unknown-linux-gnu" ]
+        if (is_musl) {
+          cflags += [ "--target=i386-unknown-linux-musl" ]
+          ldflags += [ "--target=i386-unknown-linux-musl" ]
+        } else {
+          cflags += [ "--target=i386-unknown-linux-gnu" ]
+          ldflags += [ "--target=i386-unknown-linux-gnu" ]
+        }
       } else {
         cflags += [ "-m32" ]
         ldflags += [ "-m32" ]
@@ -1315,8 +1325,13 @@
       }
     } else if (current_cpu == "arm64") {
       if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
-        cflags += [ "--target=aarch64-linux-gnu" ]
-        ldflags += [ "--target=aarch64-linux-gnu" ]
+        if (is_musl) {
+          cflags += [ "--target=aarch64-linux-musl" ]
+          ldflags += [ "--target=aarch64-linux-musl" ]
+        } else {
+          cflags += [ "--target=aarch64-linux-gnu" ]
+          ldflags += [ "--target=aarch64-linux-gnu" ]
+        }
       }
     } else if (current_cpu == "mipsel") {
       ldflags += [ "-Wl,--hash-style=sysv" ]
--- 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
