Skip to content

Keep GCC's GNU dialects in the musl builds - #142

Merged
bobsingor merged 1 commit into
embedpdf/mainfrom
embedpdf/fix/musl-gnu-dialects
Dec 3, 2026
Merged

bobsingor merged 1 commit into
embedpdf/mainfrom
embedpdf/fix/musl-gnu-dialects

Conversation

@bobsingor

Copy link
Copy Markdown
Contributor

Follow-up to #141 (S21), which merged before this fix: the musl builds fail on main since S21.

The build/ roll in S21 (b3574228b) compiles C as -std=c23 and gives GCC the strict -std=c++20 instead of -std=gnu11 and -std=gnu++20. Our musl targets are the only ones built with GCC (Ubuntu 24.04's GCC 13 for host tools, musl.cc's for the library), and GCC there rejects -std=c23:

gcc: error: unrecognized command-line option '-std=c23'; did you mean '-std=c2x'?

Both musl jobs failed in nasm (run 47207323362). patches/embedpdf-runtime/musl/build.patch gains a hunk in build/config/compiler/BUILD.gn that keeps GCC on -std=gnu11 and -std=gnu++20, as before the roll; clang targets keep upstream's C23. Only the musl targets apply this patch. The S21 report notes it under Build and patches.

Checked locally with gn gen for linuxmusl-x64 with CI's arguments: every C file gets -std=gnu11, every C++ file -std=gnu++20, and no clang-only flag reaches GCC. No GCC on the Mac, so the musl jobs in CI are the real check: run release-libpdfium.yml on this branch, or rerun the musl jobs.

The build/ roll in S21 (b3574228b) compiles C as -std=c23 and gives GCC
the strict -std=c++20 instead of -std=gnu11 and -std=gnu++20. Our musl
targets build with GCC 13 (host tools) and musl.cc's GCC, which reject
-std=c23, so both musl jobs failed in nasm. musl/build.patch keeps the
GNU dialects for GCC, as before the roll; clang builds take C23.
@bobsingor
bobsingor merged commit d70edea into embedpdf/main Dec 3, 2026
1 check passed
@bobsingor
bobsingor deleted the embedpdf/fix/musl-gnu-dialects branch December 3, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant