summaryrefslogtreecommitdiff
path: root/dev-lang/ocaml
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/ocaml')
-rw-r--r--dev-lang/ocaml/Manifest18
-rw-r--r--dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch91
-rw-r--r--dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch91
-rw-r--r--dev-lang/ocaml/ocaml-4.05.0-r7.ebuild5
-rw-r--r--dev-lang/ocaml/ocaml-4.05.0-r8.ebuild5
-rw-r--r--dev-lang/ocaml/ocaml-4.09.0-r2.ebuild7
-rw-r--r--dev-lang/ocaml/ocaml-4.10.2-r2.ebuild5
-rw-r--r--dev-lang/ocaml/ocaml-4.11.2-r2.ebuild11
-rw-r--r--dev-lang/ocaml/ocaml-4.12.0-r2.ebuild97
-rw-r--r--dev-lang/ocaml/ocaml-4.12.1.ebuild4
-rw-r--r--dev-lang/ocaml/ocaml-4.13.0.ebuild97
11 files changed, 225 insertions, 206 deletions
diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest
index 8a7b7abbcf07..3b04bc07b4bb 100644
--- a/dev-lang/ocaml/Manifest
+++ b/dev-lang/ocaml/Manifest
@@ -2,24 +2,22 @@ AUX ocaml-4.04.2-tinfo.patch 506 BLAKE2B 889c964385442247a70b7205abc497a8d83ac9e
AUX ocaml-4.05.0-CVE-2018-9838.patch 2888 BLAKE2B 75fe491c1b12d9882c7b558efb3384a133c56bea0c85e97a6b46ec5b5f4050da4752228c795d937875645260b98ac9d203b9cdbf583ed36934a29faf4d47ecc3 SHA512 3da218dcea2c08ed97da805a2c1a1bc134a48b4425b4912283e353dde606ae99c95b86b59c6575b42961c9eb6903e09d60968c5a8db72a58510c4e3dcd13a5ef
AUX ocaml-4.05.0-gcc10.patch 1976 BLAKE2B cf1240a815d731e99862740ddf90f6a0ea1d078c9e4e1cef126eff4a7d80afbde73f45d360a26eaa14863cc35d2086d98d130251490959df4c361a51ced0557e SHA512 e55cb651431798294b21ee0ea8818d6c42f88c329b7a1985af9d460f2a5b3057f2ee229e72699f9660168202a0c78dcf89b8bfce2154ca3e141fe8fb5f861773
AUX ocaml-4.09.0-gcc-10.patch 571 BLAKE2B 990107a1d199d350a821596e7655566bb8eb71ee828eb0247bd25111760dd4dd6952a0bea6c29f69f6fa4ef8d02bd47166b5f2c4ced30ed830078b1555ca86eb SHA512 430774f62cea3f4ed06c9a1cbc73c68e3eab0d6fbebb5e62ea12a012cc2b25bb1a776ff08a7d532140bc2e12eae3e1a43605bf5708e1333b23a135b9801de084
+AUX ocaml-4.11.2-glibc-2.34.patch 3318 BLAKE2B 96fe61e553e7c67f76df32f2e5532f7a6eae57fb60752c7c49d71baf416ac74a4c7b925ecfd0bd5874a1728b51ca36b82d636bfa6ab30ec5f3df37fbac2a73b9 SHA512 eb54d912338a42a21f736dcd1591f77403b0dff8772059bd7f39a6e83b8a5e89bd5a7a9d4200bacbcaa8ec0450a5a78ecf6645bb5405d45fd1c077cbe1c36f7f
+AUX ocaml-4.12.0-glibc-2.34.patch 3411 BLAKE2B d5138feaf6ca1e4a25ee85100013e343f8867bfe22d1c8c26df56fe1a6266b9cf37738f0b5fa6ee6daaaed9c90880529a50ffa1e789766039727dd407d15da51 SHA512 978a300d28bcb4c4d312e5b9f830140b08a282ba850d7c7a3866ca54413a321695d21315fff423d646085d8eed148a3f84567c08a4e09957b4b87010d65ee694
AUX ocaml-rebuild.sh 1120 BLAKE2B 6f88a9f2b99fae7f89b884bb08d2c6ad6a0e14d4a8fd06d498037f78c5f6ef040428f9de224b5fe5df4ef64eaed419cda6d8715ea0c0a4c4dad60c5cf75a4147 SHA512 05a3e81e95533135d9895091c21621c73ae82851abd4889d64f035979eb25f8d90b60f469d7ef5e789fd1a4adffd6bbe255e6708c14c24a04f8a423507d19a40
AUX ocaml.conf 177 BLAKE2B da070848d9e3a30ad303c296f55de87c30fd15feee3304ccc1d1f844d83c5a646664cd4d9958375ead2324e25bb88280fdb78f9e4230eeb8cd5825eed6f2f91d SHA512 4f0a48b8101b77d568d8d0a852f2a21fd46b7947c5d3f975ee4cd8a9c37c993d689cf5fb53b54a6b2740cb865051dc50c74c0c373eb697fca800ca143d401aa4
DIST ocaml-4.05.0.tar.gz 4431750 BLAKE2B c2ab003a13e0a581ebd0e1c96eeb8a9baea9bfe6bee08823b0e4541819201ec109f1846e13fc1aefa51a001eefbb8f73320ba854d41975fc68cef41bc75b1ecc SHA512 9a060ae4b741e1687277403e5bdb8f6eda2e2ebf6c45f7c0149b66ea1213cb26d13febfbb3f11c12543e244cfdd053b786b09c4145e2348e5d89a7206f7de225
DIST ocaml-4.09.0.tar.gz 4838748 BLAKE2B 80f29d535c64bf2371b480217723ed20b2b21cfd93ce31366a7b91e7ddffdf68db4e88d085288b7e21efee567a13f42ecff24c3a0115507b006acf844239cefd SHA512 dc0271e591bf929b751705835790949a9d741e12d085c8b207c3689b5838a02ea8de80da8b2605d2e6744f2f541b0d1694ffafff9509e99ce01f3a391f6ef2ae
DIST ocaml-4.10.2.tar.gz 4933135 BLAKE2B ec5e92adb23c28a254247182c79ab555fd82603e02f24799049b8057abf869d18234302408c8ae89b9997a2b210ed6965e45c2c03e4f0cab34262ad3f6ebb528 SHA512 1dd827da07f01e815fd74dd7ee84db0900f24782f8f7fd426e2d71b9fb03c7b8045f22e018120a0446c362315751365d1bd8c1724edef2b182394e76eb0a07b2
DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3
-DIST ocaml-4.12.0.tar.gz 5179734 BLAKE2B 318be7e306157102d7ad22802db381dfa9c675e43325395695c3564e5ffee87d9b55d1152ea1603edb5ef715a28cbde85d835dbf1b5aface2dc415c67192c208 SHA512 951e44cdda613f9c6c5f988434c84249a2d63ba14e21938a9e74c174ebaf9d81a3160d1e5021d57fcd4882732ae6aefc05239ac38116f39ca83d53879d5d4eaf
DIST ocaml-4.12.1.tar.gz 5181696 BLAKE2B 9d21438e09b1a9680eabb65f5c78d9fe84459592ef7bb797a1933e5383f7b6d5cefffa8cdc184abc102417f5dbc0fca8ef624c9b560f89eaff6537544b5b395f SHA512 e942e5cf5530804690ec45c40936ad2acbb60e11279fc676e0f04181fe1855f84ee5c3cb9c337fc5d01f6ee0e7b2251a6c04f7de56d99c20bb62026dff6c5671
-DIST ocaml-4.13.0.tar.gz 5323007 BLAKE2B 56cbb64272ac2b4b8894b3bb91ec184eb977cb056ae75ace2fce716fdb9853d5626b8f91dcc339d1d0f9f033f032f99bc6e49c443ee142f6005aaabeef9a670a SHA512 553c94ba5c5332d134f2695b3323e4be60ef2d0a404652cbcc56968ec91b1de19a6d894c6e365e418fe814595bb926450d7b109e328e25fc317f13ed6b703080
DIST ocaml-4.13.1.tar.gz 5323203 BLAKE2B f1dcb1601ebfa2a37351e3a466a7ca601518c2da403b01aeb182738a54d5887523ab554d747d6591cb09b07b417865e20907f7877117b2d2d069ef6c9edc0fae SHA512 da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6
DIST ocaml-patches-9.tar.bz2 1700 BLAKE2B 4e46b8fb490db28f815414e285f54e251394ea53e1d25c529bbea9f03e426fd19132b1e2c7c2be7d14983fceb4cad073d191b001f6da522fee4226371d4a2eca SHA512 cc19f9104fac69aecc5effa8cb772342e1fb61cdcd38ba0176efe04cf3d710b1c56d5178748f3bd29099af91fa684da432a8ef8d42de76dbd1b6954a255ea6c0
-EBUILD ocaml-4.05.0-r7.ebuild 4138 BLAKE2B 745222cde60f1ddae4a7a437100e724a88ddaab89bfc78befd5572d6a582e344564b78350acdb47a626a4d9f95612e64d2419534b48dec5782990b1dc35c3376 SHA512 a9fa601a6a34c84aeb262d027936861e45ea23cc8ba679ebefa6d49de0e5170cec3c213c33bed4acaa4dbae37e8bcf4b1890a623bbdd1c2c552567146ac1fdcd
-EBUILD ocaml-4.05.0-r8.ebuild 4178 BLAKE2B 505af46e12d67cbaab60ed33ee91ce46d7670a4fdc09d5ad80cd31fa00c69d7a8f32f469cdbbd1a531624d4a347a56b823aa056447f4ed911c0ea7669827d469 SHA512 8c555496ac8f0ac1a671be1e2321d336a5001fc90fb92ba2007466677d2653436d4b4651339f7f07c91b7f9d0d2b96bcb8db55ab2b02f47106e3c44821524202
-EBUILD ocaml-4.09.0-r2.ebuild 2573 BLAKE2B 1d50f2cbad2e338864f4045d321184c4de79557428e25a10d5949ebdc3c2ff252520d9a6638080384ec48f00742a87301913d5a038919734698bb5a9f5bdea18 SHA512 ed60dcedffdd8238ddeb976dc210a0156316b92a54070c5a523ecb9e29f500d8f430bb737788d0c1fda66ad5855f1da74d11addedb927e2935e02609531d66ae
-EBUILD ocaml-4.10.2-r2.ebuild 2530 BLAKE2B f428c3a4f0d65464bb384c066b58ddf11993547629070265e79d482f0df8fc861a25e5d62d04e397356ef6b12fffc3fcbabafe5be788cc403ab772cbdd523cca SHA512 834a2a86aa66211f07bbaae967e0da94eb3fb9ffd3ff29724b6002080ff26b3a0e1b8ded081f3ff7d92adf6e1cc373d6f4165dc94cf01b0ea28b2210a6700f6a
-EBUILD ocaml-4.11.2-r2.ebuild 2402 BLAKE2B 8638f476f62c156c878a5a78e644882f84dab1a7c05642914b07e26672076ae850af94e564460e4a396c0f19a64cafad8c37f3c029aa190fdd9980db6352e0db SHA512 5f2c79e1e5f47dd7eec5e119213132433970437fcb7ca9c053ace5a89f5ea553f3b2b72253fc82a7262b898977f2064fa7556740a0c5f2e6d17080a7d5a326c9
-EBUILD ocaml-4.12.0-r2.ebuild 2406 BLAKE2B 24b58bb81263db44c0a5037e598b3a10b66abfebf2f38341f289bdea588e514b949ae36ca6e3cdc500bed0078c744af48d72e705bf927aa45978ba7d009a3c53 SHA512 6488b249be59af91b5d9b16eab129237535fe31ed388b8b8a69db77d1b506cfde24dfae02b851f907c3cb4b16160b36ced431fa81e321a5788483854da4ff80d
-EBUILD ocaml-4.12.1.ebuild 2406 BLAKE2B 24b58bb81263db44c0a5037e598b3a10b66abfebf2f38341f289bdea588e514b949ae36ca6e3cdc500bed0078c744af48d72e705bf927aa45978ba7d009a3c53 SHA512 6488b249be59af91b5d9b16eab129237535fe31ed388b8b8a69db77d1b506cfde24dfae02b851f907c3cb4b16160b36ced431fa81e321a5788483854da4ff80d
-EBUILD ocaml-4.13.0.ebuild 2406 BLAKE2B 24b58bb81263db44c0a5037e598b3a10b66abfebf2f38341f289bdea588e514b949ae36ca6e3cdc500bed0078c744af48d72e705bf927aa45978ba7d009a3c53 SHA512 6488b249be59af91b5d9b16eab129237535fe31ed388b8b8a69db77d1b506cfde24dfae02b851f907c3cb4b16160b36ced431fa81e321a5788483854da4ff80d
+EBUILD ocaml-4.05.0-r7.ebuild 4233 BLAKE2B f36bb3443204c123a153a2c6571923e3b55d62796c2070603c52fdbab45df81afe4a33b701b6ac5335c53b12f1bafb6664a5b83364c742d168f04c7c7d4beb18 SHA512 16fcb2fa8a40aa7aebeb3f18031204c04a2d6407f9f54488a02b0ec8f1f78d44c30238b2e682507fe77cfe1c7958c809ad2112d532edcce91303646338e1cfc2
+EBUILD ocaml-4.05.0-r8.ebuild 4273 BLAKE2B 3bd81d4fd9e6933cd56657b91d38b0eb32c37740371f1a5407c7c0dd8a4d49707e7d045626f501f99b312d7e36d4f9a0af561cda3a5f866153e00d8dfac25cfb SHA512 16e6038aa3701f031fddb7c38efed5f883624800d970f3f636c3da6fec93fb7b70cb6e7e1c99eba8324568c2d59cd2626b707b03d82c63a809cf2f5fa72def0e
+EBUILD ocaml-4.09.0-r2.ebuild 2670 BLAKE2B 9f1f961c10033da32c1f03351a77ca41d0f0deda525b56b0a7adb8d1b307f289c6852ab5ccafb6d47c17408ebf86ee9b87f0096862310714b0d5bb539e7d9963 SHA512 7de20119f0a8f392cf95c6593b93b4e995fb8e1c0872577b2816a42b0c9c2c40b74282ea3db90dbf10f05dfdb0a62e8452b3178ffaa42c576c36312db09efdfe
+EBUILD ocaml-4.10.2-r2.ebuild 2625 BLAKE2B 9c0505058ed5bcadc60e0cff518fc43fde91a40b938ea8e0c9383e2a25542c06b7216ac859366c583ac338761656d41b2dbf0b6a2e62b7faa9f8f7d24cf22d3e SHA512 210276caba4bf5e4e2b368f92582bf7007334adf347e223e8a2f18b2301bb25bbff9bcae5767bbd4e5927c44e7e694da01107337c4684830eff00bd6a7cbe17e
+EBUILD ocaml-4.11.2-r2.ebuild 2549 BLAKE2B 84ad17fc96ebc5221c6323499a0317a7c7ad453b143a4602229748a70a8c024450292292518ab200796fa8dca4a7f363bde2d3c4035af29cb6830df857f878b0 SHA512 82a007665435733d750c4bdc51c54cf548d9c2f3201112143bab962479f532a6270a2bc0089402c879330320c11b8387bddba0f3e10094ff7cf464a4052e0d52
+EBUILD ocaml-4.12.1.ebuild 2464 BLAKE2B eadf170ff1ab0e3fc99c662d6e523a2fda6d4ab27d684b56c37bba2f02a03d7ccfefc2bf153f6eaa350e74a2e735cdf415b3d278210ed44337d45e45688663a1 SHA512 0ddeb9d7dd3b124fce02d291377f6c8964e19fb8709ce57b0e52a8628523991d3780862c4c0df55f4d7694f159ab65df89ec23d52182fd87d9c9c155b0423235
EBUILD ocaml-4.13.1.ebuild 2406 BLAKE2B 24b58bb81263db44c0a5037e598b3a10b66abfebf2f38341f289bdea588e514b949ae36ca6e3cdc500bed0078c744af48d72e705bf927aa45978ba7d009a3c53 SHA512 6488b249be59af91b5d9b16eab129237535fe31ed388b8b8a69db77d1b506cfde24dfae02b851f907c3cb4b16160b36ced431fa81e321a5788483854da4ff80d
MISC metadata.xml 776 BLAKE2B e7b13b4bb764cec6df76ede0eb2d492cc705ce51b18a445fa3f9ebaab119fab8cae45a2a9d02c70f38e19f2e2d2c06de648a3a0843a603dd7b68942c7cd00bdb SHA512 92e3afe1c40991d37dc460d6091ff2b15c83740343e5d8dd69344eb61d873fbd66af1b96e70904f7757c06f2b104d1450883cc79877709c779467af64e2ea96e
diff --git a/dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch
new file mode 100644
index 000000000000..22cbb806e6ea
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.11.2-glibc-2.34.patch
@@ -0,0 +1,91 @@
+https://gitlab.com/redhat/centos-stream/rpms/ocaml/-/raw/c9s/0006-Dynamically-allocate-the-alternate-signal-stack-1026.patch
+https://bugs.gentoo.org/804498
+
+From 24a9db7784ddfcf0af2d2be2f51616ed960ae7e8 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 6/6] 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
+@@ -82,7 +82,7 @@ void caml_set_action_pending (void);
+ value caml_do_pending_actions_exn (void);
+ value caml_process_pending_actions_with_root (value extra_root); // raises
+ int caml_set_signal_action(int signo, int action);
+-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
+@@ -86,4 +86,4 @@ int caml_set_signal_action(int signo, int action)
+ return 0;
+ }
+
+-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
+@@ -195,8 +195,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
+@@ -282,28 +280,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
+ }
+
+-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.0-glibc-2.34.patch b/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch
new file mode 100644
index 000000000000..486b44846a86
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-4.12.0-glibc-2.34.patch
@@ -0,0 +1,91 @@
+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 <xavierleroy@users.noreply.github.com>
+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/ocaml-4.05.0-r7.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
index 7604e5ba353b..68a369bcebf8 100644
--- a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
+++ b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild
@@ -66,6 +66,11 @@ src_configure() {
# 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
diff --git a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
index aab387a10427..4c2da17dac59 100644
--- a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
+++ b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild
@@ -67,6 +67,11 @@ src_configure() {
# 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
diff --git a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
index 23d27276013c..68b58ca86b18 100644
--- a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild
@@ -21,13 +21,18 @@ BDEPEND="${RDEPEND}
PDEPEND="emacs? ( app-emacs/ocaml-mode )
xemacs? ( app-xemacs/ocaml )"
-PATCHES=("${FILESDIR}"/${PN}-4.09.0-gcc-10.patch)
+PATCHES=( "${FILESDIR}"/${PN}-4.09.0-gcc-10.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
diff --git a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
index 7203dec65d67..3b6334a9c87c 100644
--- a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild
@@ -26,6 +26,11 @@ src_prepare() {
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
diff --git a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
index 3ef5a4d10154..cbc5b7cb458b 100644
--- a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
+++ b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild
@@ -11,7 +11,7 @@ DESCRIPTION="Programming language supporting functional, imperative & object-ori
LICENSE="QPL-1.0 LGPL-2"
SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
IUSE="emacs flambda latex +ocamlopt spacetime xemacs"
RDEPEND="sys-libs/binutils-libs:=
@@ -21,11 +21,20 @@ BDEPEND="${RDEPEND}
PDEPEND="emacs? ( app-emacs/ocaml-mode )
xemacs? ( app-xemacs/ocaml )"
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.11.2-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
diff --git a/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild
deleted file mode 100644
index da99522c6e38..000000000000
--- a/dev-lang/ocaml/ocaml-4.12.0-r2.ebuild
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 1999-2021 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="QPL-1.0 LGPL-2"
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-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 )"
-
-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
-}
diff --git a/dev-lang/ocaml/ocaml-4.12.1.ebuild b/dev-lang/ocaml/ocaml-4.12.1.ebuild
index da99522c6e38..287a7f38e79d 100644
--- a/dev-lang/ocaml/ocaml-4.12.1.ebuild
+++ b/dev-lang/ocaml/ocaml-4.12.1.ebuild
@@ -20,6 +20,10 @@ BDEPEND="${RDEPEND}
PDEPEND="emacs? ( app-emacs/ocaml-mode )
xemacs? ( app-xemacs/ocaml )"
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch
+)
+
src_prepare() {
default
diff --git a/dev-lang/ocaml/ocaml-4.13.0.ebuild b/dev-lang/ocaml/ocaml-4.13.0.ebuild
deleted file mode 100644
index da99522c6e38..000000000000
--- a/dev-lang/ocaml/ocaml-4.13.0.ebuild
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 1999-2021 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="QPL-1.0 LGPL-2"
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-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 )"
-
-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
-}