public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2019-03-22 10:05 Lars Wendler
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Wendler @ 2019-03-22 10:05 UTC (permalink / raw
  To: gentoo-commits

commit:     45d7b4d6d7c5e9f2ca1d742a53072f3a92cb5a91
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 22 09:46:07 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri Mar 22 10:05:26 2019 +0000
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 <polynomial-c <AT> 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 00000000000..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() {


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2020-02-05  9:39 Sergei Trofimovich
  0 siblings, 0 replies; 8+ messages in thread
From: Sergei Trofimovich @ 2020-02-05  9:39 UTC (permalink / raw
  To: gentoo-commits

commit:     3e396d2b57d76c1025491c8313859e59778f65e8
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  5 09:38:23 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Feb  5 09:38:58 2020 +0000
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 <slyfox <AT> 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 00000000000..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.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2021-06-08  4:59 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2021-06-08  4:59 UTC (permalink / raw
  To: gentoo-commits

commit:     34b06d35218d9e444050526511da10962ea72c2f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  8 04:58:53 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun  8 04:59:09 2021 +0000
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 <sam <AT> 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 00000000000..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 <steph@glondu.net>
+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], &overflow);
++    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], &overflow);
++  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 00000000000..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? ( sys-libs/libunwind:= )
+	X? ( x11-libs/libX11 )
+	!dev-ml/num"
+BDEPEND="${RDEPEND}
+	virtual/pkgconfig"
+PDEPEND="emacs? ( app-emacs/ocaml-mode )
+	xemacs? ( app-xemacs/ocaml )"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512
+	"${FILESDIR}"/${P}-gcc10.patch
+	"${FILESDIR}"/${P}-CVE-2018-9838.patch
+)
+
+pkg_setup() {
+	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
+	# results in relocations if gcc wants to create a PIE executable
+	if gcc-specs-pie ; then
+		append-ldflags -nopie
+		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
+		ewarn "We have appended -nopie to ocaml build options"
+		ewarn "because linking an executable with pie while the objects are not pic will not work"
+	fi
+}
+
+src_prepare() {
+	EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches"
+	default
+}
+
+src_configure() {
+	export LC_ALL=C
+	local myconf=""
+
+	# Causes build failures because it builds some programs with -pg,
+	# bug #270920
+	filter-flags -fomit-frame-pointer
+	# Bug #285993
+	filter-mfpmath sse
+
+	# -ggdb3 & co makes it behave weirdly, breaks sexplib
+	replace-flags -ggdb* -ggdb
+
+	# OCaml generates textrels on 32-bit arches
+	# We can't do anything about it, but disabling it means that tests
+	# for OCaml-based packages won't fail on unexpected output
+	# bug #773226
+	if use arm || use ppc || use x86 ; then
+		append-ldflags "-Wl,-z,notext"
+	fi
+
+	# It doesn't compile on alpha without this LDFLAGS
+	use alpha && append-ldflags "-Wl,--no-relax"
+
+	use ncurses || myconf="${myconf} -no-curses"
+	use X || myconf="${myconf} -no-graph"
+	use flambda && myconf="${myconf} -flambda"
+	use spacetime && myconf="${myconf} -spacetime"
+
+	# ocaml uses a home-brewn configure script, preventing it to use econf.
+	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
+		--prefix "${EPREFIX}"/usr \
+		--bindir "${EPREFIX}"/usr/bin \
+		--target-bindir "${EPREFIX}"/usr/bin \
+		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
+		--mandir "${EPREFIX}"/usr/share/man \
+		-target "${CHOST}" \
+		-host "${CBUILD}" \
+		-cc "$(tc-getCC)" \
+		-as "$(tc-getAS)" \
+		-aspp "$(tc-getCC) -c" \
+		-partialld "$(tc-getLD) -r" \
+		--with-pthread ${myconf} || die "configure failed!"
+
+	# http://caml.inria.fr/mantis/view.php?id=4698
+	export CCLINKFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	emake world
+
+	# Native code generation can be disabled now
+	if use ocamlopt ; then
+		# bug #279968
+		emake opt
+		emake -j1 opt.opt
+	fi
+}
+
+src_test() {
+	if use ocamlopt ; then
+		emake -j1 tests
+	else
+		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
+	fi
+}
+
+src_install() {
+	emake BINDIR="${ED}"/usr/bin \
+		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
+		MANDIR="${ED}"/usr/share/man \
+		install
+
+	# Symlink the headers to the right place
+	dodir /usr/include
+	# Create symlink for header files
+	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
+	dodoc Changes README.adoc
+	# Create envd entry for latex input files
+	if use latex ; then
+		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc"
+		doenvd "${T}/99ocamldoc"
+	fi
+	# Install ocaml-rebuild portage set
+	insinto /usr/share/portage/config/sets
+	doins "${FILESDIR}/ocaml.conf"
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2022-01-23 18:13 Alfredo Tupone
  0 siblings, 0 replies; 8+ messages in thread
From: Alfredo Tupone @ 2022-01-23 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     b621f163b9af5f8949f0ce1ce1bc13651562b3ff
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 23 18:13:37 2022 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun Jan 23 18:13:37 2022 +0000
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 <tupone <AT> 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/Makefile	2022-01-22 20:02:56.510340885 +0100
-+++ b/yacc/Makefile	2022-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/Makefile	2022-01-22 20:42:17.647349876 +0100
 +++ b/otherlibs/systhreads/Makefile	2022-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) $(OUTPUTOBJ)$@ $<
++	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
index 68a369bcebf8..8f3bd8015bfc 100644
--- a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
+++ b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -30,6 +30,8 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
+
 S="${WORKDIR}/${MY_P}"
 
 PATCHES=(

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
index 4c2da17dac59..58ae1dde82d7 100644
--- a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
+++ b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -30,6 +30,8 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
+
 S="${WORKDIR}/${MY_P}"
 
 PATCHES=(

diff --git a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
index ca9871a0c358..ef5e9bedc947 100644
--- a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
@@ -21,6 +21,8 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
+
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.09.0-gcc-10.patch
 	"${FILESDIR}"/${P}-cflags.patch

diff --git a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
index 3b6334a9c87c..fbf4e4c204b6 100644
--- a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -21,6 +21,12 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
+
+PATCHES=(
+	"${FILESDIR}"/${P}-cflags.patch
+)
+
 src_prepare() {
 	default
 

diff --git a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
index cbc5b7cb458b..666f43b938bd 100644
--- a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -21,8 +21,11 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
+
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.11.2-glibc-2.34.patch
+	"${FILESDIR}"/${PN}-4.10.2-cflags.patch
 )
 
 src_prepare() {

diff --git a/dev-lang/ocaml/ocaml-4.12.1.ebuild b/dev-lang/ocaml/ocaml-4.12.1.ebuild
index 287a7f38e79d..fd6cae2fff2c 100644
--- a/dev-lang/ocaml/ocaml-4.12.1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.12.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -20,6 +20,8 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
+
 PATCHES=(
 	"${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch
 )

diff --git a/dev-lang/ocaml/ocaml-4.13.1.ebuild b/dev-lang/ocaml/ocaml-4.13.1.ebuild
index da99522c6e38..1765de6905c0 100644
--- a/dev-lang/ocaml/ocaml-4.13.1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.13.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -20,6 +20,8 @@ BDEPEND="${RDEPEND}
 PDEPEND="emacs? ( app-emacs/ocaml-mode )
 	xemacs? ( app-xemacs/ocaml )"
 
+QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2022-02-22  0:41 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-02-22  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     a5945b83a4ee29d228e1a56101483001da291c54
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 00:29:23 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 00:41:18 2022 +0000
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 <sam <AT> 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 000000000000..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 <xavierleroy@users.noreply.github.com>
+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(&act.sa_mask);
+-    system_stack_top = (char *) &act;
+-    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, 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(&act.sa_mask);
++      system_stack_top = (char *) &act;
++      if (sigaltstack(&stk, NULL) == 0)
++        sigaction(SIGSEGV, &act, 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(&act.sa_mask);
++  act.sa_handler = SIG_DFL;
++  act.sa_flags = 0;
++  sigaction(signum, &act, 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
++  set_signal_default(SIGSEGV);
++  stack_t oldstk, stk;
++  stk.ss_flags = SS_DISABLE;
++  if (sigaltstack(&stk, &oldstk) == 0) {
++    /* If caml_init_signals failed, we are not using an alternate signal stack.
++       SS_DISABLE will be set in oldstk, and there is nothing to free in this
++       case. */
++    if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
+   }
+ #endif
+ }
+diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c
+index 7eca5fa5581..f52bec980b6 100644
+--- a/runtime/startup_nat.c
++++ b/runtime/startup_nat.c
+@@ -92,6 +92,7 @@ void (*caml_termination_hook)(void *) = NULL;
+ extern value caml_start_program (void);
+ extern void caml_init_ieee_floats (void);
+ extern void caml_init_signals (void);
++extern void caml_terminate_signals(void);
+ #ifdef _WIN32
+ extern void caml_win32_overflow_detection (void);
+ #endif
+@@ -106,6 +107,7 @@ extern void caml_install_invalid_parameter_handler();
+ value caml_startup_common(char_os **argv, int pooling)
+ {
+   char_os * exe_name, * proc_self_exe;
++  value res;
+   char tos;
+ 
+   /* Determine options */
+@@ -153,10 +155,13 @@ value caml_startup_common(char_os **argv, int pooling)
+     exe_name = caml_search_exe_in_path(exe_name);
+   caml_sys_init(exe_name, argv);
+   if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) {
++    caml_terminate_signals();
+     if (caml_termination_hook != NULL) caml_termination_hook(NULL);
+     return Val_unit;
+   }
+-  return caml_start_program();
++  res = caml_start_program();
++  caml_terminate_signals();
++  return res;
+ }
+ 
+ value caml_startup_exn(char_os **argv)
+diff --git a/runtime/sys.c b/runtime/sys.c
+index 226d596cdff..9e201354e1e 100644
+--- a/runtime/sys.c
++++ b/runtime/sys.c
+@@ -112,6 +112,8 @@ static void caml_sys_check_path(value name)
+   }
+ }
+ 
++extern void caml_terminate_signals(void);
++
+ CAMLprim value caml_sys_exit(value retcode_v)
+ {
+   int retcode = Int_val(retcode_v);
+@@ -155,6 +157,9 @@ CAMLprim value caml_sys_exit(value retcode_v)
+     caml_shutdown();
+ #ifdef _WIN32
+   caml_restore_win32_terminal();
++#endif
++#ifdef NATIVE_CODE
++  caml_terminate_signals();
+ #endif
+   exit(retcode);
+ }
+

diff --git a/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild
new file mode 100644
index 000000000000..8bf41d439d5a
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild
@@ -0,0 +1,105 @@
+# 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? ( sys-libs/libunwind:= )"
+BDEPEND="${RDEPEND}
+	virtual/pkgconfig"
+PDEPEND="emacs? ( app-emacs/ocaml-mode )
+	xemacs? ( app-xemacs/ocaml )"
+
+QA_FLAGS_IGNORED='usr/lib.*/ocaml/bigarray.cmxs'
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.09.0-gcc-10.patch
+	"${FILESDIR}"/${P}-cflags.patch
+	"${FILESDIR}"/${P}-glibc-2.34.patch
+)
+
+src_prepare() {
+	default
+
+	cp "${FILESDIR}"/ocaml.conf "${T}" || die
+
+	# Broken until 4.12
+	# bug #818445
+	filter-flags '-flto*'
+	append-flags -fno-strict-aliasing
+
+	# OCaml generates textrels on 32-bit arches
+	# We can't do anything about it, but disabling it means that tests
+	# for OCaml-based packages won't fail on unexpected output
+	# bug #773226
+	if use arm || use ppc || use x86 ; then
+		append-ldflags "-Wl,-z,notext"
+	fi
+
+	# Upstream build ignores LDFLAGS in several places.
+	sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
+		-e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
+		-e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
+		Makefile.config.in || die "LDFLAGS fix failed"
+	# ${P} overrides upstream build's own P due to a wrong assignment operator.
+	sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed"
+}
+
+src_configure() {
+	local opt=(
+		--bindir="${EPREFIX}/usr/bin"
+		--libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
+		--mandir="${EPREFIX}/usr/share/man"
+		--prefix="${EPREFIX}/usr"
+		$(use_enable flambda)
+		$(use_enable spacetime)
+	)
+	econf ${opt[@]}
+}
+
+src_compile() {
+	if use ocamlopt ; then
+		emake world.opt
+	else
+		emake world
+	fi
+}
+
+src_test() {
+	if use ocamlopt ; then
+		# OCaml tests only work when run sequentially
+		emake -j1 -C testsuite all
+	else
+		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
+	fi
+}
+
+src_install() {
+	default
+	dodir /usr/include
+	# Create symlink for header files
+	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
+	dodoc Changes README.adoc
+	# Create envd entry for latex input files
+	if use latex ; then
+		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
+		doenvd "${T}"/99ocamldoc
+	fi
+
+	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
+
+	# Install ocaml-rebuild portage set
+	insinto /usr/share/portage/config/sets
+	doins "${T}"/ocaml.conf
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2022-02-22  0:41 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-02-22  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     860e2f272f0a0a2fecb2ab6f160ce68875770f59
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 00:40:45 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 00:41:14 2022 +0000
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 <sam <AT> 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 000000000000..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 <xavierleroy@users.noreply.github.com>
+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(&act.sa_mask);
+-    system_stack_top = (char *) &act;
+-    if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, 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(&act.sa_mask);
++      system_stack_top = (char *) &act;
++      if (sigaltstack(&stk, NULL) == 0)
++        sigaction(SIGSEGV, &act, 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(&act.sa_mask);
++  act.sa_handler = SIG_DFL;
++  act.sa_flags = 0;
++  sigaction(signum, &act, 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
++
++#if defined(TARGET_s390x)
++  set_signal_default(SIGFPE);
++#endif
++
++#ifdef HAS_STACK_OVERFLOW_DETECTION
++  set_signal_default(SIGSEGV);
++  stack_t oldstk, stk;
++  stk.ss_flags = SS_DISABLE;
++  if (sigaltstack(&stk, &oldstk) == 0) {
++    /* If caml_init_signals failed, we are not using an alternate signal stack.
++       SS_DISABLE will be set in oldstk, and there is nothing to free in this
++       case. */
++    if (! (oldstk.ss_flags & SS_DISABLE)) free(oldstk.ss_sp);
++  }
++#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;
+ extern value caml_start_program (void);
+ extern void caml_init_ieee_floats (void);
+ extern void caml_init_signals (void);
++extern void caml_terminate_signals(void);
+ 
+ #if defined(_MSC_VER) && __STDC_SECURE_LIB__ >= 200411L
+ 
+@@ -103,6 +104,7 @@ extern void caml_install_invalid_parameter_handler();
+ value caml_startup_exn(char **argv)
+ {
+   char * exe_name, * proc_self_exe;
++  value res;
+   char tos;
+ 
+ #ifdef WITH_SPACETIME
+@@ -138,10 +140,13 @@ value caml_startup_exn(char **argv)
+     exe_name = caml_search_exe_in_path(exe_name);
+   caml_sys_init(exe_name, argv);
+   if (sigsetjmp(caml_termination_jmpbuf.buf, 0)) {
++    caml_terminate_signals();
+     if (caml_termination_hook != NULL) caml_termination_hook(NULL);
+     return Val_unit;
+   }
+-  return caml_start_program();
++  res = caml_start_program();
++  caml_terminate_signals();
++  return res;
+ }
+ 
+ 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)
+   }
+ }
+ 
++extern void caml_terminate_signals(void);
++
+ CAMLprim value caml_sys_exit(value retcode_v)
+ {
+   int retcode = Int_val(retcode_v);
+@@ -144,6 +146,9 @@ CAMLprim value caml_sys_exit(value retcode_v)
+   caml_debugger(PROGRAM_EXIT);
+ #endif
+   CAML_INSTR_ATEXIT ();
++#ifdef NATIVE_CODE
++  caml_terminate_signals();
++#endif
+   CAML_SYS_EXIT(retcode);
+   return Val_unit;
+ }
+

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild
new file mode 100644
index 000000000000..f2bb2369ad69
--- /dev/null
+++ b/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic 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/$(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 ncurses +ocamlopt spacetime X xemacs"
+
+RDEPEND="
+	sys-libs/binutils-libs:=
+	ncurses? ( sys-libs/ncurses:0= )
+	spacetime? ( sys-libs/libunwind:= )
+	X? ( x11-libs/libX11 )
+	!dev-ml/num"
+BDEPEND="${RDEPEND}
+	virtual/pkgconfig"
+PDEPEND="emacs? ( app-emacs/ocaml-mode )
+	xemacs? ( app-xemacs/ocaml )"
+
+QA_FLAGS_IGNORED='usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512
+	"${FILESDIR}"/${P}-gcc10.patch
+	"${FILESDIR}"/${P}-CVE-2018-9838.patch
+	"${FILESDIR}"/${P}-glibc-2.34.patch
+)
+
+pkg_setup() {
+	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
+	# results in relocations if gcc wants to create a PIE executable
+	if gcc-specs-pie ; then
+		append-ldflags -nopie
+		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
+		ewarn "We have appended -nopie to ocaml build options"
+		ewarn "because linking an executable with pie while the objects are not pic will not work"
+	fi
+}
+
+src_prepare() {
+	EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches"
+
+	cp "${FILESDIR}"/ocaml.conf "${T}" || die
+
+	default
+}
+
+src_configure() {
+	export LC_ALL=C
+	local myconf=""
+
+	# Causes build failures because it builds some programs with -pg,
+	# bug #270920
+	filter-flags -fomit-frame-pointer
+	# Bug #285993
+	filter-mfpmath sse
+
+	# Broken until 4.12
+	# bug #818445
+	filter-flags '-flto*'
+	append-flags -fno-strict-aliasing
+
+	# -ggdb3 & co makes it behave weirdly, breaks sexplib
+	replace-flags -ggdb* -ggdb
+
+	# OCaml generates textrels on 32-bit arches
+	# We can't do anything about it, but disabling it means that tests
+	# for OCaml-based packages won't fail on unexpected output
+	# bug #773226
+	if use arm || use ppc || use x86 ; then
+		append-ldflags "-Wl,-z,notext"
+	fi
+
+	# It doesn't compile on alpha without this LDFLAGS
+	use alpha && append-ldflags "-Wl,--no-relax"
+
+	use ncurses || myconf="${myconf} -no-curses"
+	use X || myconf="${myconf} -no-graph"
+	use flambda && myconf="${myconf} -flambda"
+	use spacetime && myconf="${myconf} -spacetime"
+
+	# ocaml uses a home-brewn configure script, preventing it to use econf.
+	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
+		--prefix "${EPREFIX}"/usr \
+		--bindir "${EPREFIX}"/usr/bin \
+		--target-bindir "${EPREFIX}"/usr/bin \
+		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
+		--mandir "${EPREFIX}"/usr/share/man \
+		-target "${CHOST}" \
+		-host "${CBUILD}" \
+		-cc "$(tc-getCC)" \
+		-as "$(tc-getAS)" \
+		-aspp "$(tc-getCC) -c" \
+		-partialld "$(tc-getLD) -r" \
+		--with-pthread ${myconf} || die "configure failed!"
+
+	# http://caml.inria.fr/mantis/view.php?id=4698
+	export CCLINKFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+	emake world
+
+	# Native code generation can be disabled now
+	if use ocamlopt ; then
+		# bug #279968
+		emake opt
+		emake -j1 opt.opt
+	fi
+}
+
+src_test() {
+	if use ocamlopt ; then
+		emake -j1 tests
+	else
+		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
+	fi
+}
+
+src_install() {
+	emake BINDIR="${ED}"/usr/bin \
+		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
+		MANDIR="${ED}"/usr/share/man \
+		install
+
+	# Symlink the headers to the right place
+	dodir /usr/include
+	# Create symlink for header files
+	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
+	dodoc Changes README.adoc
+	# Create envd entry for latex input files
+	if use latex ; then
+		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
+		doenvd "${T}"/99ocamldoc
+	fi
+
+	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
+
+	# Install ocaml-rebuild portage set
+	insinto /usr/share/portage/config/sets
+	doins "${T}"/ocaml.conf
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2022-02-22  0:59 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-02-22  0:59 UTC (permalink / raw
  To: gentoo-commits

commit:     9e8369277b272b15f3dd1159fa18b71ec4431a77
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 22 00:58:44 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 00:58:44 2022 +0000
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 <sam <AT> 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..000000000000
--- 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 <steph@glondu.net>
-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], &overflow);
-+    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], &overflow);
-+  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..000000000000
--- 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;
- 
- /* [caml_major_gc_hook] is called just between the end of the mark
---- a/byterun/meta.c
-+++ b/byterun/meta.c
-@@ -32,6 +32,8 @@
- #include "caml/prims.h"
- #include "caml/stacks.h"
- 
-+struct ext_table caml_code_fragments_table;
-+
- #ifndef NATIVE_CODE
- 
- CAMLprim value caml_get_global_data(value unit)
---- a/byterun/backtrace.c
-+++ b/byterun/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/asmrun/startup.c
-+++ b/asmrun/startup.c
-@@ -44,7 +44,7 @@
- #endif
- 
- extern int caml_parser_trace;
--CAMLexport header_t caml_atom_table[256];
-+CAMLextern header_t caml_atom_table[256];
- char * caml_code_area_start, * caml_code_area_end;
- 
- /* Initialize the atom table and the static data and code area limits. */

diff --git a/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch b/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
deleted file mode 100644
index 7adb1ea0768d..000000000000
--- a/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch
+++ /dev/null
@@ -1,42 +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/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/otherlibs/systhreads/Makefile
-+++ b/otherlibs/systhreads/Makefile
-@@ -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) $(OUTPUTOBJ)$@ $<
-+	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
- 
- st_stubs_n.$(O): st_stubs.c $(HEADER)
--	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
-+	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
- 
- partialclean:
- 	rm -f *.cm*
---- a/Makefile.common.in
-+++ b/Makefile.common.in
-@@ -79,4 +79,4 @@
- # general (it supports both .o and .obj)
- 
- %.$(O): %.c
--	$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
-+	$(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
deleted file mode 100644
index 8f3bd8015bfc..000000000000
--- a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
+++ /dev/null
@@ -1,155 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic 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/$(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 ncurses +ocamlopt spacetime X xemacs"
-
-RDEPEND="
-	sys-libs/binutils-libs:=
-	ncurses? ( sys-libs/ncurses:0= )
-	spacetime? ( sys-libs/libunwind:= )
-	X? ( x11-libs/libX11 )
-	!dev-ml/num"
-BDEPEND="${RDEPEND}
-	virtual/pkgconfig"
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
-
-S="${WORKDIR}/${MY_P}"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-4.04.2-tinfo.patch" #459512
-	"${FILESDIR}"/${P}-gcc10.patch
-)
-
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches"
-
-	cp "${FILESDIR}"/ocaml.conf "${T}" || die
-
-	default
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# Broken until 4.12
-	# bug #818445
-	filter-flags '-flto*'
-	append-flags -fno-strict-aliasing
-
-	# -ggdb3 & co makes it behave weirdly, breaks sexplib
-	replace-flags -ggdb* -ggdb
-
-	# OCaml generates textrels on 32-bit arches
-	# We can't do anything about it, but disabling it means that tests
-	# for OCaml-based packages won't fail on unexpected output
-	# bug #773226
-	if use arm || use ppc || use x86 ; then
-		append-ldflags "-Wl,-z,notext"
-	fi
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-	use flambda && myconf="${myconf} -flambda"
-	use spacetime && myconf="${myconf} -spacetime"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
-		--prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--target-bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		-target "${CHOST}" \
-		-host "${CBUILD}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake opt
-		emake -j1 opt.opt
-	fi
-}
-
-src_test() {
-	if use ocamlopt ; then
-		emake -j1 tests
-	else
-		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
-	fi
-}
-
-src_install() {
-	emake BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	# Create symlink for header files
-	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
-	dodoc Changes README.adoc
-	# Create envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
-		doenvd "${T}/99ocamldoc"
-	fi
-
-	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${T}"/ocaml.conf
-}

diff --git a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
deleted file mode 100644
index 58ae1dde82d7..000000000000
--- a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
+++ /dev/null
@@ -1,156 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic 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/$(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 ncurses +ocamlopt spacetime X xemacs"
-
-RDEPEND="
-	sys-libs/binutils-libs:=
-	ncurses? ( sys-libs/ncurses:0= )
-	spacetime? ( sys-libs/libunwind:= )
-	X? ( x11-libs/libX11 )
-	!dev-ml/num"
-BDEPEND="${RDEPEND}
-	virtual/pkgconfig"
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs'
-
-S="${WORKDIR}/${MY_P}"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512
-	"${FILESDIR}"/${P}-gcc10.patch
-	"${FILESDIR}"/${P}-CVE-2018-9838.patch
-)
-
-pkg_setup() {
-	# dev-lang/ocaml creates its own objects but calls gcc for linking, which will
-	# results in relocations if gcc wants to create a PIE executable
-	if gcc-specs-pie ; then
-		append-ldflags -nopie
-		ewarn "Ocaml generates its own native asm, you're using a PIE compiler"
-		ewarn "We have appended -nopie to ocaml build options"
-		ewarn "because linking an executable with pie while the objects are not pic will not work"
-	fi
-}
-
-src_prepare() {
-	EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches"
-
-	cp "${FILESDIR}"/ocaml.conf "${T}" || die
-
-	default
-}
-
-src_configure() {
-	export LC_ALL=C
-	local myconf=""
-
-	# Causes build failures because it builds some programs with -pg,
-	# bug #270920
-	filter-flags -fomit-frame-pointer
-	# Bug #285993
-	filter-mfpmath sse
-
-	# Broken until 4.12
-	# bug #818445
-	filter-flags '-flto*'
-	append-flags -fno-strict-aliasing
-
-	# -ggdb3 & co makes it behave weirdly, breaks sexplib
-	replace-flags -ggdb* -ggdb
-
-	# OCaml generates textrels on 32-bit arches
-	# We can't do anything about it, but disabling it means that tests
-	# for OCaml-based packages won't fail on unexpected output
-	# bug #773226
-	if use arm || use ppc || use x86 ; then
-		append-ldflags "-Wl,-z,notext"
-	fi
-
-	# It doesn't compile on alpha without this LDFLAGS
-	use alpha && append-ldflags "-Wl,--no-relax"
-
-	use ncurses || myconf="${myconf} -no-curses"
-	use X || myconf="${myconf} -no-graph"
-	use flambda && myconf="${myconf} -flambda"
-	use spacetime && myconf="${myconf} -spacetime"
-
-	# ocaml uses a home-brewn configure script, preventing it to use econf.
-	RAW_LDFLAGS="$(raw-ldflags)" ./configure \
-		--prefix "${EPREFIX}"/usr \
-		--bindir "${EPREFIX}"/usr/bin \
-		--target-bindir "${EPREFIX}"/usr/bin \
-		--libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \
-		--mandir "${EPREFIX}"/usr/share/man \
-		-target "${CHOST}" \
-		-host "${CBUILD}" \
-		-cc "$(tc-getCC)" \
-		-as "$(tc-getAS)" \
-		-aspp "$(tc-getCC) -c" \
-		-partialld "$(tc-getLD) -r" \
-		--with-pthread ${myconf} || die "configure failed!"
-
-	# http://caml.inria.fr/mantis/view.php?id=4698
-	export CCLINKFLAGS="${LDFLAGS}"
-}
-
-src_compile() {
-	emake world
-
-	# Native code generation can be disabled now
-	if use ocamlopt ; then
-		# bug #279968
-		emake opt
-		emake -j1 opt.opt
-	fi
-}
-
-src_test() {
-	if use ocamlopt ; then
-		emake -j1 tests
-	else
-		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
-	fi
-}
-
-src_install() {
-	emake BINDIR="${ED}"/usr/bin \
-		LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \
-		MANDIR="${ED}"/usr/share/man \
-		install
-
-	# Symlink the headers to the right place
-	dodir /usr/include
-	# Create symlink for header files
-	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
-	dodoc Changes README.adoc
-	# Create envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${T}"/ocaml.conf
-}

diff --git a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
deleted file mode 100644
index fbf4e4c204b6..000000000000
--- a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
+++ /dev/null
@@ -1,105 +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? ( sys-libs/libunwind:= )"
-BDEPEND="${RDEPEND}
-	virtual/pkgconfig"
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
-
-PATCHES=(
-	"${FILESDIR}"/${P}-cflags.patch
-)
-
-src_prepare() {
-	default
-
-	cp "${FILESDIR}"/ocaml.conf "${T}" || die
-
-	# Broken until 4.12
-	# bug #818445
-	filter-flags '-flto*'
-	append-flags -fno-strict-aliasing
-
-	# OCaml generates textrels on 32-bit arches
-	# We can't do anything about it, but disabling it means that tests
-	# for OCaml-based packages won't fail on unexpected output
-	# bug #773226
-	if use arm || use ppc || use x86 ; then
-		append-ldflags "-Wl,-z,notext"
-	fi
-
-	# Upstream build ignores LDFLAGS in several places.
-	sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
-		-e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
-		-e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
-		Makefile.config.in || die "LDFLAGS fix failed"
-	# ${P} overrides upstream build's own P due to a wrong assignment operator.
-	sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed"
-}
-
-src_configure() {
-	local opt=(
-		--bindir="${EPREFIX}/usr/bin"
-		--libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
-		--mandir="${EPREFIX}/usr/share/man"
-		--prefix="${EPREFIX}/usr"
-		$(use_enable flambda)
-		$(use_enable spacetime)
-	)
-	econf ${opt[@]}
-}
-
-src_compile() {
-	if use ocamlopt ; then
-		emake world.opt
-	else
-		emake world
-	fi
-}
-
-src_test() {
-	if use ocamlopt ; then
-		# OCaml tests only work when run sequentially
-		emake -j1 -C testsuite all
-	else
-		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
-	fi
-}
-
-src_install() {
-	default
-	dodir /usr/include
-
-	# Create symlink for header files
-	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
-	dodoc Changes README.adoc
-
-	# Create envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc" || die
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${T}"/ocaml.conf
-}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/
@ 2022-03-04  0:59 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2022-03-04  0:59 UTC (permalink / raw
  To: gentoo-commits

commit:     1eabb8b88db7647b7a04300ead166f4e4e852951
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  4 00:55:27 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar  4 00:56:31 2022 +0000
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 <sam <AT> 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..000000000000
--- 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..000000000000
--- 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..000000000000
--- 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? ( sys-libs/libunwind:= )"
-BDEPEND="${RDEPEND}
-	virtual/pkgconfig"
-PDEPEND="emacs? ( app-emacs/ocaml-mode )
-	xemacs? ( app-xemacs/ocaml )"
-
-QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs'
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-4.09.0-gcc-10.patch
-	"${FILESDIR}"/${P}-cflags.patch
-)
-
-src_prepare() {
-	default
-
-	cp "${FILESDIR}"/ocaml.conf "${T}" || die
-
-	# Broken until 4.12
-	# bug #818445
-	filter-flags '-flto*'
-	append-flags -fno-strict-aliasing
-
-	# OCaml generates textrels on 32-bit arches
-	# We can't do anything about it, but disabling it means that tests
-	# for OCaml-based packages won't fail on unexpected output
-	# bug #773226
-	if use arm || use ppc || use x86 ; then
-		append-ldflags "-Wl,-z,notext"
-	fi
-
-	# Upstream build ignores LDFLAGS in several places.
-	sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \
-		-e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \
-		-e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \
-		Makefile.config.in || die "LDFLAGS fix failed"
-	# ${P} overrides upstream build's own P due to a wrong assignment operator.
-	sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed"
-}
-
-src_configure() {
-	local opt=(
-		--bindir="${EPREFIX}/usr/bin"
-		--libdir="${EPREFIX}/usr/$(get_libdir)/ocaml"
-		--mandir="${EPREFIX}/usr/share/man"
-		--prefix="${EPREFIX}/usr"
-		$(use_enable flambda)
-		$(use_enable spacetime)
-	)
-	econf ${opt[@]}
-}
-
-src_compile() {
-	if use ocamlopt ; then
-		emake world.opt
-	else
-		emake world
-	fi
-}
-
-src_test() {
-	if use ocamlopt ; then
-		# OCaml tests only work when run sequentially
-		emake -j1 -C testsuite all
-	else
-		ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests."
-	fi
-}
-
-src_install() {
-	default
-	dodir /usr/include
-	# Create symlink for header files
-	dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml
-	dodoc Changes README.adoc
-	# Create envd entry for latex input files
-	if use latex ; then
-		echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die
-		doenvd "${T}"/99ocamldoc
-	fi
-
-	sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die
-
-	# Install ocaml-rebuild portage set
-	insinto /usr/share/portage/config/sets
-	doins "${T}"/ocaml.conf
-}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-04  0:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22  0:41 [gentoo-commits] repo/gentoo:master commit in: dev-lang/ocaml/files/, dev-lang/ocaml/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2022-03-04  0:59 Sam James
2022-02-22  0:59 Sam James
2022-02-22  0:41 Sam James
2022-01-23 18:13 Alfredo Tupone
2021-06-08  4:59 Sam James
2020-02-05  9:39 Sergei Trofimovich
2019-03-22 10:05 Lars Wendler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox