[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/

2024-06-22 Thread Conrad Kostecki
commit: acc130ae2b9d811437a7b3b42bc9c8786c9d26fd
Author: Michael Mair-Keimberger  levelnine  at>
AuthorDate: Tue Jun 18 17:21:25 2024 +
Commit: Conrad Kostecki  gentoo  org>
CommitDate: Sat Jun 22 18:50:37 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acc130ae

dev-lang/ocaml: remove unused patch

Signed-off-by: Michael Mair-Keimberger  levelnine.at>
Signed-off-by: Conrad Kostecki  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.14.0-clang.patch | 132 --
 1 file changed, 132 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch 
b/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch
deleted file mode 100644
index cd3c042f2639..
--- a/dev-lang/ocaml/files/ocaml-4.14.0-clang.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-commit 28b553622bd0f168411d86ddcfba1adab0d87b92
-Author: Yawar Amin 
-Date:   Mon Nov 15 22:40:43 2021 -0500
-
-Fix ranlib error
-
-- Always pass ranlib one file argument at a time to avoid error 'Exactly
-  one archive should be specified'
-- Call ranlib without cd'ing into the library's directory
-- Use Makefile functionality to simplify recipes
-
-diff --git a/Makefile b/Makefile
-index c2522c775..2e4e44faa 100644
 a/Makefile
-+++ b/Makefile
-@@ -549,6 +549,8 @@ else
- endif
-   $(MAKE) -C tools installopt
- 
-+LIBRARIES = $(addsuffix .$(A), ocamlcommon ocamlbytecomp ocamloptcomp)
-+
- .PHONY: installoptopt
- installoptopt:
-   $(INSTALL_PROG) ocamlc.opt$(EXE) "$(INSTALL_BINDIR)"
-@@ -585,8 +587,11 @@ endif
- ifeq "$(INSTALL_OCAMLNAT)" "true"
- $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)"
- endif
--  cd "$(INSTALL_COMPLIBDIR)" && \
-- $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A)
-+# Some versions of ranlib do not support multiple archives
-+  for library in $(LIBRARIES); \
-+  do \
-+$(RANLIB) "$(INSTALL_COMPLIBDIR)/$$library"; \
-+  done
- 
- # Installation of the *.ml sources of compiler-libs
- .PHONY: install-compiler-sources
-diff --git a/otherlibs/Makefile.otherlibs.common 
b/otherlibs/Makefile.otherlibs.common
-index 95ff4d58f..6a4451e47 100644
 a/otherlibs/Makefile.otherlibs.common
-+++ b/otherlibs/Makefile.otherlibs.common
-@@ -95,7 +95,7 @@ install::
-   fi
- ifneq "$(STUBSLIB)" ""
-   $(INSTALL_DATA) $(STUBSLIB) "$(INSTALL_LIBDIR)/"
--  cd "$(INSTALL_LIBDIR)"; $(RANLIB) lib$(CLIBNAME).$(A)
-+  $(RANLIB) "$(INSTALL_LIBDIR)/lib$(CLIBNAME).$(A)"
- endif
- 
-   $(INSTALL_DATA) \
-@@ -104,7 +104,7 @@ endif
- ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
-   $(INSTALL_DATA) \
- $(CMIFILES:.cmi=.mli) \
--  $(CMIFILES:.cmi=.cmti) \
-+  $(CMIFILES:.cmi=.cmti) \
- "$(INSTALL_LIBDIR)/"
- endif
-   if test -n "$(HEADERS)"; then \
-@@ -115,7 +115,7 @@ installopt:
-   $(INSTALL_DATA) \
-  $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \
-  "$(INSTALL_LIBDIR)/"
--  cd "$(INSTALL_LIBDIR)"; $(RANLIB) $(LIBNAME).a
-+  $(RANLIB) "$(INSTALL_LIBDIR)/$(LIBNAME).$(A)"
-   if test -f $(LIBNAME).cmxs; then \
- $(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR)"; \
-   fi
-diff --git a/otherlibs/dynlink/Makefile b/otherlibs/dynlink/Makefile
-index 6b02dc197..dccc45103 100644
 a/otherlibs/dynlink/Makefile
-+++ b/otherlibs/dynlink/Makefile
-@@ -249,12 +249,12 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
- endif
- 
- installopt:
--  if $(NATDYNLINK); then \
--$(INSTALL_DATA) \
--  $(NATOBJS) dynlink.cmxa dynlink.$(A) \
--  "$(INSTALL_LIBDIR)" && \
--cd "$(INSTALL_LIBDIR)" && $(RANLIB) dynlink.$(A); \
--  fi
-+ifeq "$(NATDYNLINK)" "true"
-+  $(INSTALL_DATA) \
-+$(NATOBJS) dynlink.cmxa dynlink.$(A) \
-+"$(INSTALL_LIBDIR)"
-+  $(RANLIB) "$(INSTALL_LIBDIR)/dynlink.$(A)"
-+endif
- 
- partialclean:
-   rm -f $(extract_crc) *.cm[ioaxt] *.cmti *.cmxa \
-diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
-index 8fc1bdb92..379c530fa 100644
 a/otherlibs/systhreads/Makefile
-+++ b/otherlibs/systhreads/Makefile
-@@ -121,7 +121,7 @@ install:
- $(INSTALL_PROG) dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \
-   fi
-   $(INSTALL_DATA) libthreads.$(A) "$(INSTALL_LIBDIR)"
--  cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreads.$(A)
-+  $(RANLIB) "$(INSTALL_LIBDIR)/libthreads.$(A)"
-   mkdir -p "$(INSTALL_THREADSLIBDIR)"
-   $(INSTALL_DATA) \
- $(CMIFILES) threads.cma \
-@@ -136,11 +136,11 @@ endif
- 
- installopt:
-   $(INSTALL_DATA) libthreadsnat.$(A) "$(INSTALL_LIBDIR)"
--  cd "$(INSTALL_LIBDIR)"; $(RANLIB) libthreadsnat.$(A)
-+  $(RANLIB) "$(INSTALL_LIBDIR)/libthreadsnat.$(A)"
-   $(INSTALL_DATA) \
- $(THREADS_NCOBJS) threads.cmxa threads.$(A) \
- "$(INSTALL_THREADSLIBDIR)"
--  cd "$(INSTALL_THREADSLIBDIR)" && $(RANLIB) threads.$(A)
-+  $(RANLIB) 

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/

2023-11-15 Thread Alfredo Tupone
commit: afa9c354085529b2b8f88418645a3b34fe5f4bcc
Author: Michael Mair-Keimberger  levelnine  at>
AuthorDate: Tue Nov  7 18:02:45 2023 +
Commit: Alfredo Tupone  gentoo  org>
CommitDate: Wed Nov 15 17:26:47 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=afa9c354

dev-lang/ocaml: remove unused patch

Signed-off-by: Michael Mair-Keimberger  levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/33710
Signed-off-by: Alfredo Tupone  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch | 13 -
 1 file changed, 13 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch 
b/dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch
deleted file mode 100644
index ceeb82991098..
--- a/dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://bugs.gentoo.org/459512
-
 ocaml-4.04.2/configure
-+++ ocaml-4.04.2/configure
-@@ -1095,7 +1095,7 @@
- # For the terminfo module
- 
- if test "$with_curses" = "yes"; then
--  for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
-+  for libs in "" "-ltinfo" "-lcurses" "-ltermcap" "-lcurses -ltermcap" 
"-lncurses"; do
- if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
-   inf "termcap functions found (with libraries '$libs')"
-   echo "#define HAS_TERMCAP" >> s.h



[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2022-03-03 Thread Sam James
commit: 1eabb8b88db7647b7a04300ead166f4e4e852951
Author: Sam James  gentoo  org>
AuthorDate: Fri Mar  4 00:55:27 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Mar  4 00:56:31 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1eabb8b8

dev-lang/ocaml: drop 4.09.0-r2

Bug: https://bugs.gentoo.org/804498
Signed-off-by: Sam James  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch |  65 
 dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch |  21 -
 dev-lang/ocaml/ocaml-4.09.0-r2.ebuild  | 104 -
 3 files changed, 190 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch 
b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
deleted file mode 100644
index d0a947da0ea6..
--- a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
+++ /dev/null
@@ -1,65 +0,0 @@
 a/runtime/Makefile
-+++ b/runtime/Makefile
-@@ -335,7 +335,7 @@
- # (without the extension, which is added by the macro)
- define COMPILE_C_FILE
- $(1).$(O): %.c
--  $$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
-+  $$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$<
- endef
- 
- object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic
 a/yacc/Makefile
-+++ b/yacc/Makefile
-@@ -63,4 +63,4 @@
- # also works for .obj files.
- 
- %.$(O): %.c
--  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
-+  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
 a/otherlibs/Makefile.otherlibs.common
-+++ b/otherlibs/Makefile.otherlibs.common
-@@ -138,4 +138,4 @@
-   $(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $<
- 
- .c.$(O):
--  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
-+  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
 a/ocamltest/Makefile
-+++ b/ocamltest/Makefile
-@@ -221,7 +221,7 @@
-   $(ocamllex) -q $<
- 
- %.$(O): %.c
--  $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -c $<
-+  $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -c $<
- 
- ocamltest_config.ml: ocamltest_config.ml.in Makefile ../Makefile.config
-   sed \
 a/otherlibs/systhreads/Makefile
-+++ b/otherlibs/systhreads/Makefile
-@@ -93,11 +93,11 @@
- # twice, each time with different options).
- 
- st_stubs_b.$(O): st_stubs.c $(HEADER)
--  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime  \
-+  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime  \
- $(SHAREDLIB_CFLAGS) $(OUTPUTOBJ)$@ $<
- 
- st_stubs_n.$(O): st_stubs.c $(HEADER)
--  $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) \
-+  $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) \
- -I$(ROOTDIR)/runtime $(SHAREDLIB_CFLAGS) -DNATIVE_CODE \
- -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) \
- $(OUTPUTOBJ)$@ -c $<
 a/tools/Makefile
-+++ b/tools/Makefile
-@@ -322,7 +322,7 @@
- endif
- 
- objinfo_helper$(EXE): objinfo_helper.c $(ROOTDIR)/runtime/caml/s.h
--  $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \
-+  $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime 
$(OUTPUTEXE)$@ \
-   $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK)
- 
- OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch 
b/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch
deleted file mode 100644
index e25d55a5f668..
--- a/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch
+++ /dev/null
@@ -1,21 +0,0 @@
 a/runtime/backtrace.c
-+++ b/runtime/backtrace.c
-@@ -28,7 +28,7 @@
- #include "caml/fail.h"
- 
- /* The table of debug information fragments */
--struct ext_table caml_debug_info;
-+extern struct ext_table caml_debug_info;
- 
- CAMLexport int32_t caml_backtrace_active = 0;
- CAMLexport int32_t caml_backtrace_pos = 0;
 a/runtime/startup_nat.c
-+++ b/runtime/startup_nat.c
-@@ -44,7 +44,6 @@
- #endif
- 
- extern int caml_parser_trace;
--CAMLexport header_t caml_atom_table[256];
- char * caml_code_area_start, * caml_code_area_end;
- struct ext_table caml_code_fragments_table;
- 

diff --git a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild 
b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
deleted file mode 100644
index f889bc03a12a..
--- a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic
-
-HOMEPAGE="https://ocaml.org/;
-SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz"
-DESCRIPTION="Programming language supporting functional, imperative & 
object-oriented styles"
-
-LICENSE="LGPL-2.1"
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 x86 ~amd64-linux 
~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-IUSE="emacs flambda latex +ocamlopt spacetime xemacs"
-
-RDEPEND="sys-libs/binutils-libs:=
-   spacetime? ( 

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2022-02-21 Thread Sam James
commit: 9e8369277b272b15f3dd1159fa18b71ec4431a77
Author: Sam James  gentoo  org>
AuthorDate: Tue Feb 22 00:58:44 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Feb 22 00:58:44 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e836927

dev-lang/ocaml: drop 4.05.0-r7, 4.05.0-r8, 4.10.2-r2

Signed-off-by: Sam James  gentoo.org>

 .../ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch   |  70 -
 dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch  |  59 
 dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch |  42 --
 dev-lang/ocaml/ocaml-4.05.0-r7.ebuild  | 155 
 dev-lang/ocaml/ocaml-4.05.0-r8.ebuild  | 156 -
 dev-lang/ocaml/ocaml-4.10.2-r2.ebuild  | 105 --
 6 files changed, 587 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch 
b/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch
deleted file mode 100644
index cfe3ff636c25..
--- a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-https://bugs.gentoo.org/755257
-
-Needed for both fixing the CVE + compatibility with Debian for e.g.
-Unison.
-
-From c6ca3afc78b75d7748e4e09e56c6b020418be06e Mon Sep 17 00:00:00 2001
-From: Stephane Glondu 
-Date: Fri, 25 Jan 2019 14:34:23 +0100
-Subject: [PATCH] Fix integer overflows when unmarshaling a bigarray
-
-Malicious or corrupted marshaled data can result in a bigarray
-with impossibly large dimensions that cause overflow when computing
-the in-memory size of the bigarray.  Disaster ensues when the data
-is read in a too small memory area.  This commit checks for overflows
-when computing the in-memory size of the bigarray.
-
-This patch is based on one by Xavier Leroy and has been modified to
-use caml_ba_multov instead of caml_umul_overflow which is unavailable
-in OCaml 4.05.0.
-
-The original commit hash is 85162eee9d4072fa9c2f498f03cd94e357033eec.
-
-Origin: https://github.com/ocaml/ocaml/pull/1718
-Bug: https://github.com/ocaml/ocaml/issues/7765
-Bug-Debian: https://bugs.debian.org/895472
-Bug-CVE: CVE-2018-9838
 a/otherlibs/bigarray/bigarray_stubs.c
-+++ b/otherlibs/bigarray/bigarray_stubs.c
-@@ -966,22 +966,34 @@ static void caml_ba_deserialize_longarray(void * dest, 
intnat num_elts)
- uintnat caml_ba_deserialize(void * dst)
- {
-   struct caml_ba_array * b = dst;
--  int i, elt_size;
--  uintnat num_elts;
-+  int i;
-+  uintnat num_elts, size;
-+  int overflow;
- 
-   /* Read back header information */
-   b->num_dims = caml_deserialize_uint_4();
-+  if (b->num_dims < 0 || b->num_dims > CAML_BA_MAX_NUM_DIMS)
-+caml_deserialize_error("input_value: wrong number of bigarray 
dimensions");
-   b->flags = caml_deserialize_uint_4() | CAML_BA_MANAGED;
-   b->proxy = NULL;
-   for (i = 0; i < b->num_dims; i++) b->dim[i] = caml_deserialize_uint_4();
--  /* Compute total number of elements */
--  num_elts = caml_ba_num_elts(b);
--  /* Determine element size in bytes */
-+  /* Compute total number of elements.  Watch out for overflows (MPR#7765). */
-+  num_elts = 1;
-+  for (i = 0; i < b->num_dims; i++) {
-+overflow = 0;
-+num_elts = caml_ba_multov(num_elts, b->dim[i], );
-+if (overflow)
-+  caml_deserialize_error("input_value: size overflow for bigarray");
-+  }
-+  /* Determine array size in bytes.  Watch out for overflows (MPR#7765). */
-   if ((b->flags & CAML_BA_KIND_MASK) > CAML_BA_CHAR)
- caml_deserialize_error("input_value: bad bigarray kind");
--  elt_size = caml_ba_element_size[b->flags & CAML_BA_KIND_MASK];
-+  overflow = 0;
-+  size = caml_ba_multov(num_elts, caml_ba_element_size[b->flags & 
CAML_BA_KIND_MASK], );
-+  if (overflow)
-+caml_deserialize_error("input_value: size overflow for bigarray");
-   /* Allocate room for data */
--  b->data = malloc(elt_size * num_elts);
-+  b->data = malloc(size);
-   if (b->data == NULL)
- caml_deserialize_error("input_value: out of memory for bigarray");
-   /* Read data */

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch 
b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
deleted file mode 100644
index 8b2e99883167..
--- a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
+++ /dev/null
@@ -1,59 +0,0 @@
 a/byterun/caml/intext.h
-+++ b/byterun/caml/intext.h
-@@ -196,7 +196,7 @@
- 
- CAMLextern struct code_fragment * caml_extern_find_code(char *addr);
- 
--struct ext_table caml_code_fragments_table;
-+extern struct ext_table caml_code_fragments_table;
- 
- #endif /* CAML_INTERNALS */
- 
 a/byterun/caml/major_gc.h
-+++ b/byterun/caml/major_gc.h
-@@ -64,9 +64,9 @@
- extern char *caml_gc_sweep_hp;
- 
- extern int caml_major_window;
--double caml_major_ring[Max_major_window];
--int caml_major_ring_index;
--double caml_major_work_credit;
-+extern double caml_major_ring[Max_major_window];
-+extern int caml_major_ring_index;
-+extern double caml_major_work_credit;
- extern double caml_gc_clock;

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/

2022-02-21 Thread Sam James
commit: b25f82e790bbcf0f05f434212958ae2e192df08e
Author: Sam James  gentoo  org>
AuthorDate: Tue Feb 22 00:46:37 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Feb 22 00:46:37 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b25f82e7

dev-lang/ocaml: scrub patches

Signed-off-by: Sam James  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch  | 20 +-
 dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch | 15 --
 dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch | 24 +++---
 dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch | 15 --
 dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch | 16 +++
 dev-lang/ocaml/files/ocaml-4.10.2-glibc-2.34.patch | 18 
 6 files changed, 30 insertions(+), 78 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch 
b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
index a0c67da534a0..8b2e99883167 100644
--- a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
+++ b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch
@@ -1,5 +1,5 @@
 a/byterun/caml/intext.h2021-01-28 22:46:20.400224678 +0100
-+++ b/byterun/caml/intext.h2021-01-28 22:46:49.312751054 +0100
+--- a/byterun/caml/intext.h
 b/byterun/caml/intext.h
 @@ -196,7 +196,7 @@
  
  CAMLextern struct code_fragment * caml_extern_find_code(char *addr);
@@ -9,8 +9,8 @@
  
  #endif /* CAML_INTERNALS */
  
 a/byterun/caml/major_gc.h  2021-01-28 22:44:12.193323457 +0100
-+++ b/byterun/caml/major_gc.h  2021-01-28 22:45:20.918198701 +0100
+--- a/byterun/caml/major_gc.h
 b/byterun/caml/major_gc.h
 @@ -64,9 +64,9 @@
  extern char *caml_gc_sweep_hp;
  
@@ -24,8 +24,8 @@
  extern double caml_gc_clock;
  
  /* [caml_major_gc_hook] is called just between the end of the mark
 a/byterun/meta.c   2021-01-28 22:47:34.148016359 +0100
-+++ b/byterun/meta.c   2021-01-28 22:47:56.048657393 +0100
+--- a/byterun/meta.c
 b/byterun/meta.c
 @@ -32,6 +32,8 @@
  #include "caml/prims.h"
  #include "caml/stacks.h"
@@ -35,8 +35,8 @@
  #ifndef NATIVE_CODE
  
  CAMLprim value caml_get_global_data(value unit)
 a/byterun/backtrace.c  2021-01-28 22:50:25.275226598 +0100
-+++ b/byterun/backtrace.c  2021-01-28 22:50:37.541027290 +0100
+--- a/byterun/backtrace.c
 b/byterun/backtrace.c
 @@ -28,7 +28,7 @@
  #include "caml/fail.h"
  
@@ -46,8 +46,8 @@
  
  CAMLexport int32_t caml_backtrace_active = 0;
  CAMLexport int32_t caml_backtrace_pos = 0;
 a/asmrun/startup.c 2021-01-28 23:02:50.526072662 +0100
-+++ b/asmrun/startup.c 2021-01-28 23:03:09.977754311 +0100
+--- a/asmrun/startup.c
 b/asmrun/startup.c
 @@ -44,7 +44,7 @@
  #endif
  

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch 
b/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
index 28d7f48f5b27..d95d2bb0fa50 100644
--- a/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
+++ b/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
@@ -18,15 +18,6 @@ The alternate signal stack is freed when the main OCaml code 
/ an OCaml thread
 stops.
 
 (partial back-port of PR#10266 and PR#10726)

- asmrun/fail.c|  7 -
- asmrun/signals_asm.c | 69 ++--
- asmrun/startup.c |  7 -
- byterun/sys.c|  5 
- 4 files changed, 77 insertions(+), 11 deletions(-)
-
-diff --git a/asmrun/fail.c b/asmrun/fail.c
-index d73cb88524c..2f064320185 100644
 --- a/asmrun/fail.c
 +++ b/asmrun/fail.c
 @@ -31,6 +31,8 @@
@@ -50,8 +41,6 @@ index d73cb88524c..2f064320185 100644
  
  #ifndef Stack_grows_upwards
  #define PUSHED_AFTER <
-diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c
-index f124a076749..b4e2516ae1a 100644
 --- a/asmrun/signals_asm.c
 +++ b/asmrun/signals_asm.c
 @@ -194,7 +194,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
@@ -140,8 +129,6 @@ index f124a076749..b4e2516ae1a 100644
 +  }
 +#endif
 +}
-diff --git a/asmrun/startup.c b/asmrun/startup.c
-index 70bbc4369dc..a1cb06a7d1e 100644
 --- a/asmrun/startup.c
 +++ b/asmrun/startup.c
 @@ -92,6 +92,7 @@ void (*caml_termination_hook)(void *) = NULL;
@@ -175,8 +162,6 @@ index 70bbc4369dc..a1cb06a7d1e 100644
  }
  
  void caml_startup(char **argv)
-diff --git a/byterun/sys.c b/byterun/sys.c
-index 3706e9002d5..aa152239ebf 100644
 --- a/byterun/sys.c
 +++ b/byterun/sys.c
 @@ -111,6 +111,8 @@ static void caml_sys_check_path(value name)

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch 
b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
index 8d2391407a35..d0a947da0ea6 100644
--- a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
+++ b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
@@ -1,5 +1,5 @@
 a/runtime/Makefile 2022-01-22 19:49:32.914213696 +0100
-+++ b/runtime/Makefile 2022-01-22 19:50:03.765640701 +0100
+--- a/runtime/Makefile
 b/runtime/Makefile
 @@ -335,7 +335,7 @@
  # (without the extension, which is added by the macro)
  define COMPILE_C_FILE
@@ -9,24 +9,24 @@
  endef
  
  

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2022-02-21 Thread Sam James
commit: 860e2f272f0a0a2fecb2ab6f160ce68875770f59
Author: Sam James  gentoo  org>
AuthorDate: Tue Feb 22 00:40:45 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Feb 22 00:41:14 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=860e2f27

dev-lang/ocaml: fix 4.05 with glibc 2.34

Bug: https://bugs.gentoo.org/804498
See: https://github.com/gentoo/gentoo/pull/22851#pullrequestreview-882504245
Signed-off-by: Sam James  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch | 201 +
 dev-lang/ocaml/ocaml-4.05.0-r9.ebuild  | 157 
 2 files changed, 358 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch 
b/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
new file mode 100644
index ..28d7f48f5b27
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.05.0-glibc-2.34.patch
@@ -0,0 +1,201 @@
+https://github.com/ocaml/ocaml/commit/50c2d1275e537906ea144bd557fde31e0bf16e5f
+https://bugs.gentoo.org/804498
+
+From 50c2d1275e537906ea144bd557fde31e0bf16e5f Mon Sep 17 00:00:00 2001
+From: Xavier Leroy 
+Date: Fri, 5 Mar 2021 19:14:07 +0100
+Subject: [PATCH] Dynamically allocate the alternate signal stack
+
+In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
+It is no longer possible to statically allocate the alternate signal
+stack for the main thread, as we've been doing for the last 25 years.
+
+This commit implements dynamic allocation of the alternate signal stack
+even for the main thread.  It reuses the code already in place to allocate
+the alternate signal stack for other threads.
+
+The alternate signal stack is freed when the main OCaml code / an OCaml thread
+stops.
+
+(partial back-port of PR#10266 and PR#10726)
+---
+ asmrun/fail.c|  7 -
+ asmrun/signals_asm.c | 69 ++--
+ asmrun/startup.c |  7 -
+ byterun/sys.c|  5 
+ 4 files changed, 77 insertions(+), 11 deletions(-)
+
+diff --git a/asmrun/fail.c b/asmrun/fail.c
+index d73cb88524c..2f064320185 100644
+--- a/asmrun/fail.c
 b/asmrun/fail.c
+@@ -31,6 +31,8 @@
+ #include "caml/roots.h"
+ #include "caml/callback.h"
+ 
++extern void caml_terminate_signals(void);
++
+ /* The globals holding predefined exceptions */
+ 
+ typedef value caml_generated_constant[1];
+@@ -60,7 +62,10 @@ char * caml_exception_pointer = NULL;
+ void caml_raise(value v)
+ {
+   Unlock_exn();
+-  if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v);
++  if (caml_exception_pointer == NULL) {
++caml_terminate_signals();
++caml_fatal_uncaught_exception(v);
++  }
+ 
+ #ifndef Stack_grows_upwards
+ #define PUSHED_AFTER <
+diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c
+index f124a076749..b4e2516ae1a 100644
+--- a/asmrun/signals_asm.c
 b/asmrun/signals_asm.c
+@@ -194,7 +194,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+ 
+ static char * system_stack_top;
+-static char sig_alt_stack[SIGSTKSZ];
+ 
+ #if defined(SYS_linux)
+ /* PR#4746: recent Linux kernels with support for stack randomization
+@@ -295,17 +294,69 @@ void caml_init_signals(void)
+   {
+ stack_t stk;
+ struct sigaction act;
+-stk.ss_sp = sig_alt_stack;
+-stk.ss_size = SIGSTKSZ;
+-stk.ss_flags = 0;
+-SET_SIGACT(act, segv_handler);
+-act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+-sigemptyset(_mask);
+-system_stack_top = (char *) 
+-if (sigaltstack(, NULL) == 0) { sigaction(SIGSEGV, , NULL); }
++/* Allocate and select an alternate stack for handling signals,
++   especially SIGSEGV signals.
++   The alternate stack used to be statically-allocated for the main 
thread,
++   but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
++   may not be a compile-time constant. */
++stk.ss_sp = malloc(SIGSTKSZ);
++if (stk.ss_sp != NULL) {
++  stk.ss_size = SIGSTKSZ;
++  stk.ss_flags = 0;
++  SET_SIGACT(act, segv_handler);
++  act.sa_flags |= SA_ONSTACK | SA_NODEFER;
++  sigemptyset(_mask);
++  system_stack_top = (char *) 
++  if (sigaltstack(, NULL) == 0)
++sigaction(SIGSEGV, , NULL);
++  else
++free(stk.ss_sp);
++}
+   }
+ #endif
+ #if defined(_WIN32) && !defined(_WIN64)
+   caml_win32_overflow_detection();
+ #endif
+ }
++
++/* Termination of signal stuff */
++
++#if defined(TARGET_power) || defined(TARGET_s390x) \
++|| defined(TARGET_sparc) && defined(SYS_solaris) \
++|| defined(HAS_STACK_OVERFLOW_DETECTION)
++static void set_signal_default(int signum)
++{
++  struct sigaction act;
++  sigemptyset(_mask);
++  act.sa_handler = SIG_DFL;
++  act.sa_flags = 0;
++  sigaction(signum, , NULL);
++}
++#endif
++
++void caml_terminate_signals(void)
++{
++#if defined(TARGET_sparc) && defined(SYS_solaris)
++  set_signal_default(SIGILL);
++#endif
++
++#if defined(TARGET_power)
++  set_signal_default(SIGTRAP);
++#endif
++

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2022-02-21 Thread Sam James
commit: a5945b83a4ee29d228e1a56101483001da291c54
Author: Sam James  gentoo  org>
AuthorDate: Tue Feb 22 00:29:23 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Feb 22 00:41:18 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5945b83

dev-lang/ocaml: fix 4.09 with glibc 2.34

Bug: https://bugs.gentoo.org/804498
See: https://github.com/gentoo/gentoo/pull/22851#pullrequestreview-882504245
Signed-off-by: Sam James  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch | 193 +
 dev-lang/ocaml/ocaml-4.09.0-r3.ebuild  | 105 +++
 2 files changed, 298 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch 
b/dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch
new file mode 100644
index ..6f74d38e80b6
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.09.0-glibc-2.34.patch
@@ -0,0 +1,193 @@
+https://github.com/ocaml/ocaml/commit/8eed2e441222588dc385a98ae8bd6f5820eb0223
+https://github.com/gentoo/gentoo/pull/22851#pullrequestreview-882504245
+
+From 8eed2e441222588dc385a98ae8bd6f5820eb0223 Mon Sep 17 00:00:00 2001
+From: Xavier Leroy 
+Date: Fri, 5 Mar 2021 19:14:07 +0100
+Subject: [PATCH] Dynamically allocate the alternate signal stack
+
+In Glibc 2.34 and later, SIGSTKSZ may not be a compile-time constant.
+It is no longer possible to statically allocate the alternate signal
+stack for the main thread, as we've been doing for the last 25 years.
+
+This commit implements dynamic allocation of the alternate signal stack
+even for the main thread.  It reuses the code already in place to allocate
+the alternate signal stack for other threads.
+
+The alternate signal stack is freed when the main OCaml code / an OCaml thread
+stops.
+
+(partial back-port of PR#10266 and PR#10726)
+---
+ runtime/fail_nat.c|  7 -
+ runtime/signals_nat.c | 64 +--
+ runtime/startup_nat.c |  7 -
+ runtime/sys.c |  5 
+ 4 files changed, 72 insertions(+), 11 deletions(-)
+
+diff --git a/runtime/fail_nat.c b/runtime/fail_nat.c
+index e1f687d379e..cbf7633ee9e 100644
+--- a/runtime/fail_nat.c
 b/runtime/fail_nat.c
+@@ -31,6 +31,8 @@
+ #include "caml/roots.h"
+ #include "caml/callback.h"
+ 
++extern void caml_terminate_signals(void);
++
+ /* The globals holding predefined exceptions */
+ 
+ typedef value caml_generated_constant[1];
+@@ -60,7 +62,10 @@ char * caml_exception_pointer = NULL;
+ void caml_raise(value v)
+ {
+   Unlock_exn();
+-  if (caml_exception_pointer == NULL) caml_fatal_uncaught_exception(v);
++  if (caml_exception_pointer == NULL) {
++caml_terminate_signals();
++caml_fatal_uncaught_exception(v);
++  }
+ 
+   while (caml_local_roots != NULL &&
+  (char *) caml_local_roots < caml_exception_pointer) {
+diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c
+index 29a5f49e625..351b575a08e 100644
+--- a/runtime/signals_nat.c
 b/runtime/signals_nat.c
+@@ -182,7 +182,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+ 
+ static char * system_stack_top;
+-static char sig_alt_stack[SIGSTKSZ];
+ 
+ #if defined(SYS_linux)
+ /* PR#4746: recent Linux kernels with support for stack randomization
+@@ -275,14 +274,61 @@ void caml_init_signals(void)
+   {
+ stack_t stk;
+ struct sigaction act;
+-stk.ss_sp = sig_alt_stack;
+-stk.ss_size = SIGSTKSZ;
+-stk.ss_flags = 0;
+-SET_SIGACT(act, segv_handler);
+-act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+-sigemptyset(_mask);
+-system_stack_top = (char *) 
+-if (sigaltstack(, NULL) == 0) { sigaction(SIGSEGV, , NULL); }
++/* Allocate and select an alternate stack for handling signals,
++   especially SIGSEGV signals.
++   The alternate stack used to be statically-allocated for the main 
thread,
++   but this is incompatible with Glibc 2.34 and newer, where SIGSTKSZ
++   may not be a compile-time constant. */
++stk.ss_sp = malloc(SIGSTKSZ);
++if (stk.ss_sp != NULL) {
++  stk.ss_size = SIGSTKSZ;
++  stk.ss_flags = 0;
++  SET_SIGACT(act, segv_handler);
++  act.sa_flags |= SA_ONSTACK | SA_NODEFER;
++  sigemptyset(_mask);
++  system_stack_top = (char *) 
++  if (sigaltstack(, NULL) == 0)
++sigaction(SIGSEGV, , NULL);
++  else
++free(stk.ss_sp);
++}
++  }
++#endif
++}
++
++/* Termination of signal stuff */
++
++#if defined(TARGET_power) || defined(TARGET_s390x) \
++|| defined(HAS_STACK_OVERFLOW_DETECTION)
++static void set_signal_default(int signum)
++{
++  struct sigaction act;
++  sigemptyset(_mask);
++  act.sa_handler = SIG_DFL;
++  act.sa_flags = 0;
++  sigaction(signum, , NULL);
++}
++#endif
++
++void caml_terminate_signals(void)
++{
++#if defined(TARGET_power)
++  set_signal_default(SIGTRAP);
++#endif
++
++#if defined(TARGET_s390x)
++  set_signal_default(SIGFPE);
++#endif
++
++#ifdef HAS_STACK_OVERFLOW_DETECTION
++  

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2022-01-23 Thread Alfredo Tupone
commit: b621f163b9af5f8949f0ce1ce1bc13651562b3ff
Author: Alfredo Tupone  gentoo  org>
AuthorDate: Sun Jan 23 18:13:37 2022 +
Commit: Alfredo Tupone  gentoo  org>
CommitDate: Sun Jan 23 18:13:37 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b621f163

dev-lang/ocaml: respect CFLAGS

Closes: https://bugs.gentoo.org/719166
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Alfredo Tupone  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch | 11 ++
 ...09.0-cflags.patch => ocaml-4.10.2-cflags.patch} | 46 --
 dev-lang/ocaml/ocaml-4.05.0-r7.ebuild  |  4 +-
 dev-lang/ocaml/ocaml-4.05.0-r8.ebuild  |  4 +-
 dev-lang/ocaml/ocaml-4.09.0-r2.ebuild  |  2 +
 dev-lang/ocaml/ocaml-4.10.2-r2.ebuild  |  8 +++-
 dev-lang/ocaml/ocaml-4.11.2-r2.ebuild  |  5 ++-
 dev-lang/ocaml/ocaml-4.12.1.ebuild |  4 +-
 dev-lang/ocaml/ocaml-4.13.1.ebuild |  4 +-
 9 files changed, 53 insertions(+), 35 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch 
b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
index 920cd32264b6..8d2391407a35 100644
--- a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
+++ b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
@@ -52,3 +52,14 @@
  -I$(ROOTDIR)/runtime $(SHAREDLIB_CFLAGS) -DNATIVE_CODE \
  -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) \
  $(OUTPUTOBJ)$@ -c $<
+--- a/tools/Makefile   2022-01-23 09:57:00.788877931 +0100
 b/tools/Makefile   2022-01-23 09:57:21.735516656 +0100
+@@ -322,7 +322,7 @@
+ endif
+ 
+ objinfo_helper$(EXE): objinfo_helper.c $(ROOTDIR)/runtime/caml/s.h
+-  $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \
++  $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime 
$(OUTPUTEXE)$@ \
+   $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK)
+ 
+ OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch 
b/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
similarity index 54%
copy from dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
copy to dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
index 920cd32264b6..01117c39887d 100644
--- a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch
+++ b/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
@@ -9,14 +9,6 @@
  endef
  
  object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic
 a/yacc/Makefile2022-01-22 20:02:56.510340885 +0100
-+++ b/yacc/Makefile2022-01-22 20:03:14.998000508 +0100
-@@ -63,4 +63,4 @@
- # also works for .obj files.
- 
- %.$(O): %.c
--  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
-+  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
 --- a/otherlibs/Makefile.otherlibs.common  2022-01-22 20:24:15.316779625 
+0100
 +++ b/otherlibs/Makefile.otherlibs.common  2022-01-22 20:24:50.730126701 
+0100
 @@ -138,4 +138,4 @@
@@ -25,30 +17,26 @@
  .c.$(O):
 -  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
 +  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
 a/ocamltest/Makefile   2022-01-22 20:30:22.454009704 +0100
-+++ b/ocamltest/Makefile   2022-01-22 20:30:33.845799603 +0100
-@@ -221,7 +221,7 @@
-   $(ocamllex) -q $<
- 
- %.$(O): %.c
--  $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -c $<
-+  $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -c $<
- 
- ocamltest_config.ml: ocamltest_config.ml.in Makefile ../Makefile.config
-   sed \
 --- a/otherlibs/systhreads/Makefile2022-01-22 20:42:17.647349876 +0100
 +++ b/otherlibs/systhreads/Makefile2022-01-22 20:43:29.766086103 +0100
-@@ -93,11 +93,11 @@
- # twice, each time with different options).
+@@ -102,10 +102,10 @@
+ st_stubs_n.$(O): OC_CPPFLAGS += $(NATIVE_CPPFLAGS)
  
  st_stubs_b.$(O): st_stubs.c $(HEADER)
--  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime  \
-+  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime  \
- $(SHAREDLIB_CFLAGS) $(OUTPUTOBJ)$@ $<
+-  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
  
  st_stubs_n.$(O): st_stubs.c $(HEADER)
--  $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) \
-+  $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) \
- -I$(ROOTDIR)/runtime $(SHAREDLIB_CFLAGS) -DNATIVE_CODE \
- -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) \
- $(OUTPUTOBJ)$@ -c $<
+-  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
++  $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
+ 
+ partialclean:
+   rm -f *.cm*
+--- a/Makefile.common.in   2022-01-23 18:05:04.192323554 +0100
 b/Makefile.common.in   2022-01-23 18:05:17.211122643 +0100
+@@ -79,4 +79,4 @@
+ # general (it supports both .o and .obj)
+ 
+ %.$(O): %.c
+-  $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) 

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2021-06-07 Thread Sam James
commit: 34b06d35218d9e444050526511da10962ea72c2f
Author: Sam James  gentoo  org>
AuthorDate: Tue Jun  8 04:58:53 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Jun  8 04:59:09 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34b06d35

dev-lang/ocaml: add CVE-2018-9838 patch to 4.05.0

Closes: https://bugs.gentoo.org/755257
Bug: https://bugs.gentoo.org/719134
Signed-off-by: Sam James  gentoo.org>

 .../ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch   |  70 ++
 dev-lang/ocaml/ocaml-4.05.0-r4.ebuild  | 143 +
 2 files changed, 213 insertions(+)

diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch 
b/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch
new file mode 100644
index 000..cfe3ff636c2
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch
@@ -0,0 +1,70 @@
+https://bugs.gentoo.org/755257
+
+Needed for both fixing the CVE + compatibility with Debian for e.g.
+Unison.
+
+From c6ca3afc78b75d7748e4e09e56c6b020418be06e Mon Sep 17 00:00:00 2001
+From: Stephane Glondu 
+Date: Fri, 25 Jan 2019 14:34:23 +0100
+Subject: [PATCH] Fix integer overflows when unmarshaling a bigarray
+
+Malicious or corrupted marshaled data can result in a bigarray
+with impossibly large dimensions that cause overflow when computing
+the in-memory size of the bigarray.  Disaster ensues when the data
+is read in a too small memory area.  This commit checks for overflows
+when computing the in-memory size of the bigarray.
+
+This patch is based on one by Xavier Leroy and has been modified to
+use caml_ba_multov instead of caml_umul_overflow which is unavailable
+in OCaml 4.05.0.
+
+The original commit hash is 85162eee9d4072fa9c2f498f03cd94e357033eec.
+
+Origin: https://github.com/ocaml/ocaml/pull/1718
+Bug: https://github.com/ocaml/ocaml/issues/7765
+Bug-Debian: https://bugs.debian.org/895472
+Bug-CVE: CVE-2018-9838
+--- a/otherlibs/bigarray/bigarray_stubs.c
 b/otherlibs/bigarray/bigarray_stubs.c
+@@ -966,22 +966,34 @@ static void caml_ba_deserialize_longarray(void * dest, 
intnat num_elts)
+ uintnat caml_ba_deserialize(void * dst)
+ {
+   struct caml_ba_array * b = dst;
+-  int i, elt_size;
+-  uintnat num_elts;
++  int i;
++  uintnat num_elts, size;
++  int overflow;
+ 
+   /* Read back header information */
+   b->num_dims = caml_deserialize_uint_4();
++  if (b->num_dims < 0 || b->num_dims > CAML_BA_MAX_NUM_DIMS)
++caml_deserialize_error("input_value: wrong number of bigarray 
dimensions");
+   b->flags = caml_deserialize_uint_4() | CAML_BA_MANAGED;
+   b->proxy = NULL;
+   for (i = 0; i < b->num_dims; i++) b->dim[i] = caml_deserialize_uint_4();
+-  /* Compute total number of elements */
+-  num_elts = caml_ba_num_elts(b);
+-  /* Determine element size in bytes */
++  /* Compute total number of elements.  Watch out for overflows (MPR#7765). */
++  num_elts = 1;
++  for (i = 0; i < b->num_dims; i++) {
++overflow = 0;
++num_elts = caml_ba_multov(num_elts, b->dim[i], );
++if (overflow)
++  caml_deserialize_error("input_value: size overflow for bigarray");
++  }
++  /* Determine array size in bytes.  Watch out for overflows (MPR#7765). */
+   if ((b->flags & CAML_BA_KIND_MASK) > CAML_BA_CHAR)
+ caml_deserialize_error("input_value: bad bigarray kind");
+-  elt_size = caml_ba_element_size[b->flags & CAML_BA_KIND_MASK];
++  overflow = 0;
++  size = caml_ba_multov(num_elts, caml_ba_element_size[b->flags & 
CAML_BA_KIND_MASK], );
++  if (overflow)
++caml_deserialize_error("input_value: size overflow for bigarray");
+   /* Allocate room for data */
+-  b->data = malloc(elt_size * num_elts);
++  b->data = malloc(size);
+   if (b->data == NULL)
+ caml_deserialize_error("input_value: out of memory for bigarray");
+   /* Read data */

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r4.ebuild 
b/dev-lang/ocaml/ocaml-4.05.0-r4.ebuild
new file mode 100644
index 000..1fd3049eff5
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.05.0-r4.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic multilib toolchain-funcs
+
+PATCHLEVEL="9"
+MY_P="${P/_/-}"
+DESCRIPTION="Type-inferring functional programming language descended from the 
ML family"
+HOMEPAGE="https://ocaml.org;
+SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> 
${MY_P}.tar.gz
+   mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2"
+
+LICENSE="QPL-1.0 LGPL-2"
+# Everytime ocaml is updated to a new version, everything ocaml must be 
rebuilt,
+# so here we go with the subslot.
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 
~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs"
+
+RDEPEND="
+   sys-libs/binutils-libs:=
+   ncurses? ( sys-libs/ncurses:0= )
+   spacetime? ( 

[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2020-02-05 Thread Sergei Trofimovich
commit: 3e396d2b57d76c1025491c8313859e59778f65e8
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Wed Feb  5 09:38:23 2020 +
Commit: Sergei Trofimovich  gentoo  org>
CommitDate: Wed Feb  5 09:38:58 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e396d2b

dev-lang/ocaml: tweak for gcc-10

Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch | 21 +
 dev-lang/ocaml/ocaml-4.09.0.ebuild |  4 +++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch 
b/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch
new file mode 100644
index 000..e25d55a5f66
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch
@@ -0,0 +1,21 @@
+--- a/runtime/backtrace.c
 b/runtime/backtrace.c
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++extern struct ext_table caml_debug_info;
+ 
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+--- a/runtime/startup_nat.c
 b/runtime/startup_nat.c
+@@ -44,7 +44,6 @@
+ #endif
+ 
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
+ struct ext_table caml_code_fragments_table;
+ 

diff --git a/dev-lang/ocaml/ocaml-4.09.0.ebuild 
b/dev-lang/ocaml/ocaml-4.09.0.ebuild
index c39cc2aee83..5fb59fc6617 100644
--- a/dev-lang/ocaml/ocaml-4.09.0.ebuild
+++ b/dev-lang/ocaml/ocaml-4.09.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -19,6 +19,8 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
xemacs? ( app-xemacs/ocaml )"
 
+PATCHES=("${FILESDIR}"/${PN}-4.09.0-gcc-10.patch)
+
 src_prepare() {
default
# Upstream build ignores LDFLAGS in several places.



[gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/

2019-03-22 Thread Lars Wendler
commit: 45d7b4d6d7c5e9f2ca1d742a53072f3a92cb5a91
Author: Lars Wendler  gentoo  org>
AuthorDate: Fri Mar 22 09:46:07 2019 +
Commit: Lars Wendler  gentoo  org>
CommitDate: Fri Mar 22 10:05:26 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45d7b4d6

dev-lang/ocaml: Fixed build with sys-libs/ncurses[tinfo]

Closes: https://bugs.gentoo.org/459512
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Lars Wendler  gentoo.org>

 dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch | 13 +
 dev-lang/ocaml/ocaml-4.04.2-r1.ebuild |  3 ++-
 dev-lang/ocaml/ocaml-4.05.0-r1.ebuild |  3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch 
b/dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch
new file mode 100644
index 000..ceeb8299109
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.04.2-tinfo.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/459512
+
+--- ocaml-4.04.2/configure
 ocaml-4.04.2/configure
+@@ -1095,7 +1095,7 @@
+ # For the terminfo module
+ 
+ if test "$with_curses" = "yes"; then
+-  for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
++  for libs in "" "-ltinfo" "-lcurses" "-ltermcap" "-lcurses -ltermcap" 
"-lncurses"; do
+ if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
+   inf "termcap functions found (with libraries '$libs')"
+   echo "#define HAS_TERMCAP" >> s.h

diff --git a/dev-lang/ocaml/ocaml-4.04.2-r1.ebuild 
b/dev-lang/ocaml/ocaml-4.04.2-r1.ebuild
index f790ab2d1cd..60c56bef2e4 100644
--- a/dev-lang/ocaml/ocaml-4.04.2-r1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.04.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"
@@ -43,6 +43,7 @@ pkg_setup() {
 
 src_prepare() {
EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+   epatch "${FILESDIR}/${PN}-4.04.2-tinfo.patch" #459512
 }
 
 src_configure() {

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r1.ebuild 
b/dev-lang/ocaml/ocaml-4.05.0-r1.ebuild
index f0a79f5e329..16b090dacbf 100644
--- a/dev-lang/ocaml/ocaml-4.05.0-r1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.05.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"
@@ -44,6 +44,7 @@ pkg_setup() {
 
 src_prepare() {
EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+   epatch "${FILESDIR}/${PN}-4.04.2-tinfo.patch" #459512
 }
 
 src_configure() {