commit: 23db6834c03a4ad3519dd9067a66a183ed38bfde Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org> AuthorDate: Mon Nov 24 11:36:57 2025 +0000 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> CommitDate: Mon Nov 24 11:36:57 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23db6834
dev-lang/ocaml: drop 4.13.1 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> dev-lang/ocaml/Manifest | 1 - dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch | 91 ------------------ .../files/ocaml-4.12.1-fix-textrel-riscv.patch | 46 --------- dev-lang/ocaml/ocaml-4.13.1.ebuild | 103 --------------------- 4 files changed, 241 deletions(-) diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest index 5ad64884c060..a8becabd75e0 100644 --- a/dev-lang/ocaml/Manifest +++ b/dev-lang/ocaml/Manifest @@ -1,5 +1,4 @@ DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3 -DIST ocaml-4.13.1.tar.gz 5323203 BLAKE2B f1dcb1601ebfa2a37351e3a466a7ca601518c2da403b01aeb182738a54d5887523ab554d747d6591cb09b07b417865e20907f7877117b2d2d069ef6c9edc0fae SHA512 da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 DIST ocaml-4.14.2.tar.gz 5505119 BLAKE2B 518c2a69ee32e1c141b574a9800a64efc445381eb2808985b5dbb9d5ec54228aa25042a1c410307c3556488ba12a751980396b0d9a01e60a1ea84ac5b52e6dd6 SHA512 61bfa7961aae02458210f10865a5703f7a50a9be2452379e820cf2dfac2c6037da553c31835145e50a776880bdeb2ec78cd7a3147d65f418e7b3e593534e8a04 DIST ocaml-5.3.0.tar.gz 6239856 BLAKE2B a790293d14a31d34b10f2fac22a416e967c2a06f64001b54665e691a6aecdb71caf60dd6217460257f8d18191551ffa01d0d3d62327c6eb9bc63c254c162752e SHA512 73817ada340bdf4091b3edd7b292bd0074c87b4836f202f48ecf0f620a00feaa70ebc9101b97155e8caa6907646dfdf21eff728fa0e14542df3b5e5436229d06 DIST ocaml-5.4.0.tar.gz 6448449 BLAKE2B 88a055ac07a7ce126b71d8a242e63b68689bb637f40f0adc08e8f0be28961f7d7a6b3a2a673a137726f5100d4a032b6bba7424b168b283553e859f1bf868b482 SHA512 3684468800f4528c9fd96ef3fdd6aa04f71b77180d3ae8045d429f96b32e23cb3a8a307762c7237b6c56c087f45b59b0dab672a31166e3de254bb0fb9b4eb588 diff --git a/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch deleted file mode 100644 index 486b44846a86..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch +++ /dev/null @@ -1,91 +0,0 @@ -https://src.fedoraproject.org/rpms/ocaml/blob/129153b85109944bf0b2922949f77ef8f32b39a1/f/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch -https://bugs.gentoo.org/816765 - -From 3104d92743614f8f52039e0520116af4179880a5 Mon Sep 17 00:00:00 2001 -From: Xavier Leroy <[email protected]> -Date: Fri, 5 Mar 2021 19:14:07 +0100 -Subject: [PATCH 4/4] Dynamically allocate the alternate signal stack (#10266) - -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. - -Fixes: #10250. -(cherry picked from commit fc9534746bf5d08a4c109f22e344cf49d5d46d54) ---- a/runtime/caml/signals.h -+++ b/runtime/caml/signals.h -@@ -87,7 +87,7 @@ value caml_do_pending_actions_exn (void); - value caml_process_pending_actions_with_root (value extra_root); // raises - value caml_process_pending_actions_with_root_exn (value extra_root); - int caml_set_signal_action(int signo, int action); --CAMLextern void caml_setup_stack_overflow_detection(void); -+CAMLextern int caml_setup_stack_overflow_detection(void); - - CAMLextern void (*caml_enter_blocking_section_hook)(void); - CAMLextern void (*caml_leave_blocking_section_hook)(void); ---- a/runtime/signals_byt.c -+++ b/runtime/signals_byt.c -@@ -81,4 +81,4 @@ int caml_set_signal_action(int signo, int action) - return 0; - } - --CAMLexport void caml_setup_stack_overflow_detection(void) {} -+CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; } ---- a/runtime/signals_nat.c -+++ b/runtime/signals_nat.c -@@ -181,8 +181,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler) - #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined" - #endif - --static char sig_alt_stack[SIGSTKSZ]; -- - /* Code compiled with ocamlopt never accesses more than - EXTRA_STACK bytes below the stack pointer. */ - #define EXTRA_STACK 256 -@@ -276,28 +274,33 @@ void caml_init_signals(void) - #endif - - #ifdef HAS_STACK_OVERFLOW_DETECTION -- { -- stack_t stk; -+ if (caml_setup_stack_overflow_detection() != -1) { - 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); -- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); } -+ sigaction(SIGSEGV, &act, NULL); - } - #endif - } - --CAMLexport void caml_setup_stack_overflow_detection(void) -+/* Allocate and select an alternate stack for handling signals, -+ especially SIGSEGV signals. -+ Each thread needs its own alternate stack. -+ 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 (issue #10250). */ -+ -+CAMLexport int caml_setup_stack_overflow_detection(void) - { - #ifdef HAS_STACK_OVERFLOW_DETECTION - stack_t stk; - stk.ss_sp = malloc(SIGSTKSZ); -+ if (stk.ss_sp == NULL) return -1; - stk.ss_size = SIGSTKSZ; - stk.ss_flags = 0; -- if (stk.ss_sp) -- sigaltstack(&stk, NULL); -+ return sigaltstack(&stk, NULL); -+#else -+ return 0; - #endif - } diff --git a/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch deleted file mode 100644 index 5ba8582d3a65..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ddf99786f8229c8282905af5c7c74360d4f2fbd0 Mon Sep 17 00:00:00 2001 -From: Alex Fan <[email protected]> -Date: Tue, 22 Feb 2022 19:28:30 +1100 -Subject: [PATCH] riscv: Generate frametable in data section to improve code - relocatability (#11042) - -Similar to what PowerPC and System-Z have done in commit 24980d3fd9848e281761ef2b8fe383e71261789b - -With this commit ocamlopt produces .so shared libraries and PIE relocatable -executables that contain no relocations in the text segment. - -Upstream status: merged in 4.14 and 5.x ---- - Changes | 5 +++++ - asmcomp/riscv/emit.mlp | 2 +- - 2 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/Changes b/Changes -index 4898e9d69fc..2bec76daac6 100644 ---- a/Changes -+++ b/Changes -@@ -477,6 +477,11 @@ OCaml 4.14.0 - - #10907, #10959: Wrong type inferred from existential types - (Jacques Garrigue and Gabriel Scherer, report by @dyzsr, review by Leo White) - -+- #10688: Move frame descriptor table from `rodata` to `data` section on -+ RISC-V. Improves support for building DLLs and PIEs. In particular, this -+ applies to all binaries in distributions that build PIEs by default (eg -+ Gentoo and Alpine). -+ (Alex Fan, review by Gabriel Scherer) - - OCaml 4.13 maintenance branch - ----------------------------- -diff --git a/asmcomp/riscv/emit.mlp b/asmcomp/riscv/emit.mlp -index 474a3c6857a..b36aa0ea38c 100644 ---- a/asmcomp/riscv/emit.mlp -+++ b/asmcomp/riscv/emit.mlp -@@ -645,7 +645,7 @@ let end_assembly() = - `{emit_symbol lbl_end}:\n`; - ` .quad 0\n`; - (* Emit the frame descriptors *) -- ` {emit_string rodata_space}\n`; -+ ` {emit_string data_space}\n`; (* not rodata because relocations inside *) - let lbl = Compilenv.make_symbol (Some "frametable") in - declare_global_data lbl; - `{emit_symbol lbl}:\n`; diff --git a/dev-lang/ocaml/ocaml-4.13.1.ebuild b/dev-lang/ocaml/ocaml-4.13.1.ebuild deleted file mode 100644 index a293e7c14f64..000000000000 --- a/dev-lang/ocaml/ocaml-4.13.1.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic - -DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles" -HOMEPAGE="https://ocaml.org/" -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="QPL-1.0 LGPL-2" -SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" -IUSE="emacs flambda latex +ocamlopt xemacs" - -RDEPEND="sys-libs/binutils-libs:=" -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.12.1-fix-textrel-riscv.patch -) - -src_prepare() { - default - - cp "${FILESDIR}"/ocaml.conf "${T}" || die - - # 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" -} - -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) - ) - - econf "${opt[@]}" -} - -src_compile() { - env -u P emake world - - if use ocamlopt ; then - env -u P emake opt - env -u P emake opt.opt - fi -} - -src_test() { - emake -j - - # OCaml tests only work when run sequentially - if use ocamlopt ; then - emake -j1 ocamltest.opt - else - emake -j1 ocamltest - #ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." - fi - - emake -j1 tests -} - -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 -}
