From 43673b96dc2e0f8b204ded391dc4075ac1d9c309 Mon Sep 17 00:00:00 2001 From: Jason Conroy Date: Sat, 20 Sep 2025 15:00:43 +0000 Subject: [PATCH] gnu: camlboot: Fix build with gcc@14. * gnu/packages/ocaml.scm (camlboot)[arguments]: <#:phases>{patch-makefile}: Make configure errors more visible. <#: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: I132ae6af1360f63cccfa6dd3afcb643c92726487 Signed-off-by: Julien Lepiller --- gnu/packages/ocaml.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 558e345cbd353c97c8ccf67c27d84211c75abca2..38857e084a40ff4bb02d8140ed28adfab300f7e9 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -162,7 +162,35 @@ #:phases (modify-phases %standard-phases (delete 'configure) - (add-before 'build 'no-autocompile + (add-after 'unpack 'patch-makefile + (lambda _ + (substitute* + ;; Problems during the configure phase tend to cause build + ;; failures (" not implemented") after hours of + ;; compile time. Run the configure script verbosely to make + ;; these problems more visible. + "Makefile" + (("bash configure") "bash configure --verbose")))) + (add-after 'unpack 'patch-cflags + (lambda _ + (substitute* + "ocaml-src/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* + '("ocaml-src/config/auto-aux/hasgot" + "ocaml-src/config/auto-aux/hasgot2") + (("[$]cflags") + (string-append "$cflags -Wno-incompatible-pointer-types " + "-Wno-implicit-function-declaration"))))) + (add-before 'build 'no-autocompile (lambda _ ;; prevent a guile warning (setenv "GUILE_AUTO_COMPILE" "0")))