~ruther/guix-local

43673b96dc2e0f8b204ded391dc4075ac1d9c309 — Jason Conroy 1 year, 11 days ago 971f0e4
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 <julien@lepiller.eu>
1 files changed, 29 insertions(+), 1 deletions(-)

M gnu/packages/ocaml.scm
M gnu/packages/ocaml.scm => gnu/packages/ocaml.scm +29 -1
@@ 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 ("<feature> 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")))