Make QEMU build under musl
QEMU and its glib dependency use a few very bespoke glibc extensions which
musl doesn't implement. This disables their use to make this build on both glibc and musl.
Test Plan: `bazel build --crosstool_top=//build/toolchain/musl-host-gcc:musl_host_cc_suite @qemu//:qemu-x86_64-softmmu` works
X-Origin-Diff: phab/D738
GitOrigin-RevId: 606f750be4259ca8fcc19f4c0cc0ddd54dff2090
diff --git a/third_party/glib/patches/bazel_support.patch b/third_party/glib/patches/bazel_support.patch
index 10b834b..41d679c 100644
--- a/third_party/glib/patches/bazel_support.patch
+++ b/third_party/glib/patches/bazel_support.patch
@@ -353,13 +353,13 @@
+
+#define HAVE_IP_MREQN 1
+
-+#define HAVE_LANGINFO_ABALTMON 1
++#undef HAVE_LANGINFO_ABALTMON
+
-+#define HAVE_LANGINFO_ALTMON 1
++#undef HAVE_LANGINFO_ALTMON
+
+#define HAVE_LANGINFO_CODESET 1
+
-+#define HAVE_LANGINFO_OUTDIGIT 1
++#undef HAVE_LANGINFO_OUTDIGIT
+
+#define HAVE_LANGINFO_TIME 1
+
@@ -509,7 +509,7 @@
+
+#define HAVE_STRTOLL_L 1
+
-+#define HAVE_STRTOULL_L 1
++#undef HAVE_STRTOULL_L
+
+#define HAVE_STRUCT_DIRENT_D_TYPE 1
+
diff --git a/third_party/qemu/patches/bazel_support.patch b/third_party/qemu/patches/bazel_support.patch
index 9dea8d0..8905c39 100644
--- a/third_party/qemu/patches/bazel_support.patch
+++ b/third_party/qemu/patches/bazel_support.patch
@@ -853,7 +853,7 @@
+ "util/bufferiszero.c",
+ "util/cacheinfo.c",
+ "util/compatfd.c",
-+ "util/coroutine-ucontext.c",
++ "util/coroutine-sigaltstack.c",
+ "util/crc32c.c",
+ "util/cutils.c",
+ "util/drm.c",
diff --git a/third_party/qemu/patches/pregenerated_config_files.patch b/third_party/qemu/patches/pregenerated_config_files.patch
index fd5fe68..ced72f5 100644
--- a/third_party/qemu/patches/pregenerated_config_files.patch
+++ b/third_party/qemu/patches/pregenerated_config_files.patch
@@ -74,7 +74,7 @@
+
+#undef CONFIG_COCOA
+
-+#define CONFIG_COROUTINE_BACKEND ucontext
++#define CONFIG_COROUTINE_BACKEND sigaltstack
+
+#define CONFIG_COROUTINE_POOL 0
+
@@ -160,7 +160,7 @@
+
+#define CONFIG_MADVISE 1
+
-+#define CONFIG_MALLOC_TRIM
++#undef CONFIG_MALLOC_TRIM
+
+#define CONFIG_MEMBARRIER 1
+