about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-02-08 20:01:43 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-11 21:49:06 +0000
commit78367ae5cbc49899e69c3d58ed83df264e583528 (patch)
tree8c601382d023f8d2ab1b839a5575746766a9a555
parent6d87734c880d704f6ee13e5c0fe835b98918c34e (diff)
ocaml-ng.ocamlPackages_4_09.ocaml: fix with GCC 12
-rw-r--r--pkgs/development/compilers/ocaml/4.09.1-Werror.patch16
-rw-r--r--pkgs/development/compilers/ocaml/4.09.nix1
2 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/development/compilers/ocaml/4.09.1-Werror.patch b/pkgs/development/compilers/ocaml/4.09.1-Werror.patch
new file mode 100644
index 0000000000000..153c8a06e34eb
--- /dev/null
+++ b/pkgs/development/compilers/ocaml/4.09.1-Werror.patch
@@ -0,0 +1,16 @@
+The 4.09.1 tarball appears to have been acidentally generated as a
+development tarball, which causes configure to enable -Werror.  This
+means newer compilers will make the build fail.
+
+diff a/configure b/configure
+--- a/configure
++++ b/configure
+@@ -12360,7 +12360,7 @@ case $ocaml_cv_cc_vendor in #(
+   msvc-*) :
+     outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings="" ;; #(
+   *) :
+-    outputobj='-o $(EMPTY)'; case 4.09.1+dev1-2020-03-13 in #(
++    outputobj='-o $(EMPTY)'; case 4.09.1 in #(
+   *+dev*) :
+     gcc_warnings="-Wall -Werror" ;; #(
+   *) :
diff --git a/pkgs/development/compilers/ocaml/4.09.nix b/pkgs/development/compilers/ocaml/4.09.nix
index c5f649c15d6bb..2d06720939052 100644
--- a/pkgs/development/compilers/ocaml/4.09.nix
+++ b/pkgs/development/compilers/ocaml/4.09.nix
@@ -8,6 +8,7 @@ import ./generic.nix {
   hardeningDisable = [ "strictoverflow" ];
 
   patches = [
+    ./4.09.1-Werror.patch
     # Compatibility with Glibc 2.34
     { url = "https://github.com/ocaml/ocaml/commit/8eed2e441222588dc385a98ae8bd6f5820eb0223.patch";
       sha256 = "sha256:1b3jc6sj2k23yvfwrv6nc1f4x2n2biqbhbbp74aqb6iyqyjsq35n"; }