~ruther/guix-local

ec4f475b7c693943f8ecb1326513ad1176b7f9cb — Jason Conroy 5 months ago 43673b9
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 <julien@lepiller.eu>
1 files changed, 20 insertions(+), 0 deletions(-)

M gnu/packages/ocaml.scm
M gnu/packages/ocaml.scm => gnu/packages/ocaml.scm +20 -0
@@ 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")))