From e8a6382f64ef95a930f1d3d1b3d4799880d625a6 Mon Sep 17 00:00:00 2001 From: Lars Luthman Date: Fri, 29 May 2026 00:07:33 +0200 Subject: [PATCH] fix: Fix Rust builds by adding a workaround for a GCC bug (#89) On x86_64 with GCC 12.2.0, the following command runs forever, slowly allocating more and more memory: cc -I src -Wall -o parser.o -c src/parser.c Since the cc crate for Rust adds -Wall and -Wextra by default when compiling C code using GCC, this means that cargo build also won't finish. This is probably a bug in GCC, but as a workaround it can be avoided by explicitly disabling -Wall and -Wextra in bindings/rust/build.rs using warnings(false) and extra_warnings(false). Bindings for other languages that also compile the C code using GCC and enable -Wall or -Wextra are probably affected in the same way. --- bindings/rust/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs index 41d4559..d2109c7 100644 --- a/bindings/rust/build.rs +++ b/bindings/rust/build.rs @@ -4,6 +4,8 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config + .warnings(false) + .extra_warnings(false) .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable") .flag_if_supported("-Wno-trigraphs")