diff --git a/docs/embedpdf/syncs/2026-12-03-2f366eae34.md b/docs/embedpdf/syncs/2026-12-03-2f366eae34.md index db1eb7c22a..774abcff97 100644 --- a/docs/embedpdf/syncs/2026-12-03-2f366eae34.md +++ b/docs/embedpdf/syncs/2026-12-03-2f366eae34.md @@ -76,6 +76,13 @@ shared writable, 26 thread-local, as in S20). tools/rust, nasm). Synced with `gclient sync --no-history --shallow`. - `mac/build.patch` gains a hunk in `build/config/c++/BUILD.gn` (above); its toolchain hunk moved by 23 lines. Every target's patches dry-run against clean sources, and darwin-arm64 and wasm32 build. +- `musl/build.patch` gains a hunk in `build/config/compiler/BUILD.gn`. The `build/` roll + (`b3574228b`) compiles C as `-std=c23` and gives GCC the strict `-std=c++20` instead of the GNU + dialects; the musl targets build with GCC (Ubuntu 24.04's GCC 13 for host tools, musl.cc's for the + target), which rejects `-std=c23`, and CI's musl jobs failed on it (in nasm, a host tool). GCC now + keeps `-std=gnu11` and `-std=gnu++20`, as before the roll; clang builds take upstream's C23. + Checked with `gn gen` for linuxmusl-x64: every C file `-std=gnu11`, every C++ file + `-std=gnu++20`. nasm, zlib and Brotli still compile below C23 (nasm uses `` there). ## API diff diff --git a/patches/embedpdf-runtime/musl/build.patch b/patches/embedpdf-runtime/musl/build.patch index 503b2c152b..2ad5beacad 100644 --- a/patches/embedpdf-runtime/musl/build.patch +++ b/patches/embedpdf-runtime/musl/build.patch @@ -1,5 +1,5 @@ diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn -index 147226d..7e0dfe0 100644 +index 7e5ebec41..9ff49e144 100644 --- a/config/BUILDCONFIG.gn +++ b/config/BUILDCONFIG.gn @@ -135,6 +135,9 @@ declare_args() { @@ -11,8 +11,8 @@ index 147226d..7e0dfe0 100644 + # Set to true when compiling with the Clang compiler. is_clang = current_os != "linux" || - (current_cpu != "s390x" && current_cpu != "s390" && -@@ -255,7 +258,9 @@ if (target_os == "android") { + (current_cpu != "mips" && current_cpu != "mips64") +@@ -264,7 +267,9 @@ if (target_os == "android") { _default_toolchain = "//build/toolchain/android:android_clang_$target_cpu" } else if (target_os == "chromeos" || target_os == "linux") { # See comments in build/toolchain/cros/BUILD.gn about board compiles. @@ -24,10 +24,10 @@ index 147226d..7e0dfe0 100644 } else { _default_toolchain = "//build/toolchain/linux:$target_cpu" diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn -index 5103543..eac7af8 100644 +index 91780b489..8834d987e 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn -@@ -394,7 +394,7 @@ config("compiler") { +@@ -466,7 +466,7 @@ config("compiler") { } } else if (is_chromeos) { cflags += [ "-fstack-protector-strong" ] @@ -36,3 +36,20 @@ index 5103543..eac7af8 100644 if (current_os != "aix") { # Not available on aix. cflags += [ "-fstack-protector" ] +@@ -711,6 +711,16 @@ config("compiler") { + # See: https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus + cflags_cc += [ "/Zc:__cplusplus" ] + } ++ } else if (!is_clang) { ++ # EmbedPDF: our musl targets build with GCC 13 (host) and musl.cc's GCC, ++ # which don't accept -std=c23; GCC keeps the GNU dialects it used before ++ # build b3574228b (and needs them for ##__VA_ARGS__). ++ cflags_c += [ "-std=gnu11" ] ++ if (use_cxx23) { ++ cflags_cc += [ "-std=gnu++23" ] ++ } else { ++ cflags_cc += [ "-std=gnu++20" ] ++ } + } else { + cflags_c += [ "-std=c23" ] +