From ec4f475b7c693943f8ecb1326513ad1176b7f9cb Mon Sep 17 00:00:00 2001 From: Jason Conroy Date: Sat, 20 Sep 2025 17:30:51 +0000 Subject: [PATCH] gnu: ocaml-4.07: Fix build with gcc@14. * gnu/packages/ocaml.scm (ocaml-4.07)[arguments]: <#:phases>{patch-cflags}: Add CFLAGS `-Wno-incompatible-pointer-types` and `-Wno-implicit-function-declaration` to configure and build scripts. Also remove `-Werror` to avoid failure on macro redefinition. Change-Id: I2defd11fc2741856cd48f853706fe37b165a16c0 Signed-off-by: Julien Lepiller --- gnu/packages/ocaml.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 38857e084a40ff4bb02d8140ed28adfab300f7e9..904a1fb55765bddf1ae969449cd8fc4fc47c9fa3 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -560,6 +560,26 @@ depend: $(STDLIB_MLIS) $(STDLIB_DEPS)")) (substitute-keyword-arguments (package-arguments ocaml-4.09) ((#:phases phases) `(modify-phases ,phases + (add-after 'unpack 'patch-cflags + (lambda _ + (substitute* + "configure" + ;; Disable error for redefined macro `sigsetjmp` + (("-Wall -Werror") "-Wall") + ;; Disable strict checks in GCC 14 + (("\"-O2 -fno-strict-aliasing -fwrapv\"") + (string-append "\"-O2 -fno-strict-aliasing -fwrapv " + "-Wno-incompatible-pointer-types " + "-Wno-implicit-function-declaration\""))) + ;; The GCC 14 flags above apply to the source build + ;; itself but not when calling config helper scripts, so + ;; update these too. + (substitute* + '("config/auto-aux/hasgot" + "config/auto-aux/hasgot2") + (("[$]cflags") + (string-append "$cflags -Wno-incompatible-pointer-types " + "-Wno-implicit-function-declaration"))))) (add-before 'configure 'copy-bootstrap (lambda* (#:key inputs #:allow-other-keys) (let ((ocaml (assoc-ref inputs "ocaml")))