From 06d6e508a6c43bae22b96793b2f502171b203daa Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 7 Jan 2021 06:09:29 +0000 Subject: [PATCH 01/54] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- ocaml.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/ocaml.spec b/ocaml.spec index 944a6c2..a0c419f 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -65,6 +65,7 @@ Patch0004: 0004-Remove-configure-from-.gitattributes.patch # Fix compilation with LTO (upstream, but not in 4.11 branch). Patch0005: 0005-Fix-type-mismatches-between-definition-and-declarati.patch +BuildRequires: make BuildRequires: git BuildRequires: gcc BuildRequires: autoconf From 2dec79cc2e026c5ccadc721f906f8b593457bb44 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 21:52:06 +0000 Subject: [PATCH 02/54] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index a0c419f..69cb928 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -31,7 +31,7 @@ Name: ocaml Version: 4.11.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -375,6 +375,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 4.11.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Tue Sep 01 2020 Richard W.M. Jones - 4.11.1-1 - OCaml 4.11.1 release (RHBZ#1870368#c26). From b8653f50ff7bc66cac91dcf67a45317c557f8a27 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 28 Feb 2021 20:53:29 +0000 Subject: [PATCH 03/54] OCaml 4.12.0 release (RHBZ#1893381). Workaround for glibc non-constant SIGSTKSZ (https://github.com/ocaml/ocaml/issues/10250) --- 0001-Don-t-add-rpaths-to-libraries.patch | 10 +-- ...-Allow-user-defined-C-compiler-flags.patch | 12 ++-- ...-incorrect-assumption-about-cross-co.patch | 12 ++-- ...Remove-configure-from-.gitattributes.patch | 28 -------- ...ound-for-glibc-non-constant-SIGSTKSZ.patch | 39 +++++++++++ ...hes-between-definition-and-declarati.patch | 69 ------------------- ocaml.spec | 34 ++++----- sources | 2 +- 8 files changed, 75 insertions(+), 131 deletions(-) delete mode 100644 0004-Remove-configure-from-.gitattributes.patch create mode 100644 0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch delete mode 100644 0005-Fix-type-mismatches-between-definition-and-declarati.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 9c8df31..855b634 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,17 +1,17 @@ -From 4c7732daae8f0d2a622f91f5ff3add5c2248a2e3 Mon Sep 17 00:00:00 2001 +From db7d6fd991dc43f392c895ee857f7948f5b4fe5e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/5] Don't add rpaths to libraries. +Subject: [PATCH 1/4] Don't add rpaths to libraries. --- tools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Makefile b/tools/Makefile -index dbad0b74f..c920a5337 100644 +index 07e2eda1a..340508a60 100644 --- a/tools/Makefile +++ b/tools/Makefile -@@ -154,8 +154,8 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo \ +@@ -146,8 +146,8 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo \ ocamlmklibconfig.ml: $(ROOTDIR)/Makefile.config Makefile (echo 'let bindir = "$(BINDIR)"'; \ echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\ @@ -23,5 +23,5 @@ index dbad0b74f..c920a5337 100644 > ocamlmklibconfig.ml -- -2.28.0.rc2 +2.29.0.rc2 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index 8516bb4..8c7c0d1 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,18 +1,18 @@ -From 441ad77a0c89f4abdf104c668d579607f338a052 Mon Sep 17 00:00:00 2001 +From bf42dba499e053196b9235aae9987f395c4a4b7e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/5] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index aa5f26f28..5153853b7 100644 +index 83455a3b6..213392b25 100644 --- a/configure.ac +++ b/configure.ac -@@ -609,6 +609,10 @@ AS_CASE([$host], - internal_cflags="$gcc_warnings"], +@@ -638,6 +638,10 @@ AS_CASE([$host], + internal_cflags="$cc_warnings"], [common_cflags="-O"])]) +# Allow CFLAGS and LDFLAGS to be added. @@ -23,5 +23,5 @@ index aa5f26f28..5153853b7 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. -- -2.28.0.rc2 +2.29.0.rc2 diff --git a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch index 1423b0d..9324e15 100644 --- a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch +++ b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch @@ -1,7 +1,7 @@ -From 3318c5b805d8d6ae1d571f18f682c9f701b712e2 Mon Sep 17 00:00:00 2001 +From 5cc71dbb0f25d4c5b444f099965b93149577ee8f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Apr 2019 16:16:29 +0100 -Subject: [PATCH 3/5] configure: Remove incorrect assumption about +Subject: [PATCH 3/4] configure: Remove incorrect assumption about cross-compiling. See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 @@ -10,10 +10,10 @@ See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac -index 5153853b7..4e97474a2 100644 +index 213392b25..c7e594b5d 100644 --- a/configure.ac +++ b/configure.ac -@@ -511,10 +511,11 @@ AS_IF( +@@ -529,10 +529,11 @@ AS_IF( # Are we building a cross-compiler @@ -29,7 +29,7 @@ index 5153853b7..4e97474a2 100644 # Checks for programs -@@ -1021,7 +1022,7 @@ AS_CASE([$arch], +@@ -1072,7 +1073,7 @@ AS_CASE([$arch], # Assembler @@ -39,5 +39,5 @@ index 5153853b7..4e97474a2 100644 # We first compute default values for as and aspp # If values have been given by the user then they take precedence over -- -2.28.0.rc2 +2.29.0.rc2 diff --git a/0004-Remove-configure-from-.gitattributes.patch b/0004-Remove-configure-from-.gitattributes.patch deleted file mode 100644 index b9003f7..0000000 --- a/0004-Remove-configure-from-.gitattributes.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 01d8e3f82adb382fb90af15879f722e824834c84 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sat, 18 Jan 2020 11:31:27 +0000 -Subject: [PATCH 4/5] Remove configure from .gitattributes. - -It's not a binary file. ---- - .gitattributes | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/.gitattributes b/.gitattributes -index 200eb49c6..d871764de 100644 ---- a/.gitattributes -+++ b/.gitattributes -@@ -29,10 +29,6 @@ - - /boot/menhir/parser.ml* -diff - --# configure is declared as binary so that it doesn't get included in diffs. --# This also means it will have the correct Unix line-endings, even on Windows. --/configure binary -- - # 'union' merge driver just unions textual content in case of conflict - # http://krlmlr.github.io/using-gitattributes-to-avoid-merge-conflicts/ - /.mailmap merge=union --- -2.28.0.rc2 - diff --git a/0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch b/0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch new file mode 100644 index 0000000..b672f08 --- /dev/null +++ b/0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch @@ -0,0 +1,39 @@ +From dfb5e954a04f59b0456cc4c0ddf3acaf22e0ff07 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sun, 28 Feb 2021 20:45:47 +0000 +Subject: [PATCH 4/4] Workaround for glibc non-constant SIGSTKSZ + +https://github.com/ocaml/ocaml/issues/10250 + +Signed-off-by: Richard W.M. Jones +--- + runtime/signals_nat.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c +index 8b64ab452..7f0a97513 100644 +--- a/runtime/signals_nat.c ++++ b/runtime/signals_nat.c +@@ -181,7 +181,19 @@ DECLARE_SIGNAL_HANDLER(trap_handler) + #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined" + #endif + ++#ifndef __GLIBC__ + static char sig_alt_stack[SIGSTKSZ]; ++#else ++/* glibc 2.34 has non-constant SIGSTKSZ */ ++static char *sig_alt_stack; ++ ++static void allocate_sig_alt_stack(void) __attribute__((constructor)); ++static void ++allocate_sig_alt_stack(void) ++{ ++ sig_alt_stack = malloc(SIGSTKSZ); ++} ++#endif + + /* Code compiled with ocamlopt never accesses more than + EXTRA_STACK bytes below the stack pointer. */ +-- +2.29.0.rc2 + diff --git a/0005-Fix-type-mismatches-between-definition-and-declarati.patch b/0005-Fix-type-mismatches-between-definition-and-declarati.patch deleted file mode 100644 index 587f5a6..0000000 --- a/0005-Fix-type-mismatches-between-definition-and-declarati.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 122db7141d292d63cfbe2c7d7a4280cc73194ece Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Wed, 5 Aug 2020 11:17:52 +0200 -Subject: [PATCH 5/5] Fix type mismatches between definition and declaration - (#9830) - -The C global variable caml_fl_merge and the C function -caml_spacetime_my_profinfo (bytecode version) were declared and -defined with different types. This is undefined behavior and -can cause link-time errors with link-time optimization (LTO). - -Closes: #9825 ---- - runtime/major_gc.c | 4 ++-- - runtime/spacetime_byt.c | 7 ++++++- - 2 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/runtime/major_gc.c b/runtime/major_gc.c -index 5e4f06bce..c8f5a3281 100644 ---- a/runtime/major_gc.c -+++ b/runtime/major_gc.c -@@ -63,7 +63,7 @@ uintnat caml_dependent_size, caml_dependent_allocated; - double caml_extra_heap_resources; - uintnat caml_fl_wsz_at_phase_change = 0; - --extern char *caml_fl_merge; /* Defined in freelist.c. */ -+extern value caml_fl_merge; /* Defined in freelist.c. */ - - static char *markhp, *chunk, *limit; - static double p_backlog = 0.0; /* backlog for the gc speedup parameter */ -@@ -570,7 +570,7 @@ static void sweep_slice (intnat work) - break; - case Caml_blue: - /* Only the blocks of the free-list are blue. See [freelist.c]. */ -- caml_fl_merge = Bp_hp (hp); -+ caml_fl_merge = (value) Bp_hp (hp); - break; - default: /* gray or black */ - CAMLassert (Color_hd (hd) == Caml_black); -diff --git a/runtime/spacetime_byt.c b/runtime/spacetime_byt.c -index 2b0bf1dc2..b75fb0980 100644 ---- a/runtime/spacetime_byt.c -+++ b/runtime/spacetime_byt.c -@@ -12,8 +12,12 @@ - /* */ - /**************************************************************************/ - -+#define CAML_INTERNALS -+ - #include "caml/fail.h" - #include "caml/mlvalues.h" -+#include "caml/io.h" -+#include "caml/spacetime.h" - - int caml_ensure_spacetime_dot_o_is_included = 42; - -@@ -22,7 +26,8 @@ CAMLprim value caml_spacetime_only_works_for_native_code(value foo, ...) - caml_failwith("Spacetime profiling only works for native code"); - } - --uintnat caml_spacetime_my_profinfo (void) -+uintnat caml_spacetime_my_profinfo (spacetime_unwind_info_cache * cached, -+ uintnat wosize) - { - return 0; - } --- -2.28.0.rc2 - diff --git a/ocaml.spec b/ocaml.spec index 69cb928..6c0c101 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -30,8 +30,8 @@ %global rcver %{nil} Name: ocaml -Version: 4.11.1 -Release: 2%{?dist} +Version: 4.12.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -39,7 +39,7 @@ License: QPL and (LGPLv2+ with exceptions) URL: http://www.ocaml.org -Source0: https://caml.inria.fr/pub/distrib/ocaml-4.11/ocaml-%{version}.tar.xz +Source0: https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-%{version}.tar.xz #Source0: https://github.com/ocaml/ocaml/archive/%%{version}.tar.gz # IMPORTANT NOTE: @@ -51,7 +51,7 @@ Source0: https://caml.inria.fr/pub/distrib/ocaml-4.11/ocaml-%{version}.ta # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-34-4.11.1 +# Current branch: fedora-35-4.12.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should @@ -60,10 +60,7 @@ Source0: https://caml.inria.fr/pub/distrib/ocaml-4.11/ocaml-%{version}.ta Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch -Patch0004: 0004-Remove-configure-from-.gitattributes.patch - -# Fix compilation with LTO (upstream, but not in 4.11 branch). -Patch0005: 0005-Fix-type-mismatches-between-definition-and-declarati.patch +Patch0004: 0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch BuildRequires: make BuildRequires: git @@ -233,10 +230,6 @@ chrpath --delete $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so find $RPM_BUILD_ROOT -name .ignore -delete -# Remove .cmt and .cmti files, for now. We could package them later. -# See also: http://www.ocamlpro.com/blog/2012/08/20/ocamlpro-and-4.00.0.html -find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete - # Remove this file. It's only created in certain situations and it's # unclear why it is created at all. rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata @@ -293,8 +286,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_bindir}/ocamlopt.opt %endif -#%{_libdir}/ocaml/addlabels -#%{_libdir}/ocaml/scrapelabels +#%%{_libdir}/ocaml/addlabels +#%%{_libdir}/ocaml/scrapelabels %{_libdir}/ocaml/camlheader %{_libdir}/ocaml/camlheader_ur %{_libdir}/ocaml/expunge @@ -313,7 +306,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %endif %{_libdir}/ocaml/*.mli %{_libdir}/ocaml/libcamlrun_shared.so -%{_libdir}/ocaml/objinfo_helper +#%%{_libdir}/ocaml/objinfo_helper %{_libdir}/ocaml/threads/*.mli %if %{native_compiler} %{_libdir}/ocaml/threads/*.a @@ -329,7 +322,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_bindir}/ocamlrund %{_bindir}/ocamlruni %dir %{_libdir}/ocaml -%{_libdir}/ocaml/VERSION +#%%{_libdir}/ocaml/VERSION %{_libdir}/ocaml/*.cmo %{_libdir}/ocaml/*.cmi %{_libdir}/ocaml/*.cma @@ -345,6 +338,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %files source %doc LICENSE %{_libdir}/ocaml/*.ml +%{_libdir}/ocaml/*.cmt* +%{_libdir}/ocaml/*/*.cmt* %files ocamldoc @@ -375,6 +370,13 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Sun Feb 28 2021 Richard W.M. Jones - 4.12.0-1 +- OCaml 4.12.0 release (RHBZ#1893381). +- Workaround for glibc non-constant SIGSTKSZ + (https://github.com/ocaml/ocaml/issues/10250) +- Package *.cmt and *.cmti files. +- Remove objinfo_helper since it is no longer built. + * Tue Jan 26 2021 Fedora Release Engineering - 4.11.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 1e5a596..71e302d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-4.11.1.tar.xz) = ca34655dc22257aa48aeb48a9cf56bde177aa0f0e7f3965f334939934801a206ed5667b7ab0cc291df9e6bf1bb3251f7384f078ea5562e647fde93167ecb1e84 +SHA512 (ocaml-4.12.0.tar.xz) = fff347398300097e32dcdd0fabfa158693e3d27d4b0fef23a564be4993950be374e3e436205e621485f4188ab007e489c50b1294e1999dac36312e56ec5b52c9 From 129153b85109944bf0b2922949f77ef8f32b39a1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 23 Jun 2021 11:37:37 +0100 Subject: [PATCH 04/54] Move to final version of upstream patch for non-constant SIGSTKSZ NOTE: I did not build this package because it will cause dependency problems (requiring every other OCaml package in F35 to be rebuilt). If there is a mass rebuild of Rawhide then that would be a good time to rebuild it. --- 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...-incorrect-assumption-about-cross-co.patch | 2 +- ...cate-the-alternate-signal-stack-1026.patch | 103 ++++++++++++++++++ ...ound-for-glibc-non-constant-SIGSTKSZ.patch | 39 ------- ocaml.spec | 7 +- 6 files changed, 111 insertions(+), 44 deletions(-) create mode 100644 0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch delete mode 100644 0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 855b634..0b3908e 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -23,5 +23,5 @@ index 07e2eda1a..340508a60 100644 > ocamlmklibconfig.ml -- -2.29.0.rc2 +2.32.0 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index 8c7c0d1..b1c45b3 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -23,5 +23,5 @@ index 83455a3b6..213392b25 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. -- -2.29.0.rc2 +2.32.0 diff --git a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch index 9324e15..0a4567f 100644 --- a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch +++ b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch @@ -39,5 +39,5 @@ index 213392b25..c7e594b5d 100644 # We first compute default values for as and aspp # If values have been given by the user then they take precedence over -- -2.29.0.rc2 +2.32.0 diff --git a/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch b/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch new file mode 100644 index 0000000..15ca240 --- /dev/null +++ b/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch @@ -0,0 +1,103 @@ +From 3104d92743614f8f52039e0520116af4179880a5 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +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) +--- + runtime/caml/signals.h | 2 +- + runtime/signals_byt.c | 2 +- + runtime/signals_nat.c | 25 ++++++++++++++----------- + 3 files changed, 16 insertions(+), 13 deletions(-) + +diff --git a/runtime/caml/signals.h b/runtime/caml/signals.h +index 3ff152c26..285dbd7fe 100644 +--- 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); +diff --git a/runtime/signals_byt.c b/runtime/signals_byt.c +index 2183142da..38eb5e3a4 100644 +--- 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; } +diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c +index 8b64ab452..2b4004860 100644 +--- 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 + } +-- +2.32.0 + diff --git a/0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch b/0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch deleted file mode 100644 index b672f08..0000000 --- a/0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch +++ /dev/null @@ -1,39 +0,0 @@ -From dfb5e954a04f59b0456cc4c0ddf3acaf22e0ff07 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sun, 28 Feb 2021 20:45:47 +0000 -Subject: [PATCH 4/4] Workaround for glibc non-constant SIGSTKSZ - -https://github.com/ocaml/ocaml/issues/10250 - -Signed-off-by: Richard W.M. Jones ---- - runtime/signals_nat.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c -index 8b64ab452..7f0a97513 100644 ---- a/runtime/signals_nat.c -+++ b/runtime/signals_nat.c -@@ -181,7 +181,19 @@ DECLARE_SIGNAL_HANDLER(trap_handler) - #error "CONTEXT_SP is required if HAS_STACK_OVERFLOW_DETECTION is defined" - #endif - -+#ifndef __GLIBC__ - static char sig_alt_stack[SIGSTKSZ]; -+#else -+/* glibc 2.34 has non-constant SIGSTKSZ */ -+static char *sig_alt_stack; -+ -+static void allocate_sig_alt_stack(void) __attribute__((constructor)); -+static void -+allocate_sig_alt_stack(void) -+{ -+ sig_alt_stack = malloc(SIGSTKSZ); -+} -+#endif - - /* Code compiled with ocamlopt never accesses more than - EXTRA_STACK bytes below the stack pointer. */ --- -2.29.0.rc2 - diff --git a/ocaml.spec b/ocaml.spec index 6c0c101..b25c756 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -31,7 +31,7 @@ Name: ocaml Version: 4.12.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -60,7 +60,7 @@ Source0: https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-%{version}.ta Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch -Patch0004: 0004-Workaround-for-glibc-non-constant-SIGSTKSZ.patch +Patch0004: 0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch BuildRequires: make BuildRequires: git @@ -370,6 +370,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Wed Jun 23 2021 Richard W.M. Jones - 4.12.0-2 +- Move to final version of upstream patch for non-constant SIGSTKSZ + * Sun Feb 28 2021 Richard W.M. Jones - 4.12.0-1 - OCaml 4.12.0 release (RHBZ#1893381). - Workaround for glibc non-constant SIGSTKSZ From 95d7ecd59bfa5d442aa4f8e9728811efee3bd73a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 16:31:11 +0000 Subject: [PATCH 05/54] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index b25c756..95a2794 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -31,7 +31,7 @@ Name: ocaml Version: 4.12.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -370,6 +370,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 4.12.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Wed Jun 23 2021 Richard W.M. Jones - 4.12.0-2 - Move to final version of upstream patch for non-constant SIGSTKSZ From edfb35d8754e3ec08ca17381cb95361f81f6f0aa Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 4 Oct 2021 12:43:33 +0100 Subject: [PATCH 06/54] New upstream version 4.13.1 --- .gitignore | 1 + 0001-Don-t-add-rpaths-to-libraries.patch | 36 +++--- ...-Allow-user-defined-C-compiler-flags.patch | 8 +- ...-incorrect-assumption-about-cross-co.patch | 46 ++++++-- ...cate-the-alternate-signal-stack-1026.patch | 103 ------------------ ocaml.spec | 15 +-- sources | 2 +- 7 files changed, 67 insertions(+), 144 deletions(-) delete mode 100644 0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch diff --git a/.gitignore b/.gitignore index 0244410..33b0bdd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /ocaml-*.tar.xz /ocaml-*-refman.pdf /4.11.0.tar.gz +/4.13.1.tar.gz diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 0b3908e..fd84790 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,27 +1,27 @@ -From db7d6fd991dc43f392c895ee857f7948f5b4fe5e Mon Sep 17 00:00:00 2001 +From 23f2e84d360208759c7d82b7ff795770ce6cf0b2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/4] Don't add rpaths to libraries. +Subject: [PATCH 1/3] Don't add rpaths to libraries. --- - tools/Makefile | 4 ++-- + utils/config.mlp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/tools/Makefile b/tools/Makefile -index 07e2eda1a..340508a60 100644 ---- a/tools/Makefile -+++ b/tools/Makefile -@@ -146,8 +146,8 @@ $(call byte_and_opt,ocamlmklib,ocamlmklibconfig.cmo config.cmo \ - ocamlmklibconfig.ml: $(ROOTDIR)/Makefile.config Makefile - (echo 'let bindir = "$(BINDIR)"'; \ - echo 'let supports_shared_libraries = $(SUPPORTS_SHARED_LIBRARIES)';\ -- echo 'let default_rpath = "$(RPATH)"'; \ -- echo 'let mksharedlibrpath = "$(MKSHAREDLIBRPATH)"'; \ -+ echo 'let default_rpath = ""'; \ -+ echo 'let mksharedlibrpath = ""'; \ - echo 'let toolpref = "$(TOOLPREF)"';) \ - > ocamlmklibconfig.ml - +diff --git a/utils/config.mlp b/utils/config.mlp +index bbb3c5694..57d509cd0 100644 +--- a/utils/config.mlp ++++ b/utils/config.mlp +@@ -55,8 +55,8 @@ let native_c_compiler = + let native_c_libraries = "%%NATIVECCLIBS%%" + let native_pack_linker = "%%PACKLD%%" + let ranlib = "%%RANLIBCMD%%" +-let default_rpath = "%%RPATH%%" +-let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%" ++let default_rpath = "" ++let mksharedlibrpath = "" + let ar = "%%ARCMD%%" + let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%% + let mkdll, mkexe, mkmaindll = -- 2.32.0 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index b1c45b3..2e5813a 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,17 +1,17 @@ -From bf42dba499e053196b9235aae9987f395c4a4b7e Mon Sep 17 00:00:00 2001 +From 9966786a7389dc6621f2bc2dce7c690c5a38b67d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index 83455a3b6..213392b25 100644 +index 3698c7cbf..e2a3cbea0 100644 --- a/configure.ac +++ b/configure.ac -@@ -638,6 +638,10 @@ AS_CASE([$host], +@@ -669,6 +669,10 @@ AS_CASE([$host], internal_cflags="$cc_warnings"], [common_cflags="-O"])]) diff --git a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch index 0a4567f..6f7cd50 100644 --- a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch +++ b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch @@ -1,19 +1,23 @@ -From 5cc71dbb0f25d4c5b444f099965b93149577ee8f Mon Sep 17 00:00:00 2001 +From 5eff09224929f8fa1a2e19f9a15befd3a4a395ea Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Apr 2019 16:16:29 +0100 -Subject: [PATCH 3/4] configure: Remove incorrect assumption about +Subject: [PATCH 3/3] configure: Remove incorrect assumption about cross-compiling. See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 + +The error seen without this patch is: + +sh: line 1: x86_64-pc-linux-gnu-as: command not found --- - configure.ac | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) + configure.ac | 31 ++++++++++++++++--------------- + 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac -index 213392b25..c7e594b5d 100644 +index e2a3cbea0..07c005f09 100644 --- a/configure.ac +++ b/configure.ac -@@ -529,10 +529,11 @@ AS_IF( +@@ -560,10 +560,11 @@ AS_IF( # Are we building a cross-compiler @@ -29,15 +33,35 @@ index 213392b25..c7e594b5d 100644 # Checks for programs -@@ -1072,7 +1073,7 @@ AS_CASE([$arch], +@@ -1186,17 +1187,17 @@ AS_CASE([$arch], # Assembler --AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""]) -+#AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""]) +-AS_IF([test -n "$target_alias"], +- [toolpref="${target_alias}-" +- as_target="$target" +- as_cpu="$target_cpu"], +- [AS_IF([test -n "$host_alias"], +- [toolpref="${host_alias}-" +- as_target="$host" +- as_cpu="$host_cpu"], +- [toolpref="" +- as_target="$build" +- as_cpu="$build_cpu"])]) ++dnl AS_IF([test -n "$target_alias"], ++dnl [toolpref="${target_alias}-" ++dnl as_target="$target" ++dnl as_cpu="$target_cpu"], ++dnl [AS_IF([test -n "$host_alias"], ++dnl [toolpref="${host_alias}-" ++dnl as_target="$host" ++dnl as_cpu="$host_cpu"], ++dnl [toolpref="" ++dnl as_target="$build" ++dnl as_cpu="$build_cpu"])]) - # We first compute default values for as and aspp - # If values have been given by the user then they take precedence over + # Finding the assembler + # The OCaml build system distinguishes two different assemblers: -- 2.32.0 diff --git a/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch b/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch deleted file mode 100644 index 15ca240..0000000 --- a/0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 3104d92743614f8f52039e0520116af4179880a5 Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -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) ---- - runtime/caml/signals.h | 2 +- - runtime/signals_byt.c | 2 +- - runtime/signals_nat.c | 25 ++++++++++++++----------- - 3 files changed, 16 insertions(+), 13 deletions(-) - -diff --git a/runtime/caml/signals.h b/runtime/caml/signals.h -index 3ff152c26..285dbd7fe 100644 ---- 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); -diff --git a/runtime/signals_byt.c b/runtime/signals_byt.c -index 2183142da..38eb5e3a4 100644 ---- 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; } -diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c -index 8b64ab452..2b4004860 100644 ---- 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 - } --- -2.32.0 - diff --git a/ocaml.spec b/ocaml.spec index 95a2794..b52b56c 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -30,8 +30,8 @@ %global rcver %{nil} Name: ocaml -Version: 4.12.0 -Release: 3%{?dist} +Version: 4.13.1 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -39,8 +39,7 @@ License: QPL and (LGPLv2+ with exceptions) URL: http://www.ocaml.org -Source0: https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-%{version}.tar.xz -#Source0: https://github.com/ocaml/ocaml/archive/%%{version}.tar.gz +Source0: https://github.com/ocaml/ocaml/archive/%%{version}.tar.gz # IMPORTANT NOTE: # @@ -51,7 +50,7 @@ Source0: https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-%{version}.ta # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-35-4.12.0 +# Current branch: fedora-36-4.13.1 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should @@ -60,9 +59,8 @@ Source0: https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-%{version}.ta Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch -Patch0004: 0004-Dynamically-allocate-the-alternate-signal-stack-1026.patch -BuildRequires: make +BuildRequires: make BuildRequires: git BuildRequires: gcc BuildRequires: autoconf @@ -370,6 +368,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Mon Oct 04 2021 Richard W.M. Jones - 4.13.1-1 +- New upstream version 4.13.1 + * Thu Jul 22 2021 Fedora Release Engineering - 4.12.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index 71e302d..e1aeb8a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-4.12.0.tar.xz) = fff347398300097e32dcdd0fabfa158693e3d27d4b0fef23a564be4993950be374e3e436205e621485f4188ab007e489c50b1294e1999dac36312e56ec5b52c9 +SHA512 (4.13.1.tar.gz) = da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 From 999a7e734e97281674caaa3e985c0f48f7eadb21 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 21:37:12 +0000 Subject: [PATCH 07/54] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index b52b56c..7ddabff 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -31,7 +31,7 @@ Name: ocaml Version: 4.13.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -368,6 +368,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 4.13.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Mon Oct 04 2021 Richard W.M. Jones - 4.13.1-1 - New upstream version 4.13.1 From b249a82b37c15a17b69cda88445bdc753a19203c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 26 Jan 2022 16:29:56 +0000 Subject: [PATCH 08/54] Disable package note misfeature --- 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...-incorrect-assumption-about-cross-co.patch | 2 +- ...nly-use-OC_-for-building-executables.patch | 31 +++++++++++++++++++ ocaml.spec | 10 +++++- 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 0004-configure-Only-use-OC_-for-building-executables.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index fd84790..eb6794d 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 23f2e84d360208759c7d82b7ff795770ce6cf0b2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/3] Don't add rpaths to libraries. +Subject: [PATCH 1/4] Don't add rpaths to libraries. --- utils/config.mlp | 4 ++-- diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index 2e5813a..389f09b 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From 9966786a7389dc6621f2bc2dce7c690c5a38b67d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ diff --git a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch index 6f7cd50..e101809 100644 --- a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch +++ b/0003-configure-Remove-incorrect-assumption-about-cross-co.patch @@ -1,7 +1,7 @@ From 5eff09224929f8fa1a2e19f9a15befd3a4a395ea Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Apr 2019 16:16:29 +0100 -Subject: [PATCH 3/3] configure: Remove incorrect assumption about +Subject: [PATCH 3/4] configure: Remove incorrect assumption about cross-compiling. See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 diff --git a/0004-configure-Only-use-OC_-for-building-executables.patch b/0004-configure-Only-use-OC_-for-building-executables.patch new file mode 100644 index 0000000..1f21b0f --- /dev/null +++ b/0004-configure-Only-use-OC_-for-building-executables.patch @@ -0,0 +1,31 @@ +From acb5dbaa8f8ece825a48814024404a1a6c5ba7b2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 26 Jan 2022 15:47:02 +0000 +Subject: [PATCH 4/4] configure: Only use OC_* for building executables + +Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for +"package notes" which contains build paths. + +In any case it seems pointless having both the OC_* variables and also +including the regular CFLAGS/LDFLAGS. Give me full control over what +ocamlopt uses. +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 07c005f09..19fe3fd1b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -43,7 +43,7 @@ libraries_man_section=3 + # at the moment they are not taken into account on Windows, because + # flexlink, which is used to build executables on this platform, can + # not handle them. +-mkexe="\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_LDFLAGS) \$(LDFLAGS)" ++mkexe="\$(CC) \$(OC_CFLAGS) \$(OC_LDFLAGS)" + + # Flags for building executable files with debugging symbols + mkexedebugflag="-g" +-- +2.32.0 + diff --git a/ocaml.spec b/ocaml.spec index 7ddabff..64b3036 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,3 +1,6 @@ +# Don't add -Wl,-dT, +%undefine _package_note_flags + # OCaml has a bytecode backend that works on anything with a C # compiler, and a native code backend available on a subset of # architectures. A further subset of architectures support native @@ -31,7 +34,7 @@ Name: ocaml Version: 4.13.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -59,6 +62,7 @@ Source0: https://github.com/ocaml/ocaml/archive/%%{version}.tar.gz Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch +Patch0004: 0004-configure-Only-use-OC_-for-building-executables.patch BuildRequires: make BuildRequires: git @@ -368,6 +372,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Wed Jan 26 2022 Richard W.M. Jones - 4.13.1-3 +- Disable package note misfeature +- Remove duplicate flags from mkexe + * Thu Jan 20 2022 Fedora Release Engineering - 4.13.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 37422916a0f4d46663ffff8b54cea5f921414d16 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 4 Feb 2022 10:22:30 +0000 Subject: [PATCH 09/54] Rebuild 4.13.1 to remove package notes --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 64b3036..59efada 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -34,7 +34,7 @@ Name: ocaml Version: 4.13.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -372,6 +372,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Fri Feb 04 2022 Richard W.M. Jones - 4.13.1-4 +- Rebuild 4.13.1 to remove package notes + * Wed Jan 26 2022 Richard W.M. Jones - 4.13.1-3 - Disable package note misfeature - Remove duplicate flags from mkexe From 3eca5f5ac733c20aaed5c4f29dd7d1f7f743ac56 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 9 Jun 2022 14:42:27 -0600 Subject: [PATCH 10/54] Fix the Source0 URL - chrpath is no longer needed - Use the %license macro - Build the test binaries so the tests will run --- ocaml.spec | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index 59efada..8728970 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -40,9 +40,9 @@ Summary: OCaml compiler and programming environment License: QPL and (LGPLv2+ with exceptions) -URL: http://www.ocaml.org +URL: https://www.ocaml.org -Source0: https://github.com/ocaml/ocaml/archive/%%{version}.tar.gz +Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{version}.tar.gz # IMPORTANT NOTE: # @@ -75,7 +75,6 @@ BuildRequires: gawk BuildRequires: perl-interpreter BuildRequires: util-linux BuildRequires: /usr/bin/annocheck -BuildRequires: chrpath # ocamlopt runs gcc to link binaries. Because Fedora includes # hardening flags automatically, redhat-rpm-config is also required. @@ -85,9 +84,9 @@ Requires: redhat-rpm-config # Because we pass -c flag to ocaml-find-requires (to avoid circular # dependencies) we also have to explicitly depend on the right version # of ocaml-runtime. -Requires: ocaml-runtime = %{version}-%{release} +Requires: ocaml-runtime%{?_isa} = %{version}-%{release} -# Bundles an MD5 implementation in byterun/md5.{c,h} +# Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c Provides: bundled(md5-plumb) Provides: ocaml(compiler) = %{version} @@ -121,7 +120,7 @@ bytecode. %package source Summary: Source code for OCaml libraries -Requires: ocaml = %{version}-%{release} +Requires: ocaml%{?_isa} = %{version}-%{release} %description source Source code for OCaml libraries. @@ -129,8 +128,8 @@ Source code for OCaml libraries. %package ocamldoc Summary: Documentation generator for OCaml -Requires: ocaml = %{version}-%{release} -Provides: ocamldoc +Requires: ocaml%{?_isa} = %{version}-%{release} +Provides: ocamldoc = %{version} %description ocamldoc Documentation generator for OCaml. @@ -150,7 +149,7 @@ This package contains man pages. %package compiler-libs Summary: Compiler libraries for OCaml -Requires: ocaml = %{version}-%{release} +Requires: ocaml%{?_isa} = %{version}-%{release} %description compiler-libs @@ -211,12 +210,14 @@ annocheck -v hello ||: %endif %ifarch %{test_arches} -cd testsuite - +make ocamltest +%ifarch %{ocaml_native_compiler} +make ocamltest.opt +%endif %ifarch %{test_arches_required} -make -j1 all +make -j1 tests %else -make -j1 all ||: +make -j1 tests ||: %endif %endif @@ -227,9 +228,6 @@ perl -pi -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release -# Remove rpaths from stublibs .so files. -chrpath --delete $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so - find $RPM_BUILD_ROOT -name .ignore -delete # Remove this file. It's only created in certain situations and it's @@ -238,7 +236,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %files -%doc LICENSE +%license LICENSE %{_bindir}/ocaml %{_bindir}/ocamlcmt @@ -319,7 +317,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %files runtime -%doc README.adoc LICENSE Changes +%doc README.adoc Changes +%license LICENSE %{_bindir}/ocamlrun %{_bindir}/ocamlrund %{_bindir}/ocamlruni @@ -338,14 +337,14 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %files source -%doc LICENSE +%license LICENSE %{_libdir}/ocaml/*.ml %{_libdir}/ocaml/*.cmt* %{_libdir}/ocaml/*/*.cmt* %files ocamldoc -%doc LICENSE +%license LICENSE %doc ocamldoc/Changes.txt %{_bindir}/ocamldoc* %{_libdir}/ocaml/ocamldoc @@ -357,7 +356,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %files compiler-libs -%doc LICENSE +%license LICENSE %dir %{_libdir}/ocaml/compiler-libs %{_libdir}/ocaml/compiler-libs/*.mli %{_libdir}/ocaml/compiler-libs/*.cmi @@ -372,6 +371,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Thu Jun 9 2022 Jerry James - 4.13.1-4 +- Fix the Source0 URL +- chrpath is no longer needed +- Use the %%license macro +- Build the test binaries so the tests will run + * Fri Feb 04 2022 Richard W.M. Jones - 4.13.1-4 - Rebuild 4.13.1 to remove package notes From 4bb2864cc2fa26a34f802021d80711815f8f0361 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 9 Jun 2022 22:37:55 +0100 Subject: [PATCH 11/54] Upload renamed sources file --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index e1aeb8a..ee936bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (4.13.1.tar.gz) = da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 +SHA512 (ocaml-4.13.1.tar.gz) = da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 From 73c8e3d782f067e77102686a0f3e5b2f67e7b18a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 18 Jun 2022 12:02:39 +0100 Subject: [PATCH 12/54] New upstream version 4.14.0 --- ...arning-when-calling-virtual-methods-.patch | 192 ++++++++++++++++++ ...st-11236-from-Nymphium-missing-since.patch | 43 ++++ ...preprocessor-conditional-on-_MSC_VER.patch | 26 +++ 0004-Changes.patch | 28 +++ ...more-instances-of-undefined-_MSC_VER.patch | 93 +++++++++ ...> 0006-Don-t-add-rpaths-to-libraries.patch | 8 +- ...-Allow-user-defined-C-compiler-flags.patch | 10 +- ...-incorrect-assumption-about-cross-co.patch | 12 +- ...nly-use-OC_-for-building-executables.patch | 10 +- ocaml.spec | 28 ++- sources | 2 +- 11 files changed, 422 insertions(+), 30 deletions(-) create mode 100644 0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch create mode 100644 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch create mode 100644 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch create mode 100644 0004-Changes.patch create mode 100644 0005-Guard-more-instances-of-undefined-_MSC_VER.patch rename 0001-Don-t-add-rpaths-to-libraries.patch => 0006-Don-t-add-rpaths-to-libraries.patch (80%) rename 0002-configure-Allow-user-defined-C-compiler-flags.patch => 0007-configure-Allow-user-defined-C-compiler-flags.patch (72%) rename 0003-configure-Remove-incorrect-assumption-about-cross-co.patch => 0008-configure-Remove-incorrect-assumption-about-cross-co.patch (86%) rename 0004-configure-Only-use-OC_-for-building-executables.patch => 0009-configure-Only-use-OC_-for-building-executables.patch (80%) diff --git a/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch b/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch new file mode 100644 index 0000000..d89a4ac --- /dev/null +++ b/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch @@ -0,0 +1,192 @@ +From 3f6a90f1ac47c480522a009d6ea56e2acfb7112f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= +Date: Wed, 27 Apr 2022 14:46:47 +0200 +Subject: [PATCH 1/9] Do not trigger warning when calling virtual methods + introduced by constraining "self" (#11204) + +(cherry picked from commit 1e7af3f6261502bb384dc9e23a74ad0990bfd854) +--- + Changes | 11 ++++++- + testsuite/tests/typing-objects/Tests.ml | 15 ++++++++++ + typing/typeclass.ml | 40 ++++++++++--------------- + 3 files changed, 40 insertions(+), 26 deletions(-) + +diff --git a/Changes b/Changes +index a8ce94bdc6..931a74b8d1 100644 +--- a/Changes ++++ b/Changes +@@ -1,3 +1,13 @@ ++OCaml 4.14 maintenance branch ++----------------------------- ++ ++### Bug fixes: ++ ++- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when ++ calling virtual methods introduced by constraining the self type from within ++ the class definition. ++ (Nicolás Ojeda Bär, review by Leo White) ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +@@ -62,7 +72,6 @@ OCaml 4.14.0 (28 March 2022) + definition-aware operations. + (Ulysse Gérard, Thomas Refis and Leo White, review by Florian Angeletti) + +- + ### Language features: + + - #10462: Add attribute to produce a compiler error for polls. +diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml +index f617bcf1b9..3dcd87c43c 100644 +--- a/testsuite/tests/typing-objects/Tests.ml ++++ b/testsuite/tests/typing-objects/Tests.ml +@@ -955,6 +955,21 @@ Warning 17 [undeclared-virtual-method]: the virtual method m is not declared. + class c : object method m : int method n : int end + |}];; + ++class virtual c = object (self : 'c) ++ constraint 'c = < f : int; .. > ++end ++[%%expect {| ++class virtual c : object method virtual f : int end ++|}];; ++ ++class virtual c = object (self : 'c) ++ constraint 'c = < f : int; .. > ++ method g = self # f ++end ++[%%expect {| ++class virtual c : object method virtual f : int method g : int end ++|}];; ++ + class [ 'a ] c = object (_ : 'a) end;; + let o = object + method m = 1 +diff --git a/typing/typeclass.ml b/typing/typeclass.ml +index 048ee998b0..fedbc0e025 100644 +--- a/typing/typeclass.ml ++++ b/typing/typeclass.ml +@@ -552,12 +552,11 @@ type first_pass_accummulater = + concrete_vals : VarSet.t; + local_meths : MethSet.t; + local_vals : VarSet.t; +- vars : Ident.t Vars.t; +- meths : Ident.t Meths.t; } ++ vars : Ident.t Vars.t; } + + let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = + let { rev_fields; val_env; par_env; concrete_meths; concrete_vals; +- local_meths; local_vals; vars; meths } = acc ++ local_meths; local_vals; vars } = acc + in + let loc = cf.pcf_loc in + let attributes = cf.pcf_attributes in +@@ -612,13 +611,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = + (val_env, par_env, inherited_vars, vars)) + parent_sign.csig_vars (val_env, par_env, [], vars) + in +- let meths = +- Meths.fold +- (fun label _ meths -> +- if Meths.mem label meths then meths +- else Meths.add label (Ident.create_local label) meths) +- parent_sign.csig_meths meths +- in + (* Methods available through super *) + let super_meths = + MethSet.fold +@@ -641,7 +633,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = + in + let rev_fields = field :: rev_fields in + { acc with rev_fields; val_env; par_env; +- concrete_meths; concrete_vals; vars; meths }) ++ concrete_meths; concrete_vals; vars }) + | Pcf_val (label, mut, Cfk_virtual styp) -> + with_attrs + (fun () -> +@@ -723,15 +715,11 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = + let cty = transl_simple_type val_env false sty in + let ty = cty.ctyp_type in + add_method loc val_env label.txt priv Virtual ty sign; +- let meths = +- if Meths.mem label.txt meths then meths +- else Meths.add label.txt (Ident.create_local label.txt) meths +- in + let field = + Virtual_method { label; priv; cty; loc; attributes } + in + let rev_fields = field :: rev_fields in +- { acc with rev_fields; meths }) ++ { acc with rev_fields }) + + | Pcf_method (label, priv, Cfk_concrete (override, expr)) -> + with_attrs +@@ -785,10 +773,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = + raise(Error(loc, val_env, + Field_type_mismatch ("method", label.txt, err))) + end; +- let meths = +- if Meths.mem label.txt meths then meths +- else Meths.add label.txt (Ident.create_local label.txt) meths +- in + let sdefinition = make_method self_loc cl_num expr in + let warning_state = Warnings.backup () in + let field = +@@ -799,7 +783,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = + let rev_fields = field :: rev_fields in + let concrete_meths = MethSet.add label.txt concrete_meths in + let local_meths = MethSet.add label.txt local_meths in +- { acc with rev_fields; concrete_meths; local_meths; meths }) ++ { acc with rev_fields; concrete_meths; local_meths }) + + | Pcf_constraint (sty1, sty2) -> + with_attrs +@@ -837,11 +821,10 @@ and class_fields_first_pass self_loc cl_num sign self_scope + let local_meths = MethSet.empty in + let local_vals = VarSet.empty in + let vars = Vars.empty in +- let meths = Meths.empty in + let init_acc = + { rev_fields; val_env; par_env; + concrete_meths; concrete_vals; +- local_meths; local_vals; vars; meths } ++ local_meths; local_vals; vars } + in + let acc = + Builtin_attributes.warning_scope [] +@@ -850,7 +833,7 @@ and class_fields_first_pass self_loc cl_num sign self_scope + (class_field_first_pass self_loc cl_num sign self_scope) + init_acc cfs) + in +- List.rev acc.rev_fields, acc.vars, acc.meths ++ List.rev acc.rev_fields, acc.vars + + and class_field_second_pass cl_num sign met_env field = + let mkcf desc loc attrs = +@@ -1003,7 +986,7 @@ and class_structure cl_num virt self_scope final val_env met_env loc + end; + + (* Typing of class fields *) +- let (fields, vars, meths) = ++ let (fields, vars) = + class_fields_first_pass self_loc cl_num sign self_scope + val_env par_env str + in +@@ -1016,6 +999,13 @@ and class_structure cl_num virt self_scope final val_env met_env loc + update_class_signature loc val_env + ~warn_implicit_public:false virt kind sign; + ++ let meths = ++ Meths.fold ++ (fun label _ meths -> ++ Meths.add label (Ident.create_local label) meths) ++ sign.csig_meths Meths.empty ++ in ++ + (* Close the signature if it is final *) + begin match final with + | Not_final -> () +-- +2.36.1 + diff --git a/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch b/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch new file mode 100644 index 0000000..3e043a5 --- /dev/null +++ b/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch @@ -0,0 +1,43 @@ +From 538cb5217642b36a8eab1ae027767c344e880b4b Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Thu, 5 May 2022 20:01:44 +0100 +Subject: [PATCH 2/9] Merge pull request #11236 from Nymphium/missing-since2 + +Add missing @since annotation to Gc.eventlog_pause + +(cherry picked from commit 77fee6035c25d8a31084dc556ee634e46bb39164) +--- + stdlib/gc.mli | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/stdlib/gc.mli b/stdlib/gc.mli +index b211197fd4..8031eeb8df 100644 +--- a/stdlib/gc.mli ++++ b/stdlib/gc.mli +@@ -442,7 +442,10 @@ external eventlog_pause : unit -> unit = "caml_eventlog_pause" + Traces are collected if the program is linked to the instrumented runtime + and started with the environment variable OCAML_EVENTLOG_ENABLED. + Events are flushed to disk after pausing, and no new events will be +- recorded until [eventlog_resume] is called. *) ++ recorded until [eventlog_resume] is called. ++ ++ @since 4.11 ++ *) + + external eventlog_resume : unit -> unit = "caml_eventlog_resume" + (** [eventlog_resume ()] will resume the collection of traces in the +@@ -451,7 +454,10 @@ external eventlog_resume : unit -> unit = "caml_eventlog_resume" + and started with the environment variable OCAML_EVENTLOG_ENABLED. + This call can be used after calling [eventlog_pause], or if the program + was started with OCAML_EVENTLOG_ENABLED=p. (which pauses the collection of +- traces before the first event.) *) ++ traces before the first event.) ++ ++ @since 4.11 ++ *) + + + (** [Memprof] is a sampling engine for allocated memory words. Every +-- +2.36.1 + diff --git a/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch b/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch new file mode 100644 index 0000000..2484e29 --- /dev/null +++ b/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch @@ -0,0 +1,26 @@ +From c06ca224780f005b625ef406a817ead3eb9a8665 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= +Date: Tue, 17 May 2022 10:21:34 +0200 +Subject: [PATCH 3/9] misc.h: fix preprocessor conditional on _MSC_VER + +(cherry picked from commit 253d605e10865371aed45967a94caed0642b7583) +--- + runtime/caml/misc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h +index 5915c30a7b..494d45e8f8 100644 +--- a/runtime/caml/misc.h ++++ b/runtime/caml/misc.h +@@ -35,7 +35,7 @@ + /* Supported since at least GCC 3.1 */ + #define CAMLdeprecated_typedef(name, type) \ + typedef type name __attribute ((deprecated)) +-#elif _MSC_VER >= 1310 ++#elif defined(_MSC_VER) && _MSC_VER >= 1310 + /* NB deprecated("message") only supported from _MSC_VER >= 1400 */ + #define CAMLdeprecated_typedef(name, type) \ + typedef __declspec(deprecated) type name +-- +2.36.1 + diff --git a/0004-Changes.patch b/0004-Changes.patch new file mode 100644 index 0000000..fa96bd5 --- /dev/null +++ b/0004-Changes.patch @@ -0,0 +1,28 @@ +From bfb9a2157c50c1b4a9cb8dc0319fe375b5e80b1d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= +Date: Tue, 17 May 2022 14:45:26 +0200 +Subject: [PATCH 4/9] Changes + +(cherry picked from commit 9a157026f115364635f8fe0ae5805e15ef071de0) +--- + Changes | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Changes b/Changes +index 931a74b8d1..fdfffd78bb 100644 +--- a/Changes ++++ b/Changes +@@ -8,6 +8,10 @@ OCaml 4.14 maintenance branch + the class definition. + (Nicolás Ojeda Bär, review by Leo White) + ++- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This ++ could break the build of the compiler on non-gcc non-clang Unix builds. ++ (Nicolás Ojeda Bär, review by Sebastien Hinderer) ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +-- +2.36.1 + diff --git a/0005-Guard-more-instances-of-undefined-_MSC_VER.patch b/0005-Guard-more-instances-of-undefined-_MSC_VER.patch new file mode 100644 index 0000000..da39f67 --- /dev/null +++ b/0005-Guard-more-instances-of-undefined-_MSC_VER.patch @@ -0,0 +1,93 @@ +From 53ce1f582e37faabfd616a0b09521497e2e7ef14 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 18 May 2022 12:48:33 +0100 +Subject: [PATCH 5/9] Guard more instances of undefined _MSC_VER + +--- + Changes | 8 +++++--- + runtime/caml/memory.h | 2 +- + runtime/caml/misc.h | 12 +++++++----- + 3 files changed, 13 insertions(+), 9 deletions(-) + +diff --git a/Changes b/Changes +index fdfffd78bb..590268262d 100644 +--- a/Changes ++++ b/Changes +@@ -8,9 +8,11 @@ OCaml 4.14 maintenance branch + the class definition. + (Nicolás Ojeda Bär, review by Leo White) + +-- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This +- could break the build of the compiler on non-gcc non-clang Unix builds. +- (Nicolás Ojeda Bär, review by Sebastien Hinderer) ++- #11263, #11267: caml/{memory,misc}.h: check whether `_MSC_VER` is defined ++ before using it to ensure that the headers can always be used in code which ++ turns on -Wundef (or equivalent). ++ (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and ++ Sebastien Hinderer) + + OCaml 4.14.0 (28 March 2022) + ---------------------------- +diff --git a/runtime/caml/memory.h b/runtime/caml/memory.h +index 1e9cdf6d9b..d9e58bc2d0 100644 +--- a/runtime/caml/memory.h ++++ b/runtime/caml/memory.h +@@ -329,7 +329,7 @@ struct caml__roots_block { + #define CAMLunused_start __attribute__ ((unused)) + #define CAMLunused_end + #define CAMLunused __attribute__ ((unused)) +-#elif _MSC_VER >= 1500 ++#elif defined(_MSC_VER) && _MSC_VER >= 1500 + #define CAMLunused_start __pragma( warning (push) ) \ + __pragma( warning (disable:4189 ) ) + #define CAMLunused_end __pragma( warning (pop)) +diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h +index 494d45e8f8..c605f8711e 100644 +--- a/runtime/caml/misc.h ++++ b/runtime/caml/misc.h +@@ -43,7 +43,8 @@ + #define CAMLdeprecated_typedef(name, type) typedef type name + #endif + +-#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L || _MSC_VER >= 1925 ++#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L \ ++ || defined(_MSC_VER) && _MSC_VER >= 1925 + + #define CAML_STRINGIFY(x) #x + #ifdef _MSC_VER +@@ -90,7 +91,7 @@ CAMLdeprecated_typedef(addr, char *); + #define CAMLnoreturn_start + #define CAMLnoreturn_end __attribute__ ((noreturn)) + #define Noreturn __attribute__ ((noreturn)) +-#elif _MSC_VER >= 1500 ++#elif defined(_MSC_VER) && _MSC_VER >= 1500 + #define CAMLnoreturn_start __declspec(noreturn) + #define CAMLnoreturn_end + #define Noreturn +@@ -138,11 +139,12 @@ CAMLdeprecated_typedef(addr, char *); + /* we need to be able to compute the exact offset of each member. */ + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define CAMLalign(n) _Alignas(n) +-#elif defined(__cplusplus) && (__cplusplus >= 201103L || _MSC_VER >= 1900) ++#elif defined(__cplusplus) \ ++ && (__cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER >= 1900) + #define CAMLalign(n) alignas(n) + #elif defined(SUPPORTS_ALIGNED_ATTRIBUTE) + #define CAMLalign(n) __attribute__((aligned(n))) +-#elif _MSC_VER >= 1500 ++#elif defined(_MSC_VER) && _MSC_VER >= 1500 + #define CAMLalign(n) __declspec(align(n)) + #else + #error "How do I align values on this platform?" +@@ -170,7 +172,7 @@ CAMLdeprecated_typedef(addr, char *); + #define CAMLunused_start __attribute__ ((unused)) + #define CAMLunused_end + #define CAMLunused __attribute__ ((unused)) +-#elif _MSC_VER >= 1500 ++#elif defined(_MSC_VER) && _MSC_VER >= 1500 + #define CAMLunused_start __pragma( warning (push) ) \ + __pragma( warning (disable:4189 ) ) + #define CAMLunused_end __pragma( warning (pop)) +-- +2.36.1 + diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0006-Don-t-add-rpaths-to-libraries.patch similarity index 80% rename from 0001-Don-t-add-rpaths-to-libraries.patch rename to 0006-Don-t-add-rpaths-to-libraries.patch index eb6794d..e776416 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0006-Don-t-add-rpaths-to-libraries.patch @@ -1,14 +1,14 @@ -From 23f2e84d360208759c7d82b7ff795770ce6cf0b2 Mon Sep 17 00:00:00 2001 +From fc7eb8e75bee1b8bf12dcbb7787781169b260558 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/4] Don't add rpaths to libraries. +Subject: [PATCH 6/9] Don't add rpaths to libraries. --- utils/config.mlp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/config.mlp b/utils/config.mlp -index bbb3c5694..57d509cd0 100644 +index 44c6ff8fa5..a12c31a2bd 100644 --- a/utils/config.mlp +++ b/utils/config.mlp @@ -55,8 +55,8 @@ let native_c_compiler = @@ -23,5 +23,5 @@ index bbb3c5694..57d509cd0 100644 let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%% let mkdll, mkexe, mkmaindll = -- -2.32.0 +2.36.1 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0007-configure-Allow-user-defined-C-compiler-flags.patch similarity index 72% rename from 0002-configure-Allow-user-defined-C-compiler-flags.patch rename to 0007-configure-Allow-user-defined-C-compiler-flags.patch index 389f09b..77a031b 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0007-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,17 +1,17 @@ -From 9966786a7389dc6621f2bc2dce7c690c5a38b67d Mon Sep 17 00:00:00 2001 +From b91178cc8fdf657933c26d54a0c67fd69eb67427 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. +Subject: [PATCH 7/9] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index 3698c7cbf..e2a3cbea0 100644 +index 2f4ebf9b30..5ccfe8fb01 100644 --- a/configure.ac +++ b/configure.ac -@@ -669,6 +669,10 @@ AS_CASE([$host], +@@ -690,6 +690,10 @@ AS_CASE([$host], internal_cflags="$cc_warnings"], [common_cflags="-O"])]) @@ -23,5 +23,5 @@ index 3698c7cbf..e2a3cbea0 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. -- -2.32.0 +2.36.1 diff --git a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch b/0008-configure-Remove-incorrect-assumption-about-cross-co.patch similarity index 86% rename from 0003-configure-Remove-incorrect-assumption-about-cross-co.patch rename to 0008-configure-Remove-incorrect-assumption-about-cross-co.patch index e101809..3536a98 100644 --- a/0003-configure-Remove-incorrect-assumption-about-cross-co.patch +++ b/0008-configure-Remove-incorrect-assumption-about-cross-co.patch @@ -1,7 +1,7 @@ -From 5eff09224929f8fa1a2e19f9a15befd3a4a395ea Mon Sep 17 00:00:00 2001 +From 41d5e2db7a4667560d6aedda11a3c6a80c8f1b83 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 26 Apr 2019 16:16:29 +0100 -Subject: [PATCH 3/4] configure: Remove incorrect assumption about +Subject: [PATCH 8/9] configure: Remove incorrect assumption about cross-compiling. See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 @@ -14,10 +14,10 @@ sh: line 1: x86_64-pc-linux-gnu-as: command not found 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac -index e2a3cbea0..07c005f09 100644 +index 5ccfe8fb01..c763310acb 100644 --- a/configure.ac +++ b/configure.ac -@@ -560,10 +560,11 @@ AS_IF( +@@ -578,10 +578,11 @@ AS_IF( # Are we building a cross-compiler @@ -33,7 +33,7 @@ index e2a3cbea0..07c005f09 100644 # Checks for programs -@@ -1186,17 +1187,17 @@ AS_CASE([$arch], +@@ -1212,17 +1213,17 @@ AS_CASE([$arch], # Assembler @@ -63,5 +63,5 @@ index e2a3cbea0..07c005f09 100644 # Finding the assembler # The OCaml build system distinguishes two different assemblers: -- -2.32.0 +2.36.1 diff --git a/0004-configure-Only-use-OC_-for-building-executables.patch b/0009-configure-Only-use-OC_-for-building-executables.patch similarity index 80% rename from 0004-configure-Only-use-OC_-for-building-executables.patch rename to 0009-configure-Only-use-OC_-for-building-executables.patch index 1f21b0f..8432e41 100644 --- a/0004-configure-Only-use-OC_-for-building-executables.patch +++ b/0009-configure-Only-use-OC_-for-building-executables.patch @@ -1,7 +1,7 @@ -From acb5dbaa8f8ece825a48814024404a1a6c5ba7b2 Mon Sep 17 00:00:00 2001 +From 05b882737e0daecb86a6ef54e192508c60efcd88 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 26 Jan 2022 15:47:02 +0000 -Subject: [PATCH 4/4] configure: Only use OC_* for building executables +Subject: [PATCH 9/9] configure: Only use OC_* for building executables Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for "package notes" which contains build paths. @@ -14,10 +14,10 @@ ocamlopt uses. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 07c005f09..19fe3fd1b 100644 +index c763310acb..9cce5ea47a 100644 --- a/configure.ac +++ b/configure.ac -@@ -43,7 +43,7 @@ libraries_man_section=3 +@@ -37,7 +37,7 @@ CONFIGURE_ARGS="$*" # at the moment they are not taken into account on Windows, because # flexlink, which is used to build executables on this platform, can # not handle them. @@ -27,5 +27,5 @@ index 07c005f09..19fe3fd1b 100644 # Flags for building executable files with debugging symbols mkexedebugflag="-g" -- -2.32.0 +2.36.1 diff --git a/ocaml.spec b/ocaml.spec index 8728970..7b348b6 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -33,8 +33,8 @@ %global rcver %{nil} Name: ocaml -Version: 4.13.1 -Release: 4%{?dist} +Version: 4.14.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -53,16 +53,23 @@ Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{vers # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-36-4.13.1 +# Current branch: fedora-37-4.14.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should # be incorporated into the git repo at a later time. -Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch -Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch -Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch -Patch0004: 0004-configure-Only-use-OC_-for-building-executables.patch +# Patches added after 4.14.0 was released +Patch0001: 0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch +Patch0002: 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch +Patch0003: 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch +Patch0004: 0004-Changes.patch +Patch0005: 0005-Guard-more-instances-of-undefined-_MSC_VER.patch +# Fedora-specific patches +Patch0006: 0006-Don-t-add-rpaths-to-libraries.patch +Patch0007: 0007-configure-Allow-user-defined-C-compiler-flags.patch +Patch0008: 0008-configure-Remove-incorrect-assumption-about-cross-co.patch +Patch0009: 0009-configure-Only-use-OC_-for-building-executables.patch BuildRequires: make BuildRequires: git @@ -228,7 +235,8 @@ perl -pi -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release -find $RPM_BUILD_ROOT -name .ignore -delete +# Remove the installed documentation. We will install it using %%doc +rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml # Remove this file. It's only created in certain situations and it's # unclear why it is created at all. @@ -291,7 +299,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_libdir}/ocaml/camlheader %{_libdir}/ocaml/camlheader_ur %{_libdir}/ocaml/expunge -%{_libdir}/ocaml/extract_crc %{_libdir}/ocaml/ld.conf %{_libdir}/ocaml/Makefile.config %{_libdir}/ocaml/*.a @@ -371,6 +378,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Sat Jun 18 2022 Richard W.M. Jones - 4.14.0-1 +- New upstream version 4.14.0 + * Thu Jun 9 2022 Jerry James - 4.13.1-4 - Fix the Source0 URL - chrpath is no longer needed diff --git a/sources b/sources index ee936bc..6de827b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-4.13.1.tar.gz) = da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 +SHA512 (ocaml-4.14.0.tar.gz) = 3c5e5b9f00bb109dd99b5f7b0078cf8663d4247e548f3e601d6b2a55582e04bb20f6de85005c4cf2f78ae9aaa449f5ca6f2bab2f6ce83eeb3aeb386e3f2fcc32 From 38e7f9a43c4b921acc0967ebb85c5a566a94aeb3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 01:04:51 +0000 Subject: [PATCH 13/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 7b348b6..d538213 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -34,7 +34,7 @@ Name: ocaml Version: 4.14.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -378,6 +378,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 4.14.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sat Jun 18 2022 Richard W.M. Jones - 4.14.0-1 - New upstream version 4.14.0 From 6fbb4db452cad948a903b0124d1c75f6b06a6833 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 5 Sep 2022 16:21:34 +0100 Subject: [PATCH 14/54] Include more upstream patches from 4.14 branch Don't use %configure macro because that breaks on riscv64. https://bugzilla.redhat.com/2124272 --- ...arning-when-calling-virtual-methods-.patch | 6 +- ...st-11236-from-Nymphium-missing-since.patch | 6 +- ...preprocessor-conditional-on-_MSC_VER.patch | 6 +- 0004-Changes.patch | 6 +- ...more-instances-of-undefined-_MSC_VER.patch | 6 +- ...entation-for-string_of_float-.-11353.patch | 95 +++++ ...st-11380-from-damiendoligez-fix-fort.patch | 30 ++ ...tialization-of-bytecode-threading-11.patch | 101 ++++++ ...-incorrect-assumption-about-cross-co.patch | 67 ---- ...st-11397-from-Octachron-tast_mapper_.patch | 49 +++ ...l-request-11396-from-gasche-fix11392.patch | 85 +++++ ...t-limitation-on-caml_callbackN-11409.patch | 53 +++ ...lib-on-created-installed-libraries-1.patch | 327 ++++++++++++++++++ ...ay-2-has-gfortran.sh-don-t-print-any.patch | 27 ++ ...st-11417-from-lpw25-fix-virtual-clas.patch | 147 ++++++++ ...-whole-module-type-error-message-114.patch | 154 +++++++++ ...est-11373-from-dra27-flexlink-detect.patch | 57 +++ ...est-11468-from-dra27-i686-mingw-ipv6.patch | 55 +++ ...llocation-of-alternate-signal-stack-.patch | 194 +++++++++++ ...st-11487-from-purplearmadillo77-fma_.patch | 54 +++ 0020-Fixup-Changes.patch | 36 ++ ...utable-which-couldn-t-be-triggered.-.patch | 90 +++++ ...> 0022-Don-t-add-rpaths-to-libraries.patch | 12 +- ...-Allow-user-defined-C-compiler-flags.patch | 10 +- ...nly-use-OC_-for-building-executables.patch | 8 +- ocaml.spec | 51 ++- 26 files changed, 1622 insertions(+), 110 deletions(-) create mode 100644 0006-Better-documentation-for-string_of_float-.-11353.patch create mode 100644 0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch create mode 100644 0008-Refactor-the-initialization-of-bytecode-threading-11.patch delete mode 100644 0008-configure-Remove-incorrect-assumption-about-cross-co.patch create mode 100644 0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch create mode 100644 0010-Merge-pull-request-11396-from-gasche-fix11392.patch create mode 100644 0011-Document-limitation-on-caml_callbackN-11409.patch create mode 100644 0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch create mode 100644 0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch create mode 100644 0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch create mode 100644 0015-Do-not-elide-the-whole-module-type-error-message-114.patch create mode 100644 0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch create mode 100644 0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch create mode 100644 0018-More-prudent-deallocation-of-alternate-signal-stack-.patch create mode 100644 0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch create mode 100644 0020-Fixup-Changes.patch create mode 100644 0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch rename 0006-Don-t-add-rpaths-to-libraries.patch => 0022-Don-t-add-rpaths-to-libraries.patch (69%) rename 0007-configure-Allow-user-defined-C-compiler-flags.patch => 0023-configure-Allow-user-defined-C-compiler-flags.patch (71%) rename 0009-configure-Only-use-OC_-for-building-executables.patch => 0024-configure-Only-use-OC_-for-building-executables.patch (83%) diff --git a/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch b/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch index d89a4ac..166e69a 100644 --- a/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch +++ b/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch @@ -1,7 +1,7 @@ -From 3f6a90f1ac47c480522a009d6ea56e2acfb7112f Mon Sep 17 00:00:00 2001 +From 2912ed4fde14e34b58c482cb81fb88676ab3ffc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Wed, 27 Apr 2022 14:46:47 +0200 -Subject: [PATCH 1/9] Do not trigger warning when calling virtual methods +Subject: [PATCH 01/24] Do not trigger warning when calling virtual methods introduced by constraining "self" (#11204) (cherry picked from commit 1e7af3f6261502bb384dc9e23a74ad0990bfd854) @@ -188,5 +188,5 @@ index 048ee998b0..fedbc0e025 100644 begin match final with | Not_final -> () -- -2.36.1 +2.37.0.rc2 diff --git a/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch b/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch index 3e043a5..9c75989 100644 --- a/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch +++ b/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch @@ -1,7 +1,7 @@ -From 538cb5217642b36a8eab1ae027767c344e880b4b Mon Sep 17 00:00:00 2001 +From 623258a6517c8ec1d9e5f41cbdc05205a0e6ee1d Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 5 May 2022 20:01:44 +0100 -Subject: [PATCH 2/9] Merge pull request #11236 from Nymphium/missing-since2 +Subject: [PATCH 02/24] Merge pull request #11236 from Nymphium/missing-since2 Add missing @since annotation to Gc.eventlog_pause @@ -39,5 +39,5 @@ index b211197fd4..8031eeb8df 100644 (** [Memprof] is a sampling engine for allocated memory words. Every -- -2.36.1 +2.37.0.rc2 diff --git a/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch b/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch index 2484e29..3854e05 100644 --- a/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch +++ b/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch @@ -1,7 +1,7 @@ -From c06ca224780f005b625ef406a817ead3eb9a8665 Mon Sep 17 00:00:00 2001 +From d497565758b5c80d8a7bf4cad02e5a4558ae6b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Tue, 17 May 2022 10:21:34 +0200 -Subject: [PATCH 3/9] misc.h: fix preprocessor conditional on _MSC_VER +Subject: [PATCH 03/24] misc.h: fix preprocessor conditional on _MSC_VER (cherry picked from commit 253d605e10865371aed45967a94caed0642b7583) --- @@ -22,5 +22,5 @@ index 5915c30a7b..494d45e8f8 100644 #define CAMLdeprecated_typedef(name, type) \ typedef __declspec(deprecated) type name -- -2.36.1 +2.37.0.rc2 diff --git a/0004-Changes.patch b/0004-Changes.patch index fa96bd5..214e89e 100644 --- a/0004-Changes.patch +++ b/0004-Changes.patch @@ -1,7 +1,7 @@ -From bfb9a2157c50c1b4a9cb8dc0319fe375b5e80b1d Mon Sep 17 00:00:00 2001 +From d2b9da6f7aff410e8a1499637ae88aaf0a135c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Tue, 17 May 2022 14:45:26 +0200 -Subject: [PATCH 4/9] Changes +Subject: [PATCH 04/24] Changes (cherry picked from commit 9a157026f115364635f8fe0ae5805e15ef071de0) --- @@ -24,5 +24,5 @@ index 931a74b8d1..fdfffd78bb 100644 ---------------------------- -- -2.36.1 +2.37.0.rc2 diff --git a/0005-Guard-more-instances-of-undefined-_MSC_VER.patch b/0005-Guard-more-instances-of-undefined-_MSC_VER.patch index da39f67..d9f81d7 100644 --- a/0005-Guard-more-instances-of-undefined-_MSC_VER.patch +++ b/0005-Guard-more-instances-of-undefined-_MSC_VER.patch @@ -1,7 +1,7 @@ -From 53ce1f582e37faabfd616a0b09521497e2e7ef14 Mon Sep 17 00:00:00 2001 +From 513164232d897c39c4e571a7a8f167dee5c146b3 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 18 May 2022 12:48:33 +0100 -Subject: [PATCH 5/9] Guard more instances of undefined _MSC_VER +Subject: [PATCH 05/24] Guard more instances of undefined _MSC_VER --- Changes | 8 +++++--- @@ -89,5 +89,5 @@ index 494d45e8f8..c605f8711e 100644 __pragma( warning (disable:4189 ) ) #define CAMLunused_end __pragma( warning (pop)) -- -2.36.1 +2.37.0.rc2 diff --git a/0006-Better-documentation-for-string_of_float-.-11353.patch b/0006-Better-documentation-for-string_of_float-.-11353.patch new file mode 100644 index 0000000..935a992 --- /dev/null +++ b/0006-Better-documentation-for-string_of_float-.-11353.patch @@ -0,0 +1,95 @@ +From fa904a7d3c89c2ad18a426017aeda5bb0d7dd8bd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Pottier?= + +Date: Fri, 24 Jun 2022 16:37:13 +0200 +Subject: [PATCH 06/24] Better documentation for [string_of_float]. (#11353) + +Better documentation for [string_of_float] (and [Float.to_string]) +with similar warnings for [print_float] and [prerr_float] in a similar way. + +(cherry picked from commit 40113fbc73930b41a7a2df468de18c94feeefdf5) +--- + stdlib/float.mli | 7 ++++++- + stdlib/stdlib.mli | 15 ++++++++++++--- + stdlib/templates/float.template.mli | 7 ++++++- + 3 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/stdlib/float.mli b/stdlib/float.mli +index ba84d9b0e2..93d2f3016d 100644 +--- a/stdlib/float.mli ++++ b/stdlib/float.mli +@@ -178,7 +178,12 @@ val of_string_opt: string -> float option + (** Same as [of_string], but returns [None] instead of raising. *) + + val to_string : float -> string +-(** Return the string representation of a floating-point number. *) ++(** Return a string representation of a floating-point number. ++ ++ This conversion can involve a loss of precision. For greater control over ++ the manner in which the number is printed, see {!Printf}. ++ ++ This function is an alias for {!Stdlib.string_of_float}. *) + + type fpclass = Stdlib.fpclass = + FP_normal (** Normal number, none of the below *) +diff --git a/stdlib/stdlib.mli b/stdlib/stdlib.mli +index 237adfbdd8..0eaee2716e 100644 +--- a/stdlib/stdlib.mli ++++ b/stdlib/stdlib.mli +@@ -776,7 +776,10 @@ external int_of_string : string -> int = "caml_int_of_string" + [Failure "int_of_string"] instead of returning [None]. *) + + val string_of_float : float -> string +-(** Return the string representation of a floating-point number. *) ++(** Return a string representation of a floating-point number. ++ ++ This conversion can involve a loss of precision. For greater control over ++ the manner in which the number is printed, see {!Printf}. *) + + val float_of_string_opt: string -> float option + (** Convert the given string to a float. The string is read in decimal +@@ -861,7 +864,10 @@ val print_int : int -> unit + (** Print an integer, in decimal, on standard output. *) + + val print_float : float -> unit +-(** Print a floating-point number, in decimal, on standard output. *) ++(** Print a floating-point number, in decimal, on standard output. ++ ++ The conversion of the number to a string uses {!string_of_float} and ++ can involve a loss of precision. *) + + val print_endline : string -> unit + (** Print a string, followed by a newline character, on +@@ -889,7 +895,10 @@ val prerr_int : int -> unit + (** Print an integer, in decimal, on standard error. *) + + val prerr_float : float -> unit +-(** Print a floating-point number, in decimal, on standard error. *) ++(** Print a floating-point number, in decimal, on standard error. ++ ++ The conversion of the number to a string uses {!string_of_float} and ++ can involve a loss of precision. *) + + val prerr_endline : string -> unit + (** Print a string, followed by a newline character on standard +diff --git a/stdlib/templates/float.template.mli b/stdlib/templates/float.template.mli +index e35c01809f..e2f7411a02 100644 +--- a/stdlib/templates/float.template.mli ++++ b/stdlib/templates/float.template.mli +@@ -178,7 +178,12 @@ val of_string_opt: string -> float option + (** Same as [of_string], but returns [None] instead of raising. *) + + val to_string : float -> string +-(** Return the string representation of a floating-point number. *) ++(** Return a string representation of a floating-point number. ++ ++ This conversion can involve a loss of precision. For greater control over ++ the manner in which the number is printed, see {!Printf}. ++ ++ This function is an alias for {!Stdlib.string_of_float}. *) + + type fpclass = Stdlib.fpclass = + FP_normal (** Normal number, none of the below *) +-- +2.37.0.rc2 + diff --git a/0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch b/0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch new file mode 100644 index 0000000..b57c6ba --- /dev/null +++ b/0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch @@ -0,0 +1,30 @@ +From 05874f93adc60f16ccd5cbeef1e2ff010cef12c1 Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Fri, 1 Jul 2022 14:41:25 +0200 +Subject: [PATCH 07/24] Merge pull request #11380 from + damiendoligez/fix-fortran-test-on-macos + +fix gfortran test on Macos + +(cherry picked from commit d7a2e0fa7f2df9bd178109ba9725bb074affbd5c) +--- + testsuite/tests/lib-bigarray-2/has-gfortran.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh +index 82f7ae8aee..051122113a 100644 +--- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh ++++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh +@@ -5,6 +5,9 @@ if ! which gfortran > /dev/null 2>&1; then + elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then + echo "OCaml was not compiled with gcc" > ${ocamltest_response} + test_result=${TEST_SKIP} ++elif gcc --version 2>&1 | grep 'Apple clang version'; then ++ echo "OCaml was not compiled with gcc" > ${ocamltest_response} ++ test_result=${TEST_SKIP} + else + test_result=${TEST_PASS} + fi +-- +2.37.0.rc2 + diff --git a/0008-Refactor-the-initialization-of-bytecode-threading-11.patch b/0008-Refactor-the-initialization-of-bytecode-threading-11.patch new file mode 100644 index 0000000..d6b3510 --- /dev/null +++ b/0008-Refactor-the-initialization-of-bytecode-threading-11.patch @@ -0,0 +1,101 @@ +From b9afeb8b8dc8c32f9f1c74c8402de9e6265e9d5f Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 1 Jul 2022 17:14:44 +0200 +Subject: [PATCH 08/24] Refactor the initialization of bytecode threading + (#11378) + +Refactor the initialization of bytecode threading + +Use a function `caml_init_thread_code` instead of exposing global variables +`caml_instr_table` and `caml_instr_base`. + +This should silence the GCC 12 "dangling-pointer" warning. + +Fixes: #11358 +--- + Changes | 5 +++++ + runtime/caml/fix_code.h | 3 +-- + runtime/fix_code.c | 10 ++++++++-- + runtime/interp.c | 7 +++---- + 4 files changed, 17 insertions(+), 8 deletions(-) + +diff --git a/Changes b/Changes +index 590268262d..7ea4475b8d 100644 +--- a/Changes ++++ b/Changes +@@ -14,6 +14,11 @@ OCaml 4.14 maintenance branch + (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and + Sebastien Hinderer) + ++- #11358, #11378: Refactor the initialization of bytecode threading. ++ This avoids a "dangling pointer" warning of GCC 12.1. ++ (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) ++ ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +diff --git a/runtime/caml/fix_code.h b/runtime/caml/fix_code.h +index 83c393a17d..2eafaa814b 100644 +--- a/runtime/caml/fix_code.h ++++ b/runtime/caml/fix_code.h +@@ -34,8 +34,7 @@ void caml_set_instruction (code_t pos, opcode_t instr); + int caml_is_instruction (opcode_t instr1, opcode_t instr2); + + #ifdef THREADED_CODE +-extern char ** caml_instr_table; +-extern char * caml_instr_base; ++void caml_init_thread_code(void ** instr_table, void * instr_base); + void caml_thread_code (code_t code, asize_t len); + #endif + +diff --git a/runtime/fix_code.c b/runtime/fix_code.c +index aa059be5df..5584019867 100644 +--- a/runtime/fix_code.c ++++ b/runtime/fix_code.c +@@ -82,8 +82,14 @@ void caml_fixup_endianness(code_t code, asize_t len) + + #ifdef THREADED_CODE + +-char ** caml_instr_table; +-char * caml_instr_base; ++static char ** caml_instr_table; ++static char * caml_instr_base; ++ ++void caml_init_thread_code(void ** instr_table, void * instr_base) ++{ ++ caml_instr_table = (char **) instr_table; ++ caml_instr_base = (char *) instr_base; ++} + + static int* opcode_nargs = NULL; + int* caml_init_opcode_nargs(void) +diff --git a/runtime/interp.c b/runtime/interp.c +index a59811c87d..e6700994bc 100644 +--- a/runtime/interp.c ++++ b/runtime/interp.c +@@ -50,9 +50,9 @@ sp is a local copy of the global variable Caml_state->extern_sp. */ + #ifdef THREADED_CODE + # define Instruct(name) lbl_##name + # if defined(ARCH_SIXTYFOUR) && !defined(ARCH_CODE32) +-# define Jumptbl_base ((char *) &&lbl_ACC0) ++# define Jumptbl_base &&lbl_ACC0 + # else +-# define Jumptbl_base ((char *) 0) ++# define Jumptbl_base 0 + # define jumptbl_base ((char *) 0) + # endif + # ifdef DEBUG +@@ -249,8 +249,7 @@ value caml_interprete(code_t prog, asize_t prog_size) + + if (prog == NULL) { /* Interpreter is initializing */ + #ifdef THREADED_CODE +- caml_instr_table = (char **) jumptable; +- caml_instr_base = Jumptbl_base; ++ caml_init_thread_code(jumptable, Jumptbl_base); + #endif + return Val_unit; + } +-- +2.37.0.rc2 + diff --git a/0008-configure-Remove-incorrect-assumption-about-cross-co.patch b/0008-configure-Remove-incorrect-assumption-about-cross-co.patch deleted file mode 100644 index 3536a98..0000000 --- a/0008-configure-Remove-incorrect-assumption-about-cross-co.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 41d5e2db7a4667560d6aedda11a3c6a80c8f1b83 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 26 Apr 2019 16:16:29 +0100 -Subject: [PATCH 8/9] configure: Remove incorrect assumption about - cross-compiling. - -See https://github.com/ocaml/ocaml/issues/8647#issuecomment-487094390 - -The error seen without this patch is: - -sh: line 1: x86_64-pc-linux-gnu-as: command not found ---- - configure.ac | 31 ++++++++++++++++--------------- - 1 file changed, 16 insertions(+), 15 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 5ccfe8fb01..c763310acb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -578,10 +578,11 @@ AS_IF( - - # Are we building a cross-compiler - --AS_IF( -- [test x"$host" = x"$target"], -- [cross_compiler=false], -- [cross_compiler=true]) -+#AS_IF( -+# [test x"$host" = x"$target"], -+# [cross_compiler=false], -+# [cross_compiler=true]) -+cross_compiler=false - - # Checks for programs - -@@ -1212,17 +1213,17 @@ AS_CASE([$arch], - - # Assembler - --AS_IF([test -n "$target_alias"], -- [toolpref="${target_alias}-" -- as_target="$target" -- as_cpu="$target_cpu"], -- [AS_IF([test -n "$host_alias"], -- [toolpref="${host_alias}-" -- as_target="$host" -- as_cpu="$host_cpu"], -- [toolpref="" -- as_target="$build" -- as_cpu="$build_cpu"])]) -+dnl AS_IF([test -n "$target_alias"], -+dnl [toolpref="${target_alias}-" -+dnl as_target="$target" -+dnl as_cpu="$target_cpu"], -+dnl [AS_IF([test -n "$host_alias"], -+dnl [toolpref="${host_alias}-" -+dnl as_target="$host" -+dnl as_cpu="$host_cpu"], -+dnl [toolpref="" -+dnl as_target="$build" -+dnl as_cpu="$build_cpu"])]) - - # Finding the assembler - # The OCaml build system distinguishes two different assemblers: --- -2.36.1 - diff --git a/0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch b/0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch new file mode 100644 index 0000000..7f1ef7e --- /dev/null +++ b/0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch @@ -0,0 +1,49 @@ +From 7315c73e283eca4313403e959241d86d63f88d58 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Tue, 5 Jul 2022 09:27:54 +0200 +Subject: [PATCH 09/24] Merge pull request #11397 from + Octachron/tast_mapper_fix_for_with_modtype + + #11387: clean up envs inside Twith_modtype(subst) + +(cherry picked from commit d9afa408c612e74a266b95f0fa25bb1efde72112) +--- + Changes | 3 +++ + typing/tast_mapper.ml | 6 +++--- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/Changes b/Changes +index 7ea4475b8d..0fe7732a02 100644 +--- a/Changes ++++ b/Changes +@@ -18,6 +18,9 @@ OCaml 4.14 maintenance branch + This avoids a "dangling pointer" warning of GCC 12.1. + (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) + ++- #11387, module type with constraints no longer crash the compiler in presence ++ of both shadowing warnings and the `-bin-annot` compiler flag. ++ (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer) + + OCaml 4.14.0 (28 March 2022) + ---------------------------- +diff --git a/typing/tast_mapper.ml b/typing/tast_mapper.ml +index 6d359a59a7..9eb7f64e88 100644 +--- a/typing/tast_mapper.ml ++++ b/typing/tast_mapper.ml +@@ -458,10 +458,10 @@ let module_type sub x = + let with_constraint sub = function + | Twith_type decl -> Twith_type (sub.type_declaration sub decl) + | Twith_typesubst decl -> Twith_typesubst (sub.type_declaration sub decl) ++ | Twith_modtype mty -> Twith_modtype (sub.module_type sub mty) ++ | Twith_modtypesubst mty -> Twith_modtypesubst (sub.module_type sub mty) + | Twith_module _ +- | Twith_modsubst _ +- | Twith_modtype _ +- | Twith_modtypesubst _ as d -> d ++ | Twith_modsubst _ as d -> d + + let open_description sub od = + {od with open_env = sub.env sub od.open_env} +-- +2.37.0.rc2 + diff --git a/0010-Merge-pull-request-11396-from-gasche-fix11392.patch b/0010-Merge-pull-request-11396-from-gasche-fix11392.patch new file mode 100644 index 0000000..0b9cbd6 --- /dev/null +++ b/0010-Merge-pull-request-11396-from-gasche-fix11392.patch @@ -0,0 +1,85 @@ +From 9f72a2a2fec0902aeae5e5082779bb197657c1f4 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Tue, 5 Jul 2022 10:38:50 +0200 +Subject: [PATCH 10/24] Merge pull request #11396 from gasche/fix11392 + +Fix 11392 (assertion failure on external with -rectypes) + +(cherry picked from commit 724cefb8b0f1f96ef5181fffc24975ac9460ce3e) +--- + Changes | 3 ++ + testsuite/tests/typing-external/pr11392.ml | 34 ++++++++++++++++++++++ + typing/typedecl.ml | 2 +- + 3 files changed, 38 insertions(+), 1 deletion(-) + create mode 100644 testsuite/tests/typing-external/pr11392.ml + +diff --git a/Changes b/Changes +index 0fe7732a02..8182f5ced7 100644 +--- a/Changes ++++ b/Changes +@@ -22,6 +22,9 @@ OCaml 4.14 maintenance branch + of both shadowing warnings and the `-bin-annot` compiler flag. + (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer) + ++- #11392, #11392: assertion failure with -rectypes and external definitions ++ (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +diff --git a/testsuite/tests/typing-external/pr11392.ml b/testsuite/tests/typing-external/pr11392.ml +new file mode 100644 +index 0000000000..91c8ea77eb +--- /dev/null ++++ b/testsuite/tests/typing-external/pr11392.ml +@@ -0,0 +1,34 @@ ++(* TEST ++ * expect ++*) ++ ++type 'self nat = ++ | Z ++ | S of 'self ++;; ++[%%expect{| ++type 'self nat = Z | S of 'self ++|}] ++ ++ ++ ++(* without rectypes: rejected *) ++external cast : int -> 'self nat as 'self = "%identity" ++;; ++[%%expect{| ++Line 1, characters 16-41: ++1 | external cast : int -> 'self nat as 'self = "%identity" ++ ^^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: This alias is bound to type int -> 'a nat ++ but is used as an instance of type 'a ++ The type variable 'a occurs inside int -> 'a nat ++|}] ++ ++#rectypes;; ++ ++(* with rectypes: accepted (used to crash) *) ++external cast : int -> 'self nat as 'self = "%identity" ++;; ++[%%expect{| ++external cast : int -> 'a nat as 'a = "%identity" ++|}] +diff --git a/typing/typedecl.ml b/typing/typedecl.ml +index 9d38ebe97e..d00c0fc450 100644 +--- a/typing/typedecl.ml ++++ b/typing/typedecl.ml +@@ -1334,7 +1334,7 @@ let rec parse_native_repr_attributes env core_type ty ~global_repr = + parse_native_repr_attributes env ct2 t2 ~global_repr + in + (repr_arg :: repr_args, repr_res) +- | Ptyp_poly (_, t), _, _ -> ++ | (Ptyp_poly (_, t) | Ptyp_alias (t, _)), _, _ -> + parse_native_repr_attributes env t ty ~global_repr + | Ptyp_arrow _, _, _ | _, Tarrow _, _ -> assert false + | _ -> ([], make_native_repr env core_type ty ~global_repr) +-- +2.37.0.rc2 + diff --git a/0011-Document-limitation-on-caml_callbackN-11409.patch b/0011-Document-limitation-on-caml_callbackN-11409.patch new file mode 100644 index 0000000..bf09575 --- /dev/null +++ b/0011-Document-limitation-on-caml_callbackN-11409.patch @@ -0,0 +1,53 @@ +From 9d4faca7af8d9849093ff8d36509ad60608ac239 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Thu, 7 Jul 2022 18:22:22 +0200 +Subject: [PATCH 11/24] Document limitation on `caml_callbackN` (#11409) + +The `args` argument array must not be declared with `CAMLlocalN`, otherwise +the array can be registered a second time by `caml_callbackN`, confusing +the compactor. + +Also: suggests using a C99 compound literal, it looks good and avoids the issue. + +Fixes: #11045 +--- + Changes | 7 +++++++ + manual/src/cmds/intf-c.etex | 4 ++++ + 2 files changed, 11 insertions(+) + +diff --git a/Changes b/Changes +index 8182f5ced7..13eb7fef98 100644 +--- a/Changes ++++ b/Changes +@@ -25,6 +25,13 @@ OCaml 4.14 maintenance branch + - #11392, #11392: assertion failure with -rectypes and external definitions + (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) + ++### Manual and documentation: ++ ++- #11045, #11409: document that the array argument to `caml_callbackN` ++ must not have been declared by `CAMLlocalN`. ++ (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.) ++ ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +diff --git a/manual/src/cmds/intf-c.etex b/manual/src/cmds/intf-c.etex +index 7cd50a1372..bb420c2940 100644 +--- a/manual/src/cmds/intf-c.etex ++++ b/manual/src/cmds/intf-c.etex +@@ -1449,6 +1449,10 @@ the value \var{a} and returns the value returned by~\var{f}. + (a curried OCaml function with three arguments) to \var{a}, \var{b} and \var{c}. + \item "caml_callbackN("\var{f, n, args}")" applies the functional value \var{f} + to the \var{n} arguments contained in the C array of values \var{args}. ++The array \var{args} must \emph{not} be declared with "CAMLlocalN". ++It should be declared as "value "\var{args}"["\var{n}"];". ++Alternatively, a C99 compound literal can be used: ++"caml_callbackN("\var{f, n, }"(value[]){"\nth{arg}{1}, \ldots, \nth{arg}{n}"})". + \end{itemize} + If the function \var{f} does not return, but raises an exception that + escapes the scope of the application, then this exception is +-- +2.37.0.rc2 + diff --git a/0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch b/0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch new file mode 100644 index 0000000..739914c --- /dev/null +++ b/0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch @@ -0,0 +1,327 @@ +From 50fbd6685ec88f1dc81451923d7c80fb0d18ca8b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= +Date: Thu, 14 Apr 2022 19:19:46 +0200 +Subject: [PATCH 12/24] Stop calling ranlib on created / installed libraries + (#11184) + +`ranlib` seems unnecessary if a POSIX-compliant `ar` is used and time stamps are preserved when a `.a` file is installed. + +(cherry picked from commit c8e41bade529998c4e66975c88fabf3ac47d7078) +--- + Changes | 5 +++++ + INSTALL.adoc | 4 ++-- + Makefile | 2 -- + Makefile.build_config.in | 2 +- + Makefile.config.in | 4 ---- + configure | Bin 581827 -> 581549 bytes + configure.ac | 16 +++------------- + otherlibs/Makefile.otherlibs.common | 2 -- + otherlibs/dynlink/Makefile | 11 +++++------ + otherlibs/systhreads/Makefile | 3 --- + stdlib/Makefile | 1 - + tools/ocamlmklib.ml | 6 ++---- + utils/Makefile | 1 - + utils/ccomp.ml | 8 ++------ + utils/config.mli | 3 --- + utils/config.mlp | 2 -- + 16 files changed, 20 insertions(+), 50 deletions(-) + +diff --git a/Changes b/Changes +index 13eb7fef98..6f92ee9965 100644 +--- a/Changes ++++ b/Changes +@@ -25,6 +25,11 @@ OCaml 4.14 maintenance branch + - #11392, #11392: assertion failure with -rectypes and external definitions + (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) + ++### Compiler user-interface and warnings: ++ ++- #11184: Stop calling ranlib on created / installed libraries ++ (Sébastien Hinderer, review by Xavier Leroy) ++ + ### Manual and documentation: + + - #11045, #11409: document that the array argument to `caml_callbackN` +diff --git a/INSTALL.adoc b/INSTALL.adoc +index f4199ca49a..08d67ebbbe 100644 +--- a/INSTALL.adoc ++++ b/INSTALL.adoc +@@ -43,8 +43,8 @@ + * Under Cygwin, the `gcc-core` package is required. `flexdll` is also necessary + for shared library support. + +-* Binutils including `ar`, `ranlib`, and `strip` are required if your +- distribution does not already provide them with the C compiler. ++* Binutils including `ar` and `strip` are required if your distribution ++ does not already provide them with the C compiler. + + == Configuration + +diff --git a/Makefile b/Makefile +index 3c74bc79df..0e92785da2 100644 +--- a/Makefile ++++ b/Makefile +@@ -585,8 +585,6 @@ endif + ifeq "$(INSTALL_OCAMLNAT)" "true" + $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)" + endif +- cd "$(INSTALL_COMPLIBDIR)" && \ +- $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A) + + # Installation of the *.ml sources of compiler-libs + .PHONY: install-compiler-sources +diff --git a/Makefile.build_config.in b/Makefile.build_config.in +index eeac09dd76..4d6705d252 100644 +--- a/Makefile.build_config.in ++++ b/Makefile.build_config.in +@@ -20,7 +20,7 @@ + # $(ROOTDIR) has been defined. + + include $(ROOTDIR)/Makefile.config +-INSTALL ?= @INSTALL@ ++INSTALL ?= @INSTALL@ -p + INSTALL_DATA ?= @INSTALL_DATA@ + INSTALL_PROG ?= @INSTALL_PROGRAM@ + +diff --git a/Makefile.config.in b/Makefile.config.in +index eb3d85eb1d..4badb74c3f 100644 +--- a/Makefile.config.in ++++ b/Makefile.config.in +@@ -88,10 +88,6 @@ LDFLAGS?=@LDFLAGS@ + ### How to invoke the C preprocessor through the C compiler + CPP=@CPP@ + +-### How to invoke ranlib +-RANLIB=@RANLIB@ +-RANLIBCMD=@RANLIBCMD@ +- + ### How to invoke ar + ARCMD=@AR@ + +diff --git a/configure b/configure +index 8a2c007fd221bc897a255b4aa80c7f23710fcb10..73ce66bfa0a3de5e886a88c973b2db288b5e4d03 100755 +GIT binary patch +delta 91 +zcmX?nP-EJyt==60{S#P(`nZ^plY(UJueamx2P^N?Ror2wRCOHK#ZgE(H{K3{og6RYK +zU>4b?CTHZsIKV)ezG4dNJs|}(H3gMwh?TVpF)A8{?X6Q;ftU@5*|)b&< + assert(String.length Config.ar > 0); +- let r1 = +- command(Printf.sprintf "%s rc %s %s" +- Config.ar quoted_archive (quote_files file_list)) in +- if r1 <> 0 || String.length Config.ranlib = 0 +- then r1 +- else command(Config.ranlib ^ " " ^ quoted_archive) ++ command(Printf.sprintf "%s rc %s %s" ++ Config.ar quoted_archive (quote_files file_list)) + + let expand_libname cclibs = + cclibs |> List.map (fun cclib -> +diff --git a/utils/config.mli b/utils/config.mli +index 7f70a52d52..94dee3cb92 100644 +--- a/utils/config.mli ++++ b/utils/config.mli +@@ -82,9 +82,6 @@ val mkexe: string + val mkmaindll: string + (** The linker command line to build main programs as dlls. *) + +-val ranlib: string +-(** Command to randomize a library, or "" if not needed *) +- + val default_rpath: string + (** Option to add a directory to be searched for libraries at runtime + (used by ocamlmklib) *) +diff --git a/utils/config.mlp b/utils/config.mlp +index 44c6ff8fa5..f758a9b483 100644 +--- a/utils/config.mlp ++++ b/utils/config.mlp +@@ -54,7 +54,6 @@ let native_c_compiler = + c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags + let native_c_libraries = "%%NATIVECCLIBS%%" + let native_pack_linker = "%%PACKLD%%" +-let ranlib = "%%RANLIBCMD%%" + let default_rpath = "%%RPATH%%" + let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%" + let ar = "%%ARCMD%%" +@@ -177,7 +176,6 @@ let configuration_variables = + p "bytecomp_c_libraries" bytecomp_c_libraries; + p "native_c_libraries" native_c_libraries; + p "native_pack_linker" native_pack_linker; +- p "ranlib" ranlib; + p "architecture" architecture; + p "model" model; + p_int "int_size" Sys.int_size; +-- +2.37.0.rc2 + diff --git a/0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch b/0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch new file mode 100644 index 0000000..7d5b111 --- /dev/null +++ b/0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch @@ -0,0 +1,27 @@ +From c04f2fbb3ae4dc8f67882bfe35d8565f016dee0f Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Fri, 15 Jul 2022 14:23:10 +0200 +Subject: [PATCH 13/24] tests/lib-bigarray-2/has-gfortran.sh: don't print + anything on stdout + +It confuses the summarize.awk script. +--- + testsuite/tests/lib-bigarray-2/has-gfortran.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh +index 051122113a..7eef1e662e 100644 +--- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh ++++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh +@@ -5,7 +5,7 @@ if ! which gfortran > /dev/null 2>&1; then + elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then + echo "OCaml was not compiled with gcc" > ${ocamltest_response} + test_result=${TEST_SKIP} +-elif gcc --version 2>&1 | grep 'Apple clang version'; then ++elif gcc --version 2>&1 | grep -q 'Apple clang version'; then + echo "OCaml was not compiled with gcc" > ${ocamltest_response} + test_result=${TEST_SKIP} + else +-- +2.37.0.rc2 + diff --git a/0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch b/0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch new file mode 100644 index 0000000..5a53fad --- /dev/null +++ b/0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch @@ -0,0 +1,147 @@ +From 4bb84be29e2ea5eb9f979c5e3bcbde1933aa300e Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Mon, 18 Jul 2022 10:08:53 +0200 +Subject: [PATCH 14/24] Merge pull request #11417 from + lpw25/fix-virtual-class-type-constrs + +Fix regression allowing virtual methods in non-virtual classes + +(cherry picked from commit 4be851ed8ea1f0c6be13dce04dcc97493c6c004b) +--- + Changes | 13 +----- + testsuite/tests/typing-objects/Tests.ml | 61 +++++++++++++++++++++++++ + typing/typeclass.ml | 11 +++++ + 3 files changed, 74 insertions(+), 11 deletions(-) + +diff --git a/Changes b/Changes +index 6f92ee9965..a9a9ee92f4 100644 +--- a/Changes ++++ b/Changes +@@ -25,17 +25,8 @@ OCaml 4.14 maintenance branch + - #11392, #11392: assertion failure with -rectypes and external definitions + (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) + +-### Compiler user-interface and warnings: +- +-- #11184: Stop calling ranlib on created / installed libraries +- (Sébastien Hinderer, review by Xavier Leroy) +- +-### Manual and documentation: +- +-- #11045, #11409: document that the array argument to `caml_callbackN` +- must not have been declared by `CAMLlocalN`. +- (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.) +- ++- #11417: Fix regression allowing virtual methods in non-virtual classes. ++ (Leo White, review by Florian Angeletti) + + OCaml 4.14.0 (28 March 2022) + ---------------------------- +diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml +index 3dcd87c43c..9cab28e432 100644 +--- a/testsuite/tests/typing-objects/Tests.ml ++++ b/testsuite/tests/typing-objects/Tests.ml +@@ -1344,3 +1344,64 @@ let _ = (new foo)#f true + class foo : object method f : bool -> bool end + - : bool = true + |}];; ++ ++ ++class c : object ++ method virtual m : int ++end = object ++ method m = 9 ++ end ++[%%expect {| ++Lines 1-3, characters 10-3: ++1 | ..........object ++2 | method virtual m : int ++3 | end......... ++Error: This non-virtual class type has virtual methods. ++ The following methods are virtual : m ++|}];; ++ ++class virtual c : object ++ method virtual m : int ++end = object ++ method m = 42 ++ end ++[%%expect {| ++class virtual c : object method virtual m : int end ++|}];; ++ ++class virtual cv = object ++ method virtual m : int ++ end ++ ++class c : cv = object ++ method m = 42 ++ end ++[%%expect {| ++class virtual cv : object method virtual m : int end ++Line 5, characters 10-12: ++5 | class c : cv = object ++ ^^ ++Error: This non-virtual class type has virtual methods. ++ The following methods are virtual : m ++|}];; ++ ++class virtual c : cv = object ++ method m = 41 ++ end ++[%%expect {| ++class virtual c : cv ++|}];; ++ ++class c = cv ++[%%expect {| ++Line 1, characters 10-12: ++1 | class c = cv ++ ^^ ++Error: This non-virtual class has virtual methods. ++ The following methods are virtual : m ++|}];; ++ ++class virtual c = cv ++[%%expect {| ++class virtual c : cv ++|}];; +diff --git a/typing/typeclass.ml b/typing/typeclass.ml +index fedbc0e025..8fa8523cc9 100644 +--- a/typing/typeclass.ml ++++ b/typing/typeclass.ml +@@ -177,6 +177,13 @@ let check_virtual loc env virt kind sign = + | meths, vars -> + raise(Error(loc, env, Virtual_class(kind, meths, vars))) + ++let rec check_virtual_clty loc env virt kind clty = ++ match clty with ++ | Cty_constr(_, _, clty) | Cty_arrow(_, _, clty) -> ++ check_virtual_clty loc env virt kind clty ++ | Cty_signature sign -> ++ check_virtual loc env virt kind sign ++ + (* Return the constructor type associated to a class type *) + let rec constructor_type constr cty = + match cty with +@@ -398,6 +405,8 @@ and class_type_aux env virt self_scope scty = + ) styl params + in + let typ = Cty_constr (path, params, clty) in ++ (* Check for unexpected virtual methods *) ++ check_virtual_clty scty.pcty_loc env virt Class_type typ; + cltyp (Tcty_constr ( path, lid , ctys)) typ + + | Pcty_signature pcsig -> +@@ -1077,6 +1086,8 @@ and class_expr_aux cl_num val_env met_env virt self_scope scl = + try Ctype.unify val_env ty' ty with Ctype.Unify err -> + raise(Error(cty'.ctyp_loc, val_env, Parameter_mismatch err))) + tyl params; ++ (* Check for unexpected virtual methods *) ++ check_virtual_clty scl.pcl_loc val_env virt Class clty'; + let cl = + rc {cl_desc = Tcl_ident (path, lid, tyl); + cl_loc = scl.pcl_loc; +-- +2.37.0.rc2 + diff --git a/0015-Do-not-elide-the-whole-module-type-error-message-114.patch b/0015-Do-not-elide-the-whole-module-type-error-message-114.patch new file mode 100644 index 0000000..2922112 --- /dev/null +++ b/0015-Do-not-elide-the-whole-module-type-error-message-114.patch @@ -0,0 +1,154 @@ +From 54eef17aeecfdbc6eeecd60b9cc64cd7c0129429 Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Wed, 20 Jul 2022 10:58:18 +0200 +Subject: [PATCH 15/24] Do not elide the whole module type error message + (#11416) + +(cherry picked from commit 8218be9e2b24907b8558776a34d12032bcc42496) +--- + Changes | 5 +- + .../inclusion_errors_elision.ml | 93 +++++++++++++++++++ + typing/includemod_errorprinter.ml | 11 ++- + 3 files changed, 107 insertions(+), 2 deletions(-) + create mode 100644 testsuite/tests/typing-modules/inclusion_errors_elision.ml + +diff --git a/Changes b/Changes +index a9a9ee92f4..6b9855f707 100644 +--- a/Changes ++++ b/Changes +@@ -14,7 +14,10 @@ OCaml 4.14 maintenance branch + (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and + Sebastien Hinderer) + +-- #11358, #11378: Refactor the initialization of bytecode threading. ++- #11314, #11416: fix non-informative error message for module inclusion ++ (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer) ++ ++- #11358, #11379: Refactor the initialization of bytecode threading, + This avoids a "dangling pointer" warning of GCC 12.1. + (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) + +diff --git a/testsuite/tests/typing-modules/inclusion_errors_elision.ml b/testsuite/tests/typing-modules/inclusion_errors_elision.ml +new file mode 100644 +index 0000000000..3dbd0e67ff +--- /dev/null ++++ b/testsuite/tests/typing-modules/inclusion_errors_elision.ml +@@ -0,0 +1,93 @@ ++(* TEST ++ flags ="-keep-original-error-size" ++ * expect ++ *) ++ ++ ++module A = struct ++ type a and b and c and d ++end ++ ++module type S = sig ++ module B = A ++end ++ ++module C : S = struct ++ module B = struct ++ type a and b and c and d and e and f and g and h ++ end ++end ++[%%expect {| ++module A : sig type a and b and c and d end ++module type S = sig module B = A end ++Lines 9-13, characters 15-3: ++ 9 | ...............struct ++10 | module B = struct ++11 | type a and b and c and d and e and f and g and h ++12 | end ++13 | end ++Error: Signature mismatch: ++ ... ++ In module B: ++ Modules do not match: ++ sig ++ type a = B.a ++ and b = B.b ++ and c = B.c ++ and d = B.d ++ and e = B.e ++ and f = B.f ++ and g = B.g ++ and h = B.h ++ end ++ is not included in ++ (module A) ++|}] ++ ++module A = struct ++ type a and b and c and d ++end ++ ++module type S = sig ++ module type B = sig ++ module C = A ++ end ++end ++ ++module D : S = struct ++ module type B = sig ++ module C: sig ++ type a and b and c and d and e and f and g and h ++ end ++ end ++end ++[%%expect{| ++module A : sig type a and b and c and d end ++module type S = sig module type B = sig module C = A end end ++Lines 11-17, characters 15-3: ++11 | ...............struct ++12 | module type B = sig ++13 | module C: sig ++14 | type a and b and c and d and e and f and g and h ++15 | end ++16 | end ++17 | end ++Error: Signature mismatch: ++ ... ++ ... ++ ... ++ At position module type B = sig module C : end ++ Modules do not match: ++ sig ++ type a = C.a ++ and b = C.b ++ and c = C.c ++ and d = C.d ++ and e = C.e ++ and f = C.f ++ and g = C.g ++ and h = C.h ++ end ++ is not included in ++ (module A) ++|}] +diff --git a/typing/includemod_errorprinter.ml b/typing/includemod_errorprinter.ml +index 24d452fddc..b719e1627d 100644 +--- a/typing/includemod_errorprinter.ml ++++ b/typing/includemod_errorprinter.ml +@@ -709,7 +709,16 @@ let rec module_type ~expansion_token ~eqmode ~env ~before ~ctx diff = + functor_params ~expansion_token ~env ~before ~ctx d + | _ -> + let inner = if eqmode then eq_module_types else module_types in +- let next = dwith_context_and_elision ctx inner diff in ++ let next = ++ match diff.symptom with ++ | Mt_core _ -> ++ (* In those cases, the refined error messages for the current error ++ will at most add some minor comments on the current error. ++ It is thus better to avoid eliding the current error message. ++ *) ++ dwith_context ctx (inner diff) ++ | _ -> dwith_context_and_elision ctx inner diff ++ in + let before = next :: before in + module_type_symptom ~eqmode ~expansion_token ~env ~before ~ctx + diff.symptom +-- +2.37.0.rc2 + diff --git a/0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch b/0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch new file mode 100644 index 0000000..059fc99 --- /dev/null +++ b/0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch @@ -0,0 +1,57 @@ +From 4d316cbe4b564be3aa57b969acf9ba03910dcba4 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Sat, 30 Jul 2022 11:51:12 +0200 +Subject: [PATCH 16/24] Merge pull request #11373 from dra27/flexlink-detect + +Don't use CFLAGS when testing flexlink + +(cherry picked from commit 004d313ce4fdb071d0aeda8736b9e74bb6c6a21b) +--- + Changes | 6 ++++++ + aclocal.m4 | 1 + + configure | Bin 581549 -> 581563 bytes + 3 files changed, 7 insertions(+) + +diff --git a/Changes b/Changes +index 6b9855f707..99907b950a 100644 +--- a/Changes ++++ b/Changes +@@ -1,6 +1,12 @@ + OCaml 4.14 maintenance branch + ----------------------------- + ++### Build system: ++ ++- #11370, #11373: Don't pass CFLAGS to flexlink during configure. ++ (David Allsopp, report by William Hu, review by Xavier Leroy and ++ Sébastien Hinderer) ++ + ### Bug fixes: + + - #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when +diff --git a/aclocal.m4 b/aclocal.m4 +index 7e49468e48..2bc0a1dcc9 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -328,6 +328,7 @@ AC_DEFUN([OCAML_TEST_FLEXLINK], [ + CC="$1 -chain $2 -exe" + LIBS="conftest2.$ac_objext" + CPPFLAGS="$3 $CPPFLAGS" ++ CFLAGS="" + AC_LINK_IFELSE( + [AC_LANG_SOURCE([int main() { return 0; }])], + [AC_MSG_RESULT([yes])], +diff --git a/configure b/configure +index 73ce66bfa0a3de5e886a88c973b2db288b5e4d03..c0dde03f183f86677b22a81238defdba60ad0080 100755 +GIT binary patch +delta 57 +zcmZ3xUwQX_<%Sl<7N!>F7M3lnkFIk%yZJb}2iqzsO&46x?lIl3ot?8??*=OnvjH*t +KcD)-M_3Qv?gA|zn + +delta 47 +zcmdnJUwQ3*<%Sl<7N!>F7M3lnkFHM-Tg~P?U2ZNbN4xb6Rv=~rV)pIUH#i#D0n)${ +AvH$=8 + +-- +2.37.0.rc2 + diff --git a/0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch b/0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch new file mode 100644 index 0000000..433fda9 --- /dev/null +++ b/0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch @@ -0,0 +1,55 @@ +From defecc867a0b5653554c41b06e78c0f24f6c10a8 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Tue, 2 Aug 2022 17:21:08 +0100 +Subject: [PATCH 17/24] Merge pull request #11468 from dra27/i686-mingw-ipv6 + +Fix detection of IPv6 on mingw-w64 i686 + +(cherry picked from commit 98392895940cc1c18534280ae001b70fa5bf24c2) +--- + Changes | 4 ++++ + configure | Bin 581563 -> 581611 bytes + configure.ac | 1 + + 3 files changed, 5 insertions(+) + +diff --git a/Changes b/Changes +index 99907b950a..6b537edca9 100644 +--- a/Changes ++++ b/Changes +@@ -37,6 +37,10 @@ OCaml 4.14 maintenance branch + - #11417: Fix regression allowing virtual methods in non-virtual classes. + (Leo White, review by Florian Angeletti) + ++- #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for ++ mingw-w64 i686 port. ++ (David Allsopp, review by Xavier Leroy and Sébastien Hinderer) ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +diff --git a/configure b/configure +index c0dde03f183f86677b22a81238defdba60ad0080..536a1cbee58a430692bfa3de11901e7e2f6b4ee2 100755 +GIT binary patch +delta 53 +zcmdnJU-|WZ<%Sl<7N!>F7M2#)7Pc+y(YK}x+-47$p3}xEG`-+2o7nVsH`#OBfnwVQ +JZgZ?=0RTku6-595 + +delta 53 +zcmV-50LuUCzazW9BY=bfgaU*Egam{Iga)(+TiTa!+Xo<*Y=#9AmvH?C7MJeX2fc@o +L+XuIh+X!0(RZ +Date: Mon, 22 Aug 2022 16:06:50 +0200 +Subject: [PATCH 18/24] More prudent deallocation of alternate signal stack + (#11496) + +After `caml_setup_stack_overflow_detection` is called, +a C library can install its own alternate stack for signal handling. + +Therefore, `caml_stop_stack_overflow_detection` must not free the +alternate signal stack block, only the block that +`caml_setup_stack_overflow_detection` allocated. + +Fixes: #11489 +--- + Changes | 4 +++ + otherlibs/systhreads/st_stubs.c | 5 ++-- + runtime/caml/signals.h | 4 +-- + runtime/signals_byt.c | 4 +-- + runtime/signals_nat.c | 47 +++++++++++++++++++++------------ + 5 files changed, 41 insertions(+), 23 deletions(-) + +diff --git a/Changes b/Changes +index 6b537edca9..4d1bb10435 100644 +--- a/Changes ++++ b/Changes +@@ -41,6 +41,10 @@ OCaml 4.14 maintenance branch + mingw-w64 i686 port. + (David Allsopp, review by Xavier Leroy and Sébastien Hinderer) + ++- #11489, #11496: More prudent deallocation of alternate signal stack ++ (Xavier Leroy, report by @rajdakin, review by Florian Angeletti) ++ ++ + OCaml 4.14.0 (28 March 2022) + ---------------------------- + +diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c +index b7a6a9a6bb..043e07031e 100644 +--- a/otherlibs/systhreads/st_stubs.c ++++ b/otherlibs/systhreads/st_stubs.c +@@ -524,6 +524,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg) + { + caml_thread_t th = (caml_thread_t) arg; + value clos; ++ void * signal_stack; + #ifdef NATIVE_CODE + struct longjmp_buffer termination_buf; + char tos; +@@ -536,7 +537,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg) + /* Acquire the global mutex */ + caml_leave_blocking_section(); + st_thread_set_id(Ident(th->descr)); +- caml_setup_stack_overflow_detection(); ++ signal_stack = caml_setup_stack_overflow_detection(); + #ifdef NATIVE_CODE + /* Setup termination handler (for caml_thread_exit) */ + if (sigsetjmp(termination_buf.buf, 0) == 0) { +@@ -550,7 +551,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg) + #ifdef NATIVE_CODE + } + #endif +- caml_stop_stack_overflow_detection(); ++ caml_stop_stack_overflow_detection(signal_stack); + /* The thread now stops running */ + return 0; + } +diff --git a/runtime/caml/signals.h b/runtime/caml/signals.h +index c6aeebfc78..62b0e7fafa 100644 +--- a/runtime/caml/signals.h ++++ b/runtime/caml/signals.h +@@ -87,8 +87,8 @@ 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 int caml_setup_stack_overflow_detection(void); +-CAMLextern int caml_stop_stack_overflow_detection(void); ++CAMLextern void * caml_setup_stack_overflow_detection(void); ++CAMLextern int caml_stop_stack_overflow_detection(void *); + CAMLextern void caml_init_signals(void); + CAMLextern void caml_terminate_signals(void); + CAMLextern void (*caml_enter_blocking_section_hook)(void); +diff --git a/runtime/signals_byt.c b/runtime/signals_byt.c +index 439fb56404..7cb461ac4d 100644 +--- a/runtime/signals_byt.c ++++ b/runtime/signals_byt.c +@@ -81,7 +81,7 @@ int caml_set_signal_action(int signo, int action) + return 0; + } + +-CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; } +-CAMLexport int caml_stop_stack_overflow_detection(void) { return 0; } ++CAMLexport void * caml_setup_stack_overflow_detection(void) { return NULL; } ++CAMLexport int caml_stop_stack_overflow_detection(void * p) { return 0; } + CAMLexport void caml_init_signals(void) { } + CAMLexport void caml_terminate_signals(void) { } +diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c +index 443f5d53b6..1dd8289c12 100644 +--- a/runtime/signals_nat.c ++++ b/runtime/signals_nat.c +@@ -254,6 +254,10 @@ DECLARE_SIGNAL_HANDLER(segv_handler) + + /* Initialization of signal stuff */ + ++#ifdef HAS_STACK_OVERFLOW_DETECTION ++static void * caml_signal_stack = NULL; ++#endif ++ + void caml_init_signals(void) + { + /* Bound-check trap handling */ +@@ -278,7 +282,8 @@ void caml_init_signals(void) + #endif + + #ifdef HAS_STACK_OVERFLOW_DETECTION +- if (caml_setup_stack_overflow_detection() != -1) { ++ caml_signal_stack = caml_setup_stack_overflow_detection(); ++ if (caml_signal_stack != NULL) { + struct sigaction act; + SET_SIGACT(act, segv_handler); + act.sa_flags |= SA_ONSTACK | SA_NODEFER; +@@ -314,7 +319,8 @@ void caml_terminate_signals(void) + + #ifdef HAS_STACK_OVERFLOW_DETECTION + set_signal_default(SIGSEGV); +- caml_stop_stack_overflow_detection(); ++ caml_stop_stack_overflow_detection(caml_signal_stack); ++ caml_signal_stack = NULL; + #endif + } + +@@ -323,37 +329,44 @@ void caml_terminate_signals(void) + 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). */ ++ may not be a compile-time constant (issue #10250). ++ Return the dynamically-allocated alternate signal stack, or NULL ++ if an error occurred. ++ The returned pointer must be passed to [caml_stop_stack_overflow_detection]. ++*/ + +-CAMLexport int caml_setup_stack_overflow_detection(void) ++CAMLexport void * 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_sp = malloc(stk.ss_size); ++ if (stk.ss_sp == NULL) return NULL; + stk.ss_flags = 0; + if (sigaltstack(&stk, NULL) == -1) { + free(stk.ss_sp); +- return -1; ++ return NULL; + } ++ return stk.ss_sp; ++#else ++ return NULL; + #endif +- /* Success (or stack overflow detection not available) */ +- return 0; + } + +-CAMLexport int caml_stop_stack_overflow_detection(void) ++CAMLexport int caml_stop_stack_overflow_detection(void * signal_stack) + { + #ifdef HAS_STACK_OVERFLOW_DETECTION + stack_t oldstk, stk; + stk.ss_flags = SS_DISABLE; ++ stk.ss_sp = NULL; /* not required but avoids a valgrind false alarm */ ++ stk.ss_size = SIGSTKSZ; /* macOS wants a valid size here */ + if (sigaltstack(&stk, &oldstk) == -1) return -1; +- /* If caml_setup_stack_overflow_detection 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); +- return 0; +-#else +- return 0; ++ /* Check whether someone else installed their own signal stack */ ++ if (!(oldstk.ss_flags & SS_DISABLE) && oldstk.ss_sp != signal_stack) { ++ /* Re-activate their signal stack. */ ++ sigaltstack(&oldstk, NULL); ++ } ++ free(signal_stack); + #endif ++ return 0; + } +-- +2.37.0.rc2 + diff --git a/0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch b/0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch new file mode 100644 index 0000000..67376f4 --- /dev/null +++ b/0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch @@ -0,0 +1,54 @@ +From a4633757e352b30f136d2a1cda827289d826ddc0 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Thu, 25 Aug 2022 08:44:47 +0100 +Subject: [PATCH 19/24] Merge pull request #11487 from + purplearmadillo77/fma_test + +Thwart FMA test optimization during configure + +(cherry picked from commit cd7dc7f6b9b5353acc2aa70bdc7bbecff56634d0) +--- + Changes | 3 +++ + aclocal.m4 | 2 +- + configure | Bin 581611 -> 581620 bytes + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Changes b/Changes +index 4d1bb10435..763c0fa4b7 100644 +--- a/Changes ++++ b/Changes +@@ -7,6 +7,9 @@ OCaml 4.14 maintenance branch + (David Allsopp, report by William Hu, review by Xavier Leroy and + Sébastien Hinderer) + ++- #11???: Thwart FMA test optimization during configure ++ (William Hu, review by ???) ++ + ### Bug fixes: + + - #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when +diff --git a/aclocal.m4 b/aclocal.m4 +index 2bc0a1dcc9..addb0d8bbf 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -440,7 +440,7 @@ int main (void) { + broken implementations of Cygwin64, mingw-w64 (x86_64) and VS2013-2017. + The static volatile variables aim to thwart GCC's constant folding. */ + static volatile double x, y, z; +- double t264, t265, t266; ++ volatile double t264, t265, t266; + x = 0x3.bd5b7dde5fddap-496; + y = 0x3.bd5b7dde5fddap-496; + z = -0xd.fc352bc352bap-992; +diff --git a/configure b/configure +index 536a1cbee58a430692bfa3de11901e7e2f6b4ee2..1a1dd61863e0435952ba6d6baf8131e68f070b3d 100755 +GIT binary patch +delta 44 +zcmaF8U-`>^<%Sl<7N!>F7M2#)Eo_r#a+KxgB$j06q_$6*$p*yi+b7NBh;#!0qIVJx + +delta 35 +qcmeyeU-|WZ<%Sl<7N!>F7M2#)Eo_r#w$GW#2E^>!=gj1Ya037qBM!s> + +-- +2.37.0.rc2 + diff --git a/0020-Fixup-Changes.patch b/0020-Fixup-Changes.patch new file mode 100644 index 0000000..1301d95 --- /dev/null +++ b/0020-Fixup-Changes.patch @@ -0,0 +1,36 @@ +From 19f5ef04dc344a82a3831f4b16f0be75c813dbf6 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Thu, 25 Aug 2022 08:48:34 +0100 +Subject: [PATCH 20/24] Fixup Changes + +--- + Changes | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Changes b/Changes +index 763c0fa4b7..92d0837eb6 100644 +--- a/Changes ++++ b/Changes +@@ -7,8 +7,8 @@ OCaml 4.14 maintenance branch + (David Allsopp, report by William Hu, review by Xavier Leroy and + Sébastien Hinderer) + +-- #11???: Thwart FMA test optimization during configure +- (William Hu, review by ???) ++- #11487: Thwart FMA test optimization during configure ++ (William Hu, review by David Allsopp and Sébastien Hinderer) + + ### Bug fixes: + +@@ -21,7 +21,7 @@ OCaml 4.14 maintenance branch + before using it to ensure that the headers can always be used in code which + turns on -Wundef (or equivalent). + (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and +- Sebastien Hinderer) ++ Sébastien Hinderer) + + - #11314, #11416: fix non-informative error message for module inclusion + (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer) +-- +2.37.0.rc2 + diff --git a/0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch b/0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch new file mode 100644 index 0000000..913074d --- /dev/null +++ b/0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch @@ -0,0 +1,90 @@ +From e6dfa704c0f7847fe8e7a2a153714b4075019a0f Mon Sep 17 00:00:00 2001 +From: Chris Casinghino +Date: Fri, 2 Sep 2022 10:28:55 -0400 +Subject: [PATCH 21/24] Fix [@deprecated_mutable], which couldn't be triggered. + (#11524) + +Fixes #11516 + +(cherry picked from commit 024ca164ab844a9be94e0675bb5a1693bab7c08f) +--- + Changes | 2 ++ + .../warnings/deprecated_mutable.compilers.reference | 4 ++++ + testsuite/tests/warnings/deprecated_mutable.ml | 13 +++++++++++++ + typing/env.ml | 9 ++++++++- + 4 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 testsuite/tests/warnings/deprecated_mutable.compilers.reference + create mode 100644 testsuite/tests/warnings/deprecated_mutable.ml + +diff --git a/Changes b/Changes +index 92d0837eb6..aa8880ad07 100644 +--- a/Changes ++++ b/Changes +@@ -47,6 +47,8 @@ OCaml 4.14 maintenance branch + - #11489, #11496: More prudent deallocation of alternate signal stack + (Xavier Leroy, report by @rajdakin, review by Florian Angeletti) + ++- #11516, #11524: Fix the `deprecated_mutable` attribute. ++ (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti) + + OCaml 4.14.0 (28 March 2022) + ---------------------------- +diff --git a/testsuite/tests/warnings/deprecated_mutable.compilers.reference b/testsuite/tests/warnings/deprecated_mutable.compilers.reference +new file mode 100644 +index 0000000000..620dc57de9 +--- /dev/null ++++ b/testsuite/tests/warnings/deprecated_mutable.compilers.reference +@@ -0,0 +1,4 @@ ++File "deprecated_mutable.ml", line 13, characters 11-12: ++13 | let () = y.x <- 42 ++ ^ ++Alert deprecated: mutating field x +diff --git a/testsuite/tests/warnings/deprecated_mutable.ml b/testsuite/tests/warnings/deprecated_mutable.ml +new file mode 100644 +index 0000000000..78fb12ac41 +--- /dev/null ++++ b/testsuite/tests/warnings/deprecated_mutable.ml +@@ -0,0 +1,13 @@ ++(* TEST ++ ++flags = "-w +A-70" ++ ++* bytecode ++ ++*) ++ ++type t = {mutable x : int [@deprecated_mutable]} ++ ++let y : t = {x = 5} ++ ++let () = y.x <- 42 +diff --git a/typing/env.ml b/typing/env.ml +index 06b99f4159..29d7cdb0e4 100644 +--- a/typing/env.ml ++++ b/typing/env.ml +@@ -104,6 +104,10 @@ let add_label_usage lu usage = + lu.lu_mutation <- true; + lu.lu_construct <- true + ++let is_mutating_label_usage = function ++ | Mutation -> true ++ | (Projection | Construct | Exported_private | Exported) -> false ++ + let label_usages () = + {lu_projection = false; lu_mutation = false; lu_construct = false} + +@@ -2723,7 +2727,10 @@ let use_cltype ~use ~loc path desc = + let use_label ~use ~loc usage env lbl = + if use then begin + mark_label_description_used usage env lbl; +- Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name ++ Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name; ++ if is_mutating_label_usage usage then ++ Builtin_attributes.check_deprecated_mutable loc lbl.lbl_attributes ++ lbl.lbl_name + end + + let use_constructor_desc ~use ~loc usage env cstr = +-- +2.37.0.rc2 + diff --git a/0006-Don-t-add-rpaths-to-libraries.patch b/0022-Don-t-add-rpaths-to-libraries.patch similarity index 69% rename from 0006-Don-t-add-rpaths-to-libraries.patch rename to 0022-Don-t-add-rpaths-to-libraries.patch index e776416..52b102b 100644 --- a/0006-Don-t-add-rpaths-to-libraries.patch +++ b/0022-Don-t-add-rpaths-to-libraries.patch @@ -1,20 +1,20 @@ -From fc7eb8e75bee1b8bf12dcbb7787781169b260558 Mon Sep 17 00:00:00 2001 +From e5312a9c481f91f2ca2cae1dc4176a78baaebf40 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 6/9] Don't add rpaths to libraries. +Subject: [PATCH 22/24] Don't add rpaths to libraries. --- utils/config.mlp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/config.mlp b/utils/config.mlp -index 44c6ff8fa5..a12c31a2bd 100644 +index f758a9b483..ee17a737dc 100644 --- a/utils/config.mlp +++ b/utils/config.mlp -@@ -55,8 +55,8 @@ let native_c_compiler = +@@ -54,8 +54,8 @@ let native_c_compiler = + c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags let native_c_libraries = "%%NATIVECCLIBS%%" let native_pack_linker = "%%PACKLD%%" - let ranlib = "%%RANLIBCMD%%" -let default_rpath = "%%RPATH%%" -let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%" +let default_rpath = "" @@ -23,5 +23,5 @@ index 44c6ff8fa5..a12c31a2bd 100644 let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%% let mkdll, mkexe, mkmaindll = -- -2.36.1 +2.37.0.rc2 diff --git a/0007-configure-Allow-user-defined-C-compiler-flags.patch b/0023-configure-Allow-user-defined-C-compiler-flags.patch similarity index 71% rename from 0007-configure-Allow-user-defined-C-compiler-flags.patch rename to 0023-configure-Allow-user-defined-C-compiler-flags.patch index 77a031b..fc715f8 100644 --- a/0007-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0023-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,17 +1,17 @@ -From b91178cc8fdf657933c26d54a0c67fd69eb67427 Mon Sep 17 00:00:00 2001 +From 2501cd8b3c40188e5eb6dd2158d61cfa023236c2 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 7/9] configure: Allow user defined C compiler flags. +Subject: [PATCH 23/24] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index 2f4ebf9b30..5ccfe8fb01 100644 +index ebb8bbdb80..9e6c0b9745 100644 --- a/configure.ac +++ b/configure.ac -@@ -690,6 +690,10 @@ AS_CASE([$host], +@@ -680,6 +680,10 @@ AS_CASE([$host], internal_cflags="$cc_warnings"], [common_cflags="-O"])]) @@ -23,5 +23,5 @@ index 2f4ebf9b30..5ccfe8fb01 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. -- -2.36.1 +2.37.0.rc2 diff --git a/0009-configure-Only-use-OC_-for-building-executables.patch b/0024-configure-Only-use-OC_-for-building-executables.patch similarity index 83% rename from 0009-configure-Only-use-OC_-for-building-executables.patch rename to 0024-configure-Only-use-OC_-for-building-executables.patch index 8432e41..1dbe2f2 100644 --- a/0009-configure-Only-use-OC_-for-building-executables.patch +++ b/0024-configure-Only-use-OC_-for-building-executables.patch @@ -1,7 +1,7 @@ -From 05b882737e0daecb86a6ef54e192508c60efcd88 Mon Sep 17 00:00:00 2001 +From 8e9ee6f765273d2c385b590a593e784472753d87 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 26 Jan 2022 15:47:02 +0000 -Subject: [PATCH 9/9] configure: Only use OC_* for building executables +Subject: [PATCH 24/24] configure: Only use OC_* for building executables Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for "package notes" which contains build paths. @@ -14,7 +14,7 @@ ocamlopt uses. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index c763310acb..9cce5ea47a 100644 +index 9e6c0b9745..cab4cbd579 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ CONFIGURE_ARGS="$*" @@ -27,5 +27,5 @@ index c763310acb..9cce5ea47a 100644 # Flags for building executable files with debugging symbols mkexedebugflag="-g" -- -2.36.1 +2.37.0.rc2 diff --git a/ocaml.spec b/ocaml.spec index d538213..3f03c76 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -34,7 +34,7 @@ Name: ocaml Version: 4.14.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -53,7 +53,7 @@ Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{vers # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-37-4.14.0 +# Current branch: fedora-38-4.14.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should @@ -65,11 +65,27 @@ Patch0002: 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch Patch0003: 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch Patch0004: 0004-Changes.patch Patch0005: 0005-Guard-more-instances-of-undefined-_MSC_VER.patch +Patch0006: 0006-Better-documentation-for-string_of_float-.-11353.patch +Patch0007: 0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch +Patch0008: 0008-Refactor-the-initialization-of-bytecode-threading-11.patch +Patch0009: 0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch +Patch0010: 0010-Merge-pull-request-11396-from-gasche-fix11392.patch +Patch0011: 0011-Document-limitation-on-caml_callbackN-11409.patch +Patch0012: 0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch +Patch0013: 0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch +Patch0014: 0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch +Patch0015: 0015-Do-not-elide-the-whole-module-type-error-message-114.patch +Patch0016: 0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch +Patch0017: 0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch +Patch0018: 0018-More-prudent-deallocation-of-alternate-signal-stack-.patch +Patch0019: 0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch +Patch0020: 0020-Fixup-Changes.patch +Patch0021: 0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch + # Fedora-specific patches -Patch0006: 0006-Don-t-add-rpaths-to-libraries.patch -Patch0007: 0007-configure-Allow-user-defined-C-compiler-flags.patch -Patch0008: 0008-configure-Remove-incorrect-assumption-about-cross-co.patch -Patch0009: 0009-configure-Only-use-OC_-for-building-executables.patch +Patch0022: 0022-Don-t-add-rpaths-to-libraries.patch +Patch0023: 0023-configure-Allow-user-defined-C-compiler-flags.patch +Patch0024: 0024-configure-Only-use-OC_-for-building-executables.patch BuildRequires: make BuildRequires: git @@ -183,22 +199,28 @@ unset MAKEFLAGS make=make %endif +# Don't use %%configure macro because it sets --build, --host which +# breaks some incorrect assumptions made by OCaml's configure.ac +# +# See also: +# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2O4HBOK6PTQZAFAVIRDVMZGG2PYB2QHM/ +# https://github.com/ocaml/ocaml/issues/8647 +# # We set --libdir to the unusual directory because we want OCaml to # install its libraries and other files into a subdirectory. # -# Force --host because of: -# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2O4HBOK6PTQZAFAVIRDVMZGG2PYB2QHM/ -# (see also https://github.com/ocaml/ocaml/issues/8647) -# # OC_CFLAGS/OC_LDFLAGS control what flags OCaml passes to the linker # when doing final linking of OCaml binaries. Setting these is # necessary to ensure that generated binaries have Fedora hardening # features. -%configure \ +./configure \ + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --mandir=%{_mandir} \ + --libdir=%{_libdir}/ocaml \ OC_CFLAGS="$CFLAGS" \ OC_LDFLAGS="$LDFLAGS" \ - --libdir=%{_libdir}/ocaml \ - --host=`./build-aux/config.guess` + %{nil} $make world %if %{native_compiler} $make opt @@ -378,6 +400,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Mon Sep 5 2022 Richard W.M. Jones - 4.14.0-3 +- Include more upstream patches from 4.14 branch + * Fri Jul 22 2022 Fedora Release Engineering - 4.14.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From c4c11c263c80bbe44ed7f12b933b78a0fbe75e86 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 22:00:44 +0000 Subject: [PATCH 15/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 3f03c76..d7bca45 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -34,7 +34,7 @@ Name: ocaml Version: 4.14.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -400,6 +400,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 4.14.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Mon Sep 5 2022 Richard W.M. Jones - 4.14.0-3 - Include more upstream patches from 4.14 branch From c5a44d336b8f199b6e714764b7e96af4ca49b028 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 23 Jan 2023 21:44:47 +0000 Subject: [PATCH 16/54] Rebuild OCaml packages for F38 --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index d7bca45..a720f83 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -34,7 +34,7 @@ Name: ocaml Version: 4.14.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: OCaml compiler and programming environment @@ -400,6 +400,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %changelog +* Mon Jan 23 2023 Richard W.M. Jones - 4.14.0-5 +- Rebuild OCaml packages for F38 + * Thu Jan 19 2023 Fedora Release Engineering - 4.14.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 68671b2fe60212917008546228091c2ce8c2e771 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 10 Jul 2023 21:41:36 +0100 Subject: [PATCH 17/54] OCaml 5.0 --- ...arning-when-calling-virtual-methods-.patch | 192 ---------- ...t-version-number-after-tagging-5.0.0.patch | 86 +++++ ...st-11236-from-Nymphium-missing-since.patch | 43 --- ...st-11814-from-gasche-clarify-DLS.new.patch | 66 ++++ 0003-Add-KC-Sivaramakrishnan-as-author.patch | 31 ++ ...preprocessor-conditional-on-_MSC_VER.patch | 26 -- 0004-Changes.patch | 28 -- ...unused-variables-in-yacc-reader.c-11.patch | 39 +++ ...more-instances-of-undefined-_MSC_VER.patch | 93 ----- ...st-11860-from-Octachron-index_for_st.patch | 68 ++++ ...g-in-folder-with-space-in-name-11590.patch | 42 +++ ...entation-for-string_of_float-.-11353.patch | 95 ----- ...nused-Makefile-variables-in-workflow.patch | 45 +++ ...st-11380-from-damiendoligez-fix-fort.patch | 30 -- ...variable-from-runtime-Makefile-merge.patch | 33 ++ ...tialization-of-bytecode-threading-11.patch | 101 ------ ...st-11397-from-Octachron-tast_mapper_.patch | 49 --- ...-Provide-a-default-for-OCAMLDEPFLAGS.patch | 24 ++ ...l-request-11396-from-gasche-fix11392.patch | 85 ----- 0010-Report-all-post-build-failures.patch | 41 +++ ...t-limitation-on-caml_callbackN-11409.patch | 53 --- ...emoval-of-FORCE_INSTRUMENTED_RUNTIME.patch | 24 ++ ...lib-on-created-installed-libraries-1.patch | 327 ------------------ ...s-alert-when-compiling-stdlib-docume.patch | 27 ++ ...st-12285-from-smorimoto-update-depre.patch | 70 ++++ ...ay-2-has-gfortran.sh-don-t-print-any.patch | 27 -- ...st-11417-from-lpw25-fix-virtual-clas.patch | 147 -------- ...st-12286-from-smorimoto-replace-set-.patch | 40 +++ ...-whole-module-type-error-message-114.patch | 154 --------- ...> 0015-Don-t-add-rpaths-to-libraries.patch | 10 +- ...est-11373-from-dra27-flexlink-detect.patch | 57 --- ...-Allow-user-defined-C-compiler-flags.patch | 14 +- ...est-11468-from-dra27-i686-mingw-ipv6.patch | 55 --- ...nly-use-OC_-for-building-executables.patch | 40 +++ 0018-Fix-skiplist-test-failure-12346.patch | 39 +++ ...llocation-of-alternate-signal-stack-.patch | 194 ----------- ...st-11487-from-purplearmadillo77-fma_.patch | 54 --- 0020-Fixup-Changes.patch | 36 -- ...utable-which-couldn-t-be-triggered.-.patch | 90 ----- ...nly-use-OC_-for-building-executables.patch | 31 -- ocaml.spec | 168 +++++---- sources | 2 +- 42 files changed, 833 insertions(+), 2043 deletions(-) delete mode 100644 0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch create mode 100644 0001-increment-version-number-after-tagging-5.0.0.patch delete mode 100644 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch create mode 100644 0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch create mode 100644 0003-Add-KC-Sivaramakrishnan-as-author.patch delete mode 100644 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch delete mode 100644 0004-Changes.patch create mode 100644 0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch delete mode 100644 0005-Guard-more-instances-of-undefined-_MSC_VER.patch create mode 100644 0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch create mode 100644 0006-Allow-installing-in-folder-with-space-in-name-11590.patch delete mode 100644 0006-Better-documentation-for-string_of_float-.-11353.patch create mode 100644 0007-Detect-unused-Makefile-variables-in-workflow.patch delete mode 100644 0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch create mode 100644 0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch delete mode 100644 0008-Refactor-the-initialization-of-bytecode-threading-11.patch delete mode 100644 0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch create mode 100644 0009-Provide-a-default-for-OCAMLDEPFLAGS.patch delete mode 100644 0010-Merge-pull-request-11396-from-gasche-fix11392.patch create mode 100644 0010-Report-all-post-build-failures.patch delete mode 100644 0011-Document-limitation-on-caml_callbackN-11409.patch create mode 100644 0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch delete mode 100644 0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch create mode 100644 0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch create mode 100644 0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch delete mode 100644 0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch delete mode 100644 0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch create mode 100644 0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch delete mode 100644 0015-Do-not-elide-the-whole-module-type-error-message-114.patch rename 0022-Don-t-add-rpaths-to-libraries.patch => 0015-Don-t-add-rpaths-to-libraries.patch (76%) delete mode 100644 0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch rename 0023-configure-Allow-user-defined-C-compiler-flags.patch => 0016-configure-Allow-user-defined-C-compiler-flags.patch (64%) delete mode 100644 0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch create mode 100644 0017-configure-Only-use-OC_-for-building-executables.patch create mode 100644 0018-Fix-skiplist-test-failure-12346.patch delete mode 100644 0018-More-prudent-deallocation-of-alternate-signal-stack-.patch delete mode 100644 0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch delete mode 100644 0020-Fixup-Changes.patch delete mode 100644 0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch delete mode 100644 0024-configure-Only-use-OC_-for-building-executables.patch diff --git a/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch b/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch deleted file mode 100644 index 166e69a..0000000 --- a/0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch +++ /dev/null @@ -1,192 +0,0 @@ -From 2912ed4fde14e34b58c482cb81fb88676ab3ffc2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= -Date: Wed, 27 Apr 2022 14:46:47 +0200 -Subject: [PATCH 01/24] Do not trigger warning when calling virtual methods - introduced by constraining "self" (#11204) - -(cherry picked from commit 1e7af3f6261502bb384dc9e23a74ad0990bfd854) ---- - Changes | 11 ++++++- - testsuite/tests/typing-objects/Tests.ml | 15 ++++++++++ - typing/typeclass.ml | 40 ++++++++++--------------- - 3 files changed, 40 insertions(+), 26 deletions(-) - -diff --git a/Changes b/Changes -index a8ce94bdc6..931a74b8d1 100644 ---- a/Changes -+++ b/Changes -@@ -1,3 +1,13 @@ -+OCaml 4.14 maintenance branch -+----------------------------- -+ -+### Bug fixes: -+ -+- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when -+ calling virtual methods introduced by constraining the self type from within -+ the class definition. -+ (Nicolás Ojeda Bär, review by Leo White) -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - -@@ -62,7 +72,6 @@ OCaml 4.14.0 (28 March 2022) - definition-aware operations. - (Ulysse Gérard, Thomas Refis and Leo White, review by Florian Angeletti) - -- - ### Language features: - - - #10462: Add attribute to produce a compiler error for polls. -diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml -index f617bcf1b9..3dcd87c43c 100644 ---- a/testsuite/tests/typing-objects/Tests.ml -+++ b/testsuite/tests/typing-objects/Tests.ml -@@ -955,6 +955,21 @@ Warning 17 [undeclared-virtual-method]: the virtual method m is not declared. - class c : object method m : int method n : int end - |}];; - -+class virtual c = object (self : 'c) -+ constraint 'c = < f : int; .. > -+end -+[%%expect {| -+class virtual c : object method virtual f : int end -+|}];; -+ -+class virtual c = object (self : 'c) -+ constraint 'c = < f : int; .. > -+ method g = self # f -+end -+[%%expect {| -+class virtual c : object method virtual f : int method g : int end -+|}];; -+ - class [ 'a ] c = object (_ : 'a) end;; - let o = object - method m = 1 -diff --git a/typing/typeclass.ml b/typing/typeclass.ml -index 048ee998b0..fedbc0e025 100644 ---- a/typing/typeclass.ml -+++ b/typing/typeclass.ml -@@ -552,12 +552,11 @@ type first_pass_accummulater = - concrete_vals : VarSet.t; - local_meths : MethSet.t; - local_vals : VarSet.t; -- vars : Ident.t Vars.t; -- meths : Ident.t Meths.t; } -+ vars : Ident.t Vars.t; } - - let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = - let { rev_fields; val_env; par_env; concrete_meths; concrete_vals; -- local_meths; local_vals; vars; meths } = acc -+ local_meths; local_vals; vars } = acc - in - let loc = cf.pcf_loc in - let attributes = cf.pcf_attributes in -@@ -612,13 +611,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = - (val_env, par_env, inherited_vars, vars)) - parent_sign.csig_vars (val_env, par_env, [], vars) - in -- let meths = -- Meths.fold -- (fun label _ meths -> -- if Meths.mem label meths then meths -- else Meths.add label (Ident.create_local label) meths) -- parent_sign.csig_meths meths -- in - (* Methods available through super *) - let super_meths = - MethSet.fold -@@ -641,7 +633,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = - in - let rev_fields = field :: rev_fields in - { acc with rev_fields; val_env; par_env; -- concrete_meths; concrete_vals; vars; meths }) -+ concrete_meths; concrete_vals; vars }) - | Pcf_val (label, mut, Cfk_virtual styp) -> - with_attrs - (fun () -> -@@ -723,15 +715,11 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = - let cty = transl_simple_type val_env false sty in - let ty = cty.ctyp_type in - add_method loc val_env label.txt priv Virtual ty sign; -- let meths = -- if Meths.mem label.txt meths then meths -- else Meths.add label.txt (Ident.create_local label.txt) meths -- in - let field = - Virtual_method { label; priv; cty; loc; attributes } - in - let rev_fields = field :: rev_fields in -- { acc with rev_fields; meths }) -+ { acc with rev_fields }) - - | Pcf_method (label, priv, Cfk_concrete (override, expr)) -> - with_attrs -@@ -785,10 +773,6 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = - raise(Error(loc, val_env, - Field_type_mismatch ("method", label.txt, err))) - end; -- let meths = -- if Meths.mem label.txt meths then meths -- else Meths.add label.txt (Ident.create_local label.txt) meths -- in - let sdefinition = make_method self_loc cl_num expr in - let warning_state = Warnings.backup () in - let field = -@@ -799,7 +783,7 @@ let rec class_field_first_pass self_loc cl_num sign self_scope acc cf = - let rev_fields = field :: rev_fields in - let concrete_meths = MethSet.add label.txt concrete_meths in - let local_meths = MethSet.add label.txt local_meths in -- { acc with rev_fields; concrete_meths; local_meths; meths }) -+ { acc with rev_fields; concrete_meths; local_meths }) - - | Pcf_constraint (sty1, sty2) -> - with_attrs -@@ -837,11 +821,10 @@ and class_fields_first_pass self_loc cl_num sign self_scope - let local_meths = MethSet.empty in - let local_vals = VarSet.empty in - let vars = Vars.empty in -- let meths = Meths.empty in - let init_acc = - { rev_fields; val_env; par_env; - concrete_meths; concrete_vals; -- local_meths; local_vals; vars; meths } -+ local_meths; local_vals; vars } - in - let acc = - Builtin_attributes.warning_scope [] -@@ -850,7 +833,7 @@ and class_fields_first_pass self_loc cl_num sign self_scope - (class_field_first_pass self_loc cl_num sign self_scope) - init_acc cfs) - in -- List.rev acc.rev_fields, acc.vars, acc.meths -+ List.rev acc.rev_fields, acc.vars - - and class_field_second_pass cl_num sign met_env field = - let mkcf desc loc attrs = -@@ -1003,7 +986,7 @@ and class_structure cl_num virt self_scope final val_env met_env loc - end; - - (* Typing of class fields *) -- let (fields, vars, meths) = -+ let (fields, vars) = - class_fields_first_pass self_loc cl_num sign self_scope - val_env par_env str - in -@@ -1016,6 +999,13 @@ and class_structure cl_num virt self_scope final val_env met_env loc - update_class_signature loc val_env - ~warn_implicit_public:false virt kind sign; - -+ let meths = -+ Meths.fold -+ (fun label _ meths -> -+ Meths.add label (Ident.create_local label) meths) -+ sign.csig_meths Meths.empty -+ in -+ - (* Close the signature if it is final *) - begin match final with - | Not_final -> () --- -2.37.0.rc2 - diff --git a/0001-increment-version-number-after-tagging-5.0.0.patch b/0001-increment-version-number-after-tagging-5.0.0.patch new file mode 100644 index 0000000..7583a57 --- /dev/null +++ b/0001-increment-version-number-after-tagging-5.0.0.patch @@ -0,0 +1,86 @@ +From 8741f4d88801e478e0ab7f871dc7dbcf9d7cc8f4 Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Thu, 15 Dec 2022 14:28:32 +0100 +Subject: [PATCH 01/18] increment version number after tagging 5.0.0 + +--- + VERSION | 2 +- + build-aux/ocaml_version.m4 | 6 +++--- + configure | Bin 617024 -> 617302 bytes + ocaml-variants.opam | 6 +++--- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/VERSION b/VERSION +index fc40ac52d7..314f8ec760 100644 +--- a/VERSION ++++ b/VERSION +@@ -1,4 +1,4 @@ +-5.0.0 ++5.0.1+dev0-2022-12-15 + + # Starting with OCaml 4.14, although the version string that appears above is + # still correct and this file can thus still be used to figure it out, +diff --git a/build-aux/ocaml_version.m4 b/build-aux/ocaml_version.m4 +index ba48c00277..78049eaab0 100644 +--- a/build-aux/ocaml_version.m4 ++++ b/build-aux/ocaml_version.m4 +@@ -25,7 +25,7 @@ + # The following macro, OCAML__DEVELOPMENT_VERSION, should be either + # [true] of [false]. + +-m4_define([OCAML__DEVELOPMENT_VERSION], [false]) ++m4_define([OCAML__DEVELOPMENT_VERSION], [true]) + + # The three following components (major, minor and patch level) MUST be + # integers. They MUST NOT be left-padded with zeros and all of them, +@@ -33,10 +33,10 @@ m4_define([OCAML__DEVELOPMENT_VERSION], [false]) + + m4_define([OCAML__VERSION_MAJOR], [5]) + m4_define([OCAML__VERSION_MINOR], [0]) +-m4_define([OCAML__VERSION_PATCHLEVEL], [0]) ++m4_define([OCAML__VERSION_PATCHLEVEL], [1]) + # Note that the OCAML__VERSION_EXTRA string defined below is always empty + # for officially-released versions of OCaml. +-m4_define([OCAML__VERSION_EXTRA], []) ++m4_define([OCAML__VERSION_EXTRA], [dev0-2022-12-15]) + + # The OCAML__VERSION_EXTRA_PREFIX macro defined below should be a + # single character: +diff --git a/configure b/configure +index 19764d19a9b8fb1a9f01868f8f7863733a4c4ecd..f54df41388272a49e583ca20f325508c5b814eff 100755 +GIT binary patch +delta 558 +zcmX?bMfKV>)eSNnf`-~DsbvPbMg~Skx`sexx>=UvgA=CkWIk^hOwrBS-boQyg!>lT +z^I#D^w|=RVFoum>>61UO%Wj^0>LnI?x7YGA-j2jHYkHy%qwMsubVfN$x$RTa8SPkv +zFfE!a6)I(ITT)b-%EjgH?C9$gALQ!e>KN=A?-~&jgcdML +zn(EW}a~M6D47nz63=t8qMU&s2pTqc^h0$<&pcn(`ObkI${VGs4{AT +zl=Ds(C}Lzq($6>DyNHn&(|gk&sxgYT=M^ymF%u9o12N0?ydu`PGG?IP+Aq9d1!A`C +q7hbSOxPU~a14U%Fd+Kt$%*A3FFo1ow*U#pd&5kL#U3xKx>Tv-4Xq`R) + +delta 271 +zcmcb1P4&PP)eSNnj0T%^IX*Zs8cf#nmH~32y^|t<)Vam>JU~ir!%`_`1FrPRAJ}C# +ze?IjRsBZgPUdG#zj0V#$>M+Vq|CY`u2NYAyV6m!Fq9{ZtO4CrI(b5D`Y(?UuQW&sl)xDHbt0O)n~9be#S` +zl~Hqge<33;n}VqU5P+mi`GP}&JpJ4iVw6nv4D<}z1B)4fmcP84Jkj +x_Tw*EftYRk@t5ooE?}YQKq1-f_IeyIbAdJiec-dbbq>dDcA(P@mvE>a2LKy+Taf?& + +diff --git a/ocaml-variants.opam b/ocaml-variants.opam +index 5928f357f2..a0876e02c9 100644 +--- a/ocaml-variants.opam ++++ b/ocaml-variants.opam +@@ -1,9 +1,9 @@ + opam-version: "2.0" +-version: "5.0.0" ++version: "5.0.1+trunk" + license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" +-synopsis: "Official release of OCaml 5.0.0" ++synopsis: "OCaml development version" + depends: [ +- "ocaml" {= "5.0.0" & post} ++ "ocaml" {= "5.0.1" & post} + "base-unix" {post} + "base-bigarray" {post} + "base-threads" {post} +-- +2.41.0 + diff --git a/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch b/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch deleted file mode 100644 index 9c75989..0000000 --- a/0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 623258a6517c8ec1d9e5f41cbdc05205a0e6ee1d Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Thu, 5 May 2022 20:01:44 +0100 -Subject: [PATCH 02/24] Merge pull request #11236 from Nymphium/missing-since2 - -Add missing @since annotation to Gc.eventlog_pause - -(cherry picked from commit 77fee6035c25d8a31084dc556ee634e46bb39164) ---- - stdlib/gc.mli | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/stdlib/gc.mli b/stdlib/gc.mli -index b211197fd4..8031eeb8df 100644 ---- a/stdlib/gc.mli -+++ b/stdlib/gc.mli -@@ -442,7 +442,10 @@ external eventlog_pause : unit -> unit = "caml_eventlog_pause" - Traces are collected if the program is linked to the instrumented runtime - and started with the environment variable OCAML_EVENTLOG_ENABLED. - Events are flushed to disk after pausing, and no new events will be -- recorded until [eventlog_resume] is called. *) -+ recorded until [eventlog_resume] is called. -+ -+ @since 4.11 -+ *) - - external eventlog_resume : unit -> unit = "caml_eventlog_resume" - (** [eventlog_resume ()] will resume the collection of traces in the -@@ -451,7 +454,10 @@ external eventlog_resume : unit -> unit = "caml_eventlog_resume" - and started with the environment variable OCAML_EVENTLOG_ENABLED. - This call can be used after calling [eventlog_pause], or if the program - was started with OCAML_EVENTLOG_ENABLED=p. (which pauses the collection of -- traces before the first event.) *) -+ traces before the first event.) -+ -+ @since 4.11 -+ *) - - - (** [Memprof] is a sampling engine for allocated memory words. Every --- -2.37.0.rc2 - diff --git a/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch b/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch new file mode 100644 index 0000000..e25154a --- /dev/null +++ b/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch @@ -0,0 +1,66 @@ +From 925bf9a6d828d7548751f9a21892cad6209fc950 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Fri, 16 Dec 2022 09:41:13 +0100 +Subject: [PATCH 02/18] Merge pull request #11814 from + gasche/clarify-DLS.new_key-doc + +clarify the doc of Domain.DLS.new_key + +(cherry picked from commit be210179503c4a82b72dd4762560e13c408d37b7) +--- + stdlib/domain.mli | 37 ++++++++++++++++++++++++++++++------- + 1 file changed, 30 insertions(+), 7 deletions(-) + +diff --git a/stdlib/domain.mli b/stdlib/domain.mli +index 7763043aa5..2d79b3b0c3 100644 +--- a/stdlib/domain.mli ++++ b/stdlib/domain.mli +@@ -96,15 +96,38 @@ module DLS : sig + + val new_key : ?split_from_parent:('a -> 'a) -> (unit -> 'a) -> 'a key + (** [new_key f] returns a new key bound to initialiser [f] for accessing +- domain-local variables. ++, domain-local variables. + +- If [split_from_parent] is provided, spawning a domain will derive the +- child value (for this key) from the parent value. ++ If [split_from_parent] is not provided, the value for a new ++ domain will be computed on-demand by the new domain: the first ++ [get] call will call the initializer [f] and store that value. + +- Note that the [split_from_parent] call is computed in the parent +- domain, and is always computed regardless of whether the child domain +- will use it. If the splitting function is expensive or requires +- client-side computation, consider using ['a Lazy.t key]. ++ If [split_from_parent] is provided, spawning a domain will ++ derive the child value (for this key) from the parent ++ value. This computation happens in the parent domain and it ++ always happens, regardless of whether the child domain will ++ use it. ++ If the splitting function is expensive or requires ++ child-side computation, consider using ['a Lazy.t key]: ++ ++ {[ ++ let init () = ... ++ ++ let split_from_parent parent_value = ++ ... parent-side computation ...; ++ lazy ( ++ ... child-side computation ... ++ ) ++ ++ let key = Domain.DLS.new_key ~split_from_parent init ++ ++ let get () = Lazy.force (Domain.DLS.get key) ++ ]} ++ ++ In this case a part of the computation happens on the child ++ domain; in particular, it can access [parent_value] ++ concurrently with the parent domain, which may require ++ explicit synchronization to avoid data races. + *) + + val get : 'a key -> 'a +-- +2.41.0 + diff --git a/0003-Add-KC-Sivaramakrishnan-as-author.patch b/0003-Add-KC-Sivaramakrishnan-as-author.patch new file mode 100644 index 0000000..0a60404 --- /dev/null +++ b/0003-Add-KC-Sivaramakrishnan-as-author.patch @@ -0,0 +1,31 @@ +From 83ef99f67fda11b268098a271f56b990e295bbc2 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Tue, 20 Dec 2022 10:48:41 +0100 +Subject: [PATCH 03/18] Add KC Sivaramakrishnan as author + +For the two new chapters "Parallel programming" and "Memory model". + +Follow-up to #11280. + +(cherry picked from commit e6340ced8ca1d46f11eaea8e0474d1eb2142fe1c) +--- + manual/src/allfiles.etex | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/manual/src/allfiles.etex b/manual/src/allfiles.etex +index 6600943f54..3e07555b85 100644 +--- a/manual/src/allfiles.etex ++++ b/manual/src/allfiles.etex +@@ -12,7 +12,8 @@ + release \ocamlversion \\[1cm] + \Large Documentation and user's manual \\[1cm] + \large Xavier Leroy, \\ +- Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon \\[1cm] ++ Damien Doligez, Alain Frisch, Jacques Garrigue, \\ ++ Didier Rémy, KC Sivaramakrishnan and Jérôme Vouillon \\[1cm] + \today \\ + ~ + \vfill +-- +2.41.0 + diff --git a/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch b/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch deleted file mode 100644 index 3854e05..0000000 --- a/0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d497565758b5c80d8a7bf4cad02e5a4558ae6b00 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= -Date: Tue, 17 May 2022 10:21:34 +0200 -Subject: [PATCH 03/24] misc.h: fix preprocessor conditional on _MSC_VER - -(cherry picked from commit 253d605e10865371aed45967a94caed0642b7583) ---- - runtime/caml/misc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h -index 5915c30a7b..494d45e8f8 100644 ---- a/runtime/caml/misc.h -+++ b/runtime/caml/misc.h -@@ -35,7 +35,7 @@ - /* Supported since at least GCC 3.1 */ - #define CAMLdeprecated_typedef(name, type) \ - typedef type name __attribute ((deprecated)) --#elif _MSC_VER >= 1310 -+#elif defined(_MSC_VER) && _MSC_VER >= 1310 - /* NB deprecated("message") only supported from _MSC_VER >= 1400 */ - #define CAMLdeprecated_typedef(name, type) \ - typedef __declspec(deprecated) type name --- -2.37.0.rc2 - diff --git a/0004-Changes.patch b/0004-Changes.patch deleted file mode 100644 index 214e89e..0000000 --- a/0004-Changes.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d2b9da6f7aff410e8a1499637ae88aaf0a135c2f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= -Date: Tue, 17 May 2022 14:45:26 +0200 -Subject: [PATCH 04/24] Changes - -(cherry picked from commit 9a157026f115364635f8fe0ae5805e15ef071de0) ---- - Changes | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/Changes b/Changes -index 931a74b8d1..fdfffd78bb 100644 ---- a/Changes -+++ b/Changes -@@ -8,6 +8,10 @@ OCaml 4.14 maintenance branch - the class definition. - (Nicolás Ojeda Bär, review by Leo White) - -+- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This -+ could break the build of the compiler on non-gcc non-clang Unix builds. -+ (Nicolás Ojeda Bär, review by Sebastien Hinderer) -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - --- -2.37.0.rc2 - diff --git a/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch b/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch new file mode 100644 index 0000000..d49f709 --- /dev/null +++ b/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch @@ -0,0 +1,39 @@ +From ea8b79eda165722d04b369f1811a5aa80ab5acc6 Mon Sep 17 00:00:00 2001 +From: SSHz +Date: Sun, 27 Nov 2022 14:46:16 +0000 +Subject: [PATCH 04/18] removed set but unused variables in yacc/reader.c + (#11758) + +(cherry picked from commit 0114f62d3ed056254ac25192f724e92a2ff6c448) +--- + yacc/reader.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/yacc/reader.c b/yacc/reader.c +index 7377967994..7a0b888961 100644 +--- a/yacc/reader.c ++++ b/yacc/reader.c +@@ -1049,12 +1049,10 @@ void read_declarations(void) + void output_token_type(void) + { + bucket * bp; +- int n; + + fprintf(interface_file, "type token =\n"); + if (!rflag) ++outline; + fprintf(output_file, "type token =\n"); +- n = 0; + for (bp = first_symbol; bp; bp = bp->next) { + if (bp->class == TERM && bp->true_token) { + fprintf(interface_file, " | %s", bp->name); +@@ -1068,7 +1066,6 @@ void output_token_type(void) + fprintf(interface_file, "\n"); + if (!rflag) ++outline; + fprintf(output_file, "\n"); +- n++; + } + } + fprintf(interface_file, "\n"); +-- +2.41.0 + diff --git a/0005-Guard-more-instances-of-undefined-_MSC_VER.patch b/0005-Guard-more-instances-of-undefined-_MSC_VER.patch deleted file mode 100644 index d9f81d7..0000000 --- a/0005-Guard-more-instances-of-undefined-_MSC_VER.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 513164232d897c39c4e571a7a8f167dee5c146b3 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Wed, 18 May 2022 12:48:33 +0100 -Subject: [PATCH 05/24] Guard more instances of undefined _MSC_VER - ---- - Changes | 8 +++++--- - runtime/caml/memory.h | 2 +- - runtime/caml/misc.h | 12 +++++++----- - 3 files changed, 13 insertions(+), 9 deletions(-) - -diff --git a/Changes b/Changes -index fdfffd78bb..590268262d 100644 ---- a/Changes -+++ b/Changes -@@ -8,9 +8,11 @@ OCaml 4.14 maintenance branch - the class definition. - (Nicolás Ojeda Bär, review by Leo White) - --- #11263: caml/misc.h: check whether `_MSC_VER` is defined before using it. This -- could break the build of the compiler on non-gcc non-clang Unix builds. -- (Nicolás Ojeda Bär, review by Sebastien Hinderer) -+- #11263, #11267: caml/{memory,misc}.h: check whether `_MSC_VER` is defined -+ before using it to ensure that the headers can always be used in code which -+ turns on -Wundef (or equivalent). -+ (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and -+ Sebastien Hinderer) - - OCaml 4.14.0 (28 March 2022) - ---------------------------- -diff --git a/runtime/caml/memory.h b/runtime/caml/memory.h -index 1e9cdf6d9b..d9e58bc2d0 100644 ---- a/runtime/caml/memory.h -+++ b/runtime/caml/memory.h -@@ -329,7 +329,7 @@ struct caml__roots_block { - #define CAMLunused_start __attribute__ ((unused)) - #define CAMLunused_end - #define CAMLunused __attribute__ ((unused)) --#elif _MSC_VER >= 1500 -+#elif defined(_MSC_VER) && _MSC_VER >= 1500 - #define CAMLunused_start __pragma( warning (push) ) \ - __pragma( warning (disable:4189 ) ) - #define CAMLunused_end __pragma( warning (pop)) -diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h -index 494d45e8f8..c605f8711e 100644 ---- a/runtime/caml/misc.h -+++ b/runtime/caml/misc.h -@@ -43,7 +43,8 @@ - #define CAMLdeprecated_typedef(name, type) typedef type name - #endif - --#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L || _MSC_VER >= 1925 -+#if defined(__GNUC__) && __STDC_VERSION__ >= 199901L \ -+ || defined(_MSC_VER) && _MSC_VER >= 1925 - - #define CAML_STRINGIFY(x) #x - #ifdef _MSC_VER -@@ -90,7 +91,7 @@ CAMLdeprecated_typedef(addr, char *); - #define CAMLnoreturn_start - #define CAMLnoreturn_end __attribute__ ((noreturn)) - #define Noreturn __attribute__ ((noreturn)) --#elif _MSC_VER >= 1500 -+#elif defined(_MSC_VER) && _MSC_VER >= 1500 - #define CAMLnoreturn_start __declspec(noreturn) - #define CAMLnoreturn_end - #define Noreturn -@@ -138,11 +139,12 @@ CAMLdeprecated_typedef(addr, char *); - /* we need to be able to compute the exact offset of each member. */ - #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - #define CAMLalign(n) _Alignas(n) --#elif defined(__cplusplus) && (__cplusplus >= 201103L || _MSC_VER >= 1900) -+#elif defined(__cplusplus) \ -+ && (__cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER >= 1900) - #define CAMLalign(n) alignas(n) - #elif defined(SUPPORTS_ALIGNED_ATTRIBUTE) - #define CAMLalign(n) __attribute__((aligned(n))) --#elif _MSC_VER >= 1500 -+#elif defined(_MSC_VER) && _MSC_VER >= 1500 - #define CAMLalign(n) __declspec(align(n)) - #else - #error "How do I align values on this platform?" -@@ -170,7 +172,7 @@ CAMLdeprecated_typedef(addr, char *); - #define CAMLunused_start __attribute__ ((unused)) - #define CAMLunused_end - #define CAMLunused __attribute__ ((unused)) --#elif _MSC_VER >= 1500 -+#elif defined(_MSC_VER) && _MSC_VER >= 1500 - #define CAMLunused_start __pragma( warning (push) ) \ - __pragma( warning (disable:4189 ) ) - #define CAMLunused_end __pragma( warning (pop)) --- -2.37.0.rc2 - diff --git a/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch b/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch new file mode 100644 index 0000000..c3e9555 --- /dev/null +++ b/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch @@ -0,0 +1,68 @@ +From 848e28fc6f3f3c9802b23c00f2d77f568c761667 Mon Sep 17 00:00:00 2001 +From: Gabriel Scherer +Date: Tue, 3 Jan 2023 17:41:12 +0100 +Subject: [PATCH 05/18] Merge pull request #11860 from + Octachron/index_for_stdlib + +documentation: sort modules alphabetically + +fixes #11857 + +(cherry picked from commit 14004c6d4bedadb7215ded2c77230270e52307ff) +--- + api_docgen/Makefile.docfiles | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/api_docgen/Makefile.docfiles b/api_docgen/Makefile.docfiles +index 0c2412b192..f12830b1ec 100644 +--- a/api_docgen/Makefile.docfiles ++++ b/api_docgen/Makefile.docfiles +@@ -26,10 +26,6 @@ define capitalize + $(foreach m,$(1),$(call capitalize_one,$m)) + endef + +-define sort +-$(shell $(OCAMLDEP) -sort $(1)) +-endef +- + runtime_events_MLIS := runtime_events.mli + str_MLIS := str.mli + unix_MLIS := unix.mli unixLabels.mli +@@ -62,10 +58,8 @@ endif + libref_TEXT=Ocaml_operators Format_tutorial + libref_C=$(call capitalize,$(libref)) + +-PARSING_MLIS := $(call sort, \ +- $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))\ +-) +-UTILS_MLIS := $(call sort,$(notdir $(wildcard $(ROOTDIR)/utils/*.mli))) ++PARSING_MLIS := $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli)) ++UTILS_MLIS := $(notdir $(wildcard $(ROOTDIR)/utils/*.mli)) + DRIVER_MLIS := pparse.mli + + compilerlibref_MLIS= \ +@@ -76,8 +70,20 @@ compilerlibref=$(compilerlibref_MLIS:%.mli=%) + compilerlibref_TEXT=Compiler_libs + compilerlibref_C=$(call capitalize,$(compilerlibref)) + +-ALL_LIBREF= $(libref_TEXT:%=libref/%) $(libref:%=libref/%) ++ALL_LIBREF= \ ++ $(sort $(libref_TEXT:%=libref/%)) \ ++ $(sort $(filter-out libref/camlinternal%, $(libref:%=libref/%))) \ ++ $(sort $(filter libref/camlinternal%, $(libref:%=libref/%))) ++ + ALL_COMPILERLIBREF= \ + $(compilerlibref_TEXT:%=compilerlibref/%) \ + $(compilerlibref:%=compilerlibref/%) ++# Note that the output of $(wildcard ...) is sorted alphabetically. ++# The compilerlibs index will be thus be sorted first by category: ++# - text documentation ++# - parsing modules ++# - utils modules ++# - driver modules ++# And then alphabetically inside each category. ++ + ALL_DOC= $(ALL_LIBREF) $(ALL_COMPILERLIBREF) +-- +2.41.0 + diff --git a/0006-Allow-installing-in-folder-with-space-in-name-11590.patch b/0006-Allow-installing-in-folder-with-space-in-name-11590.patch new file mode 100644 index 0000000..2831ec8 --- /dev/null +++ b/0006-Allow-installing-in-folder-with-space-in-name-11590.patch @@ -0,0 +1,42 @@ +From a3cd42bc03ed0fc706bb7364fdb14b29b1925600 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 4 Jan 2023 16:33:28 +0000 +Subject: [PATCH 06/18] Allow installing in folder with space in name (#11590) + +- fix(build): Repair make install (in man/Makefile) +--- + Changes | 8 ++++++++ + man/Makefile | 4 ++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/Changes b/Changes +index 776f6e7a45..438c0f3ec2 100644 +--- a/Changes ++++ b/Changes +@@ -1,3 +1,11 @@ ++OCaml 5.0 maintenance version ++----------------------------- ++ ++### Build system: ++ ++- #11590: Allow installing to a destination path containing spaces. ++ (Élie Brami, review by Sébastien Hinderer and David Allsopp) ++ + OCaml 5.0 (16 December 2022) + ---------------------------- + +diff --git a/man/Makefile b/man/Makefile +index 36d3126563..10cc8bbe41 100644 +--- a/man/Makefile ++++ b/man/Makefile +@@ -22,5 +22,5 @@ MANPAGES = $(addsuffix .1,\ + + .PHONY: install + install: +- $(MKDIR) $(INSTALL_PROGRAMS_MAN_DIR) +- $(INSTALL_DATA) $(MANPAGES) $(INSTALL_PROGRAMS_MAN_DIR) ++ $(MKDIR) '$(INSTALL_PROGRAMS_MAN_DIR)' ++ $(INSTALL_DATA) $(MANPAGES) '$(INSTALL_PROGRAMS_MAN_DIR)' +-- +2.41.0 + diff --git a/0006-Better-documentation-for-string_of_float-.-11353.patch b/0006-Better-documentation-for-string_of_float-.-11353.patch deleted file mode 100644 index 935a992..0000000 --- a/0006-Better-documentation-for-string_of_float-.-11353.patch +++ /dev/null @@ -1,95 +0,0 @@ -From fa904a7d3c89c2ad18a426017aeda5bb0d7dd8bd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Pottier?= - -Date: Fri, 24 Jun 2022 16:37:13 +0200 -Subject: [PATCH 06/24] Better documentation for [string_of_float]. (#11353) - -Better documentation for [string_of_float] (and [Float.to_string]) -with similar warnings for [print_float] and [prerr_float] in a similar way. - -(cherry picked from commit 40113fbc73930b41a7a2df468de18c94feeefdf5) ---- - stdlib/float.mli | 7 ++++++- - stdlib/stdlib.mli | 15 ++++++++++++--- - stdlib/templates/float.template.mli | 7 ++++++- - 3 files changed, 24 insertions(+), 5 deletions(-) - -diff --git a/stdlib/float.mli b/stdlib/float.mli -index ba84d9b0e2..93d2f3016d 100644 ---- a/stdlib/float.mli -+++ b/stdlib/float.mli -@@ -178,7 +178,12 @@ val of_string_opt: string -> float option - (** Same as [of_string], but returns [None] instead of raising. *) - - val to_string : float -> string --(** Return the string representation of a floating-point number. *) -+(** Return a string representation of a floating-point number. -+ -+ This conversion can involve a loss of precision. For greater control over -+ the manner in which the number is printed, see {!Printf}. -+ -+ This function is an alias for {!Stdlib.string_of_float}. *) - - type fpclass = Stdlib.fpclass = - FP_normal (** Normal number, none of the below *) -diff --git a/stdlib/stdlib.mli b/stdlib/stdlib.mli -index 237adfbdd8..0eaee2716e 100644 ---- a/stdlib/stdlib.mli -+++ b/stdlib/stdlib.mli -@@ -776,7 +776,10 @@ external int_of_string : string -> int = "caml_int_of_string" - [Failure "int_of_string"] instead of returning [None]. *) - - val string_of_float : float -> string --(** Return the string representation of a floating-point number. *) -+(** Return a string representation of a floating-point number. -+ -+ This conversion can involve a loss of precision. For greater control over -+ the manner in which the number is printed, see {!Printf}. *) - - val float_of_string_opt: string -> float option - (** Convert the given string to a float. The string is read in decimal -@@ -861,7 +864,10 @@ val print_int : int -> unit - (** Print an integer, in decimal, on standard output. *) - - val print_float : float -> unit --(** Print a floating-point number, in decimal, on standard output. *) -+(** Print a floating-point number, in decimal, on standard output. -+ -+ The conversion of the number to a string uses {!string_of_float} and -+ can involve a loss of precision. *) - - val print_endline : string -> unit - (** Print a string, followed by a newline character, on -@@ -889,7 +895,10 @@ val prerr_int : int -> unit - (** Print an integer, in decimal, on standard error. *) - - val prerr_float : float -> unit --(** Print a floating-point number, in decimal, on standard error. *) -+(** Print a floating-point number, in decimal, on standard error. -+ -+ The conversion of the number to a string uses {!string_of_float} and -+ can involve a loss of precision. *) - - val prerr_endline : string -> unit - (** Print a string, followed by a newline character on standard -diff --git a/stdlib/templates/float.template.mli b/stdlib/templates/float.template.mli -index e35c01809f..e2f7411a02 100644 ---- a/stdlib/templates/float.template.mli -+++ b/stdlib/templates/float.template.mli -@@ -178,7 +178,12 @@ val of_string_opt: string -> float option - (** Same as [of_string], but returns [None] instead of raising. *) - - val to_string : float -> string --(** Return the string representation of a floating-point number. *) -+(** Return a string representation of a floating-point number. -+ -+ This conversion can involve a loss of precision. For greater control over -+ the manner in which the number is printed, see {!Printf}. -+ -+ This function is an alias for {!Stdlib.string_of_float}. *) - - type fpclass = Stdlib.fpclass = - FP_normal (** Normal number, none of the below *) --- -2.37.0.rc2 - diff --git a/0007-Detect-unused-Makefile-variables-in-workflow.patch b/0007-Detect-unused-Makefile-variables-in-workflow.patch new file mode 100644 index 0000000..e13b225 --- /dev/null +++ b/0007-Detect-unused-Makefile-variables-in-workflow.patch @@ -0,0 +1,45 @@ +From 44f4015f9a649e164b332e6ab1302139191d4a4f Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 3 Mar 2021 12:24:36 +0000 +Subject: [PATCH 07/18] Detect unused Makefile variables in workflow + +--- + tools/ci/actions/runner.sh | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh +index ede27f710a..26123b40d1 100755 +--- a/tools/ci/actions/runner.sh ++++ b/tools/ci/actions/runner.sh +@@ -21,6 +21,8 @@ PREFIX=~/local + MAKE="make $MAKE_ARG" + SHELL=dash + ++MAKE_WARN="$MAKE --warn-undefined-variables" ++ + export PATH=$PREFIX/bin:$PATH + + Configure () { +@@ -60,9 +62,18 @@ EOF + } + + Build () { +- $MAKE world.opt ++ if [ "$(uname)" = 'Darwin' ]; then ++ script -q build.log $MAKE_WARN ++ else ++ script --return --command "$MAKE_WARN" build.log ++ fi + echo Ensuring that all names are prefixed in the runtime + ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a ++ if grep -Fq ' warning: undefined variable ' build.log; then ++ echo Undefined Makefile variables detected ++ exit 1 ++ fi ++ rm build.log + } + + Test () { +-- +2.41.0 + diff --git a/0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch b/0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch deleted file mode 100644 index b57c6ba..0000000 --- a/0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 05874f93adc60f16ccd5cbeef1e2ff010cef12c1 Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Fri, 1 Jul 2022 14:41:25 +0200 -Subject: [PATCH 07/24] Merge pull request #11380 from - damiendoligez/fix-fortran-test-on-macos - -fix gfortran test on Macos - -(cherry picked from commit d7a2e0fa7f2df9bd178109ba9725bb074affbd5c) ---- - testsuite/tests/lib-bigarray-2/has-gfortran.sh | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh -index 82f7ae8aee..051122113a 100644 ---- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh -+++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh -@@ -5,6 +5,9 @@ if ! which gfortran > /dev/null 2>&1; then - elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then - echo "OCaml was not compiled with gcc" > ${ocamltest_response} - test_result=${TEST_SKIP} -+elif gcc --version 2>&1 | grep 'Apple clang version'; then -+ echo "OCaml was not compiled with gcc" > ${ocamltest_response} -+ test_result=${TEST_SKIP} - else - test_result=${TEST_PASS} - fi --- -2.37.0.rc2 - diff --git a/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch b/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch new file mode 100644 index 0000000..f57e2bd --- /dev/null +++ b/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch @@ -0,0 +1,33 @@ +From 2eccdd3cd78624b0f2664d6152afbcae167f6f8b Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Mon, 20 Feb 2023 20:27:58 +0000 +Subject: [PATCH 08/18] Fix incorrect variable from runtime/Makefile merge + +Wrong CPPFLAGS used when assembling with ASPP. +--- + Makefile | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/Makefile b/Makefile +index bb2c245eab..3ea3296c7f 100644 +--- a/Makefile ++++ b/Makefile +@@ -952,6 +952,15 @@ ASPP_ERROR = \ + runtime/%.o: runtime/%.S + $(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR) + ++# $(OC_DEBUG_CPPFLAGS) and $(OC_INSTR_CPPFLAGS) are still used in the two ++# recipes just below instead of the correct $(ocamlrund_CPPFLAGS) and ++# $(ocamlruni_CPPFLAGS). This has been fixed on trunk, but in the ++# 5.0 maintenance branch here we just define default values for those OC_* ++# variables to avoid an undefined-variable warning, preserving exactly the ++# (somewhat strange) behaviour of the 5.0.0 release. ++OC_DEBUG_CPPFLAGS ?= ++OC_INSTR_CPPFLAGS ?= ++ + runtime/%.d.o: runtime/%.S + $(ASPP) $(OC_ASPPFLAGS) $(OC_DEBUG_CPPFLAGS) -o $@ $< || $(ASPP_ERROR) + +-- +2.41.0 + diff --git a/0008-Refactor-the-initialization-of-bytecode-threading-11.patch b/0008-Refactor-the-initialization-of-bytecode-threading-11.patch deleted file mode 100644 index d6b3510..0000000 --- a/0008-Refactor-the-initialization-of-bytecode-threading-11.patch +++ /dev/null @@ -1,101 +0,0 @@ -From b9afeb8b8dc8c32f9f1c74c8402de9e6265e9d5f Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Fri, 1 Jul 2022 17:14:44 +0200 -Subject: [PATCH 08/24] Refactor the initialization of bytecode threading - (#11378) - -Refactor the initialization of bytecode threading - -Use a function `caml_init_thread_code` instead of exposing global variables -`caml_instr_table` and `caml_instr_base`. - -This should silence the GCC 12 "dangling-pointer" warning. - -Fixes: #11358 ---- - Changes | 5 +++++ - runtime/caml/fix_code.h | 3 +-- - runtime/fix_code.c | 10 ++++++++-- - runtime/interp.c | 7 +++---- - 4 files changed, 17 insertions(+), 8 deletions(-) - -diff --git a/Changes b/Changes -index 590268262d..7ea4475b8d 100644 ---- a/Changes -+++ b/Changes -@@ -14,6 +14,11 @@ OCaml 4.14 maintenance branch - (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and - Sebastien Hinderer) - -+- #11358, #11378: Refactor the initialization of bytecode threading. -+ This avoids a "dangling pointer" warning of GCC 12.1. -+ (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) -+ -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - -diff --git a/runtime/caml/fix_code.h b/runtime/caml/fix_code.h -index 83c393a17d..2eafaa814b 100644 ---- a/runtime/caml/fix_code.h -+++ b/runtime/caml/fix_code.h -@@ -34,8 +34,7 @@ void caml_set_instruction (code_t pos, opcode_t instr); - int caml_is_instruction (opcode_t instr1, opcode_t instr2); - - #ifdef THREADED_CODE --extern char ** caml_instr_table; --extern char * caml_instr_base; -+void caml_init_thread_code(void ** instr_table, void * instr_base); - void caml_thread_code (code_t code, asize_t len); - #endif - -diff --git a/runtime/fix_code.c b/runtime/fix_code.c -index aa059be5df..5584019867 100644 ---- a/runtime/fix_code.c -+++ b/runtime/fix_code.c -@@ -82,8 +82,14 @@ void caml_fixup_endianness(code_t code, asize_t len) - - #ifdef THREADED_CODE - --char ** caml_instr_table; --char * caml_instr_base; -+static char ** caml_instr_table; -+static char * caml_instr_base; -+ -+void caml_init_thread_code(void ** instr_table, void * instr_base) -+{ -+ caml_instr_table = (char **) instr_table; -+ caml_instr_base = (char *) instr_base; -+} - - static int* opcode_nargs = NULL; - int* caml_init_opcode_nargs(void) -diff --git a/runtime/interp.c b/runtime/interp.c -index a59811c87d..e6700994bc 100644 ---- a/runtime/interp.c -+++ b/runtime/interp.c -@@ -50,9 +50,9 @@ sp is a local copy of the global variable Caml_state->extern_sp. */ - #ifdef THREADED_CODE - # define Instruct(name) lbl_##name - # if defined(ARCH_SIXTYFOUR) && !defined(ARCH_CODE32) --# define Jumptbl_base ((char *) &&lbl_ACC0) -+# define Jumptbl_base &&lbl_ACC0 - # else --# define Jumptbl_base ((char *) 0) -+# define Jumptbl_base 0 - # define jumptbl_base ((char *) 0) - # endif - # ifdef DEBUG -@@ -249,8 +249,7 @@ value caml_interprete(code_t prog, asize_t prog_size) - - if (prog == NULL) { /* Interpreter is initializing */ - #ifdef THREADED_CODE -- caml_instr_table = (char **) jumptable; -- caml_instr_base = Jumptbl_base; -+ caml_init_thread_code(jumptable, Jumptbl_base); - #endif - return Val_unit; - } --- -2.37.0.rc2 - diff --git a/0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch b/0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch deleted file mode 100644 index 7f1ef7e..0000000 --- a/0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 7315c73e283eca4313403e959241d86d63f88d58 Mon Sep 17 00:00:00 2001 -From: Gabriel Scherer -Date: Tue, 5 Jul 2022 09:27:54 +0200 -Subject: [PATCH 09/24] Merge pull request #11397 from - Octachron/tast_mapper_fix_for_with_modtype - - #11387: clean up envs inside Twith_modtype(subst) - -(cherry picked from commit d9afa408c612e74a266b95f0fa25bb1efde72112) ---- - Changes | 3 +++ - typing/tast_mapper.ml | 6 +++--- - 2 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/Changes b/Changes -index 7ea4475b8d..0fe7732a02 100644 ---- a/Changes -+++ b/Changes -@@ -18,6 +18,9 @@ OCaml 4.14 maintenance branch - This avoids a "dangling pointer" warning of GCC 12.1. - (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) - -+- #11387, module type with constraints no longer crash the compiler in presence -+ of both shadowing warnings and the `-bin-annot` compiler flag. -+ (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer) - - OCaml 4.14.0 (28 March 2022) - ---------------------------- -diff --git a/typing/tast_mapper.ml b/typing/tast_mapper.ml -index 6d359a59a7..9eb7f64e88 100644 ---- a/typing/tast_mapper.ml -+++ b/typing/tast_mapper.ml -@@ -458,10 +458,10 @@ let module_type sub x = - let with_constraint sub = function - | Twith_type decl -> Twith_type (sub.type_declaration sub decl) - | Twith_typesubst decl -> Twith_typesubst (sub.type_declaration sub decl) -+ | Twith_modtype mty -> Twith_modtype (sub.module_type sub mty) -+ | Twith_modtypesubst mty -> Twith_modtypesubst (sub.module_type sub mty) - | Twith_module _ -- | Twith_modsubst _ -- | Twith_modtype _ -- | Twith_modtypesubst _ as d -> d -+ | Twith_modsubst _ as d -> d - - let open_description sub od = - {od with open_env = sub.env sub od.open_env} --- -2.37.0.rc2 - diff --git a/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch b/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch new file mode 100644 index 0000000..0c10ff5 --- /dev/null +++ b/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch @@ -0,0 +1,24 @@ +From 5f3f8bf734bdc02adc69cf92f066547bd71e8a25 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Mon, 20 Feb 2023 20:31:31 +0000 +Subject: [PATCH 09/18] Provide a default for $(OCAMLDEPFLAGS) + +--- + Makefile.common | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.common b/Makefile.common +index 536e2a28ca..e2a9176a5c 100644 +--- a/Makefile.common ++++ b/Makefile.common +@@ -169,6 +169,7 @@ endef # PROGRAM_SYNONYM + # should take place *before* Makefile.common is included. + + OCAMLDEP ?= $(BEST_OCAMLDEP) ++OCAMLDEPFLAGS ?= + OC_OCAMLDEPFLAGS = -slash + OC_OCAMLDEPDIRS = + OCAMLDEP_CMD = $(OCAMLDEP) $(OC_OCAMLDEPFLAGS) \ +-- +2.41.0 + diff --git a/0010-Merge-pull-request-11396-from-gasche-fix11392.patch b/0010-Merge-pull-request-11396-from-gasche-fix11392.patch deleted file mode 100644 index 0b9cbd6..0000000 --- a/0010-Merge-pull-request-11396-from-gasche-fix11392.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 9f72a2a2fec0902aeae5e5082779bb197657c1f4 Mon Sep 17 00:00:00 2001 -From: Gabriel Scherer -Date: Tue, 5 Jul 2022 10:38:50 +0200 -Subject: [PATCH 10/24] Merge pull request #11396 from gasche/fix11392 - -Fix 11392 (assertion failure on external with -rectypes) - -(cherry picked from commit 724cefb8b0f1f96ef5181fffc24975ac9460ce3e) ---- - Changes | 3 ++ - testsuite/tests/typing-external/pr11392.ml | 34 ++++++++++++++++++++++ - typing/typedecl.ml | 2 +- - 3 files changed, 38 insertions(+), 1 deletion(-) - create mode 100644 testsuite/tests/typing-external/pr11392.ml - -diff --git a/Changes b/Changes -index 0fe7732a02..8182f5ced7 100644 ---- a/Changes -+++ b/Changes -@@ -22,6 +22,9 @@ OCaml 4.14 maintenance branch - of both shadowing warnings and the `-bin-annot` compiler flag. - (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer) - -+- #11392, #11392: assertion failure with -rectypes and external definitions -+ (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - -diff --git a/testsuite/tests/typing-external/pr11392.ml b/testsuite/tests/typing-external/pr11392.ml -new file mode 100644 -index 0000000000..91c8ea77eb ---- /dev/null -+++ b/testsuite/tests/typing-external/pr11392.ml -@@ -0,0 +1,34 @@ -+(* TEST -+ * expect -+*) -+ -+type 'self nat = -+ | Z -+ | S of 'self -+;; -+[%%expect{| -+type 'self nat = Z | S of 'self -+|}] -+ -+ -+ -+(* without rectypes: rejected *) -+external cast : int -> 'self nat as 'self = "%identity" -+;; -+[%%expect{| -+Line 1, characters 16-41: -+1 | external cast : int -> 'self nat as 'self = "%identity" -+ ^^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: This alias is bound to type int -> 'a nat -+ but is used as an instance of type 'a -+ The type variable 'a occurs inside int -> 'a nat -+|}] -+ -+#rectypes;; -+ -+(* with rectypes: accepted (used to crash) *) -+external cast : int -> 'self nat as 'self = "%identity" -+;; -+[%%expect{| -+external cast : int -> 'a nat as 'a = "%identity" -+|}] -diff --git a/typing/typedecl.ml b/typing/typedecl.ml -index 9d38ebe97e..d00c0fc450 100644 ---- a/typing/typedecl.ml -+++ b/typing/typedecl.ml -@@ -1334,7 +1334,7 @@ let rec parse_native_repr_attributes env core_type ty ~global_repr = - parse_native_repr_attributes env ct2 t2 ~global_repr - in - (repr_arg :: repr_args, repr_res) -- | Ptyp_poly (_, t), _, _ -> -+ | (Ptyp_poly (_, t) | Ptyp_alias (t, _)), _, _ -> - parse_native_repr_attributes env t ty ~global_repr - | Ptyp_arrow _, _, _ | _, Tarrow _, _ -> assert false - | _ -> ([], make_native_repr env core_type ty ~global_repr) --- -2.37.0.rc2 - diff --git a/0010-Report-all-post-build-failures.patch b/0010-Report-all-post-build-failures.patch new file mode 100644 index 0000000..bf8f6e2 --- /dev/null +++ b/0010-Report-all-post-build-failures.patch @@ -0,0 +1,41 @@ +From 7f4569e22c2a19d51324c44a2954b10427df2cd8 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Tue, 21 Feb 2023 14:44:21 +0000 +Subject: [PATCH 10/18] Report all post-build failures + +Rather than just reporting un-prefixed symbol names, also report +undefined variables. +--- + tools/ci/actions/runner.sh | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh +index 26123b40d1..6e5a30f73a 100755 +--- a/tools/ci/actions/runner.sh ++++ b/tools/ci/actions/runner.sh +@@ -67,13 +67,19 @@ Build () { + else + script --return --command "$MAKE_WARN" build.log + fi +- echo Ensuring that all names are prefixed in the runtime +- ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a ++ failed=0 + if grep -Fq ' warning: undefined variable ' build.log; then + echo Undefined Makefile variables detected +- exit 1 ++ failed=1 + fi + rm build.log ++ echo Ensuring that all names are prefixed in the runtime ++ if ! ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a ; then ++ failed=1 ++ fi ++ if ((failed)); then ++ exit 1 ++ fi + } + + Test () { +-- +2.41.0 + diff --git a/0011-Document-limitation-on-caml_callbackN-11409.patch b/0011-Document-limitation-on-caml_callbackN-11409.patch deleted file mode 100644 index bf09575..0000000 --- a/0011-Document-limitation-on-caml_callbackN-11409.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9d4faca7af8d9849093ff8d36509ad60608ac239 Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Thu, 7 Jul 2022 18:22:22 +0200 -Subject: [PATCH 11/24] Document limitation on `caml_callbackN` (#11409) - -The `args` argument array must not be declared with `CAMLlocalN`, otherwise -the array can be registered a second time by `caml_callbackN`, confusing -the compactor. - -Also: suggests using a C99 compound literal, it looks good and avoids the issue. - -Fixes: #11045 ---- - Changes | 7 +++++++ - manual/src/cmds/intf-c.etex | 4 ++++ - 2 files changed, 11 insertions(+) - -diff --git a/Changes b/Changes -index 8182f5ced7..13eb7fef98 100644 ---- a/Changes -+++ b/Changes -@@ -25,6 +25,13 @@ OCaml 4.14 maintenance branch - - #11392, #11392: assertion failure with -rectypes and external definitions - (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) - -+### Manual and documentation: -+ -+- #11045, #11409: document that the array argument to `caml_callbackN` -+ must not have been declared by `CAMLlocalN`. -+ (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.) -+ -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - -diff --git a/manual/src/cmds/intf-c.etex b/manual/src/cmds/intf-c.etex -index 7cd50a1372..bb420c2940 100644 ---- a/manual/src/cmds/intf-c.etex -+++ b/manual/src/cmds/intf-c.etex -@@ -1449,6 +1449,10 @@ the value \var{a} and returns the value returned by~\var{f}. - (a curried OCaml function with three arguments) to \var{a}, \var{b} and \var{c}. - \item "caml_callbackN("\var{f, n, args}")" applies the functional value \var{f} - to the \var{n} arguments contained in the C array of values \var{args}. -+The array \var{args} must \emph{not} be declared with "CAMLlocalN". -+It should be declared as "value "\var{args}"["\var{n}"];". -+Alternatively, a C99 compound literal can be used: -+"caml_callbackN("\var{f, n, }"(value[]){"\nth{arg}{1}, \ldots, \nth{arg}{n}"})". - \end{itemize} - If the function \var{f} does not return, but raises an exception that - escapes the scope of the application, then this exception is --- -2.37.0.rc2 - diff --git a/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch b/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch new file mode 100644 index 0000000..5ffca5f --- /dev/null +++ b/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch @@ -0,0 +1,24 @@ +From 0f6dc503bf3814e5547ffb4e9d6ea0a75ffd1ec0 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Wed, 22 Feb 2023 10:47:00 +0000 +Subject: [PATCH 11/18] Finish off removal of FORCE_INSTRUMENTED_RUNTIME + +--- + utils/Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/utils/Makefile b/utils/Makefile +index 0fcbc59ce5..efd8574fa5 100644 +--- a/utils/Makefile ++++ b/utils/Makefile +@@ -90,7 +90,6 @@ config_main.ml: config.mlp $(ROOTDIR)/Makefile.config Makefile config.common.ml + $(call SUBST,FUNCTION_SECTIONS) \ + $(call SUBST,CC_HAS_DEBUG_PREFIX_MAP) \ + $(call SUBST,AS_HAS_DEBUG_PREFIX_MAP) \ +- $(call SUBST,FORCE_INSTRUMENTED_RUNTIME) \ + $< > $@ + cat config.common.ml >> $@ + +-- +2.41.0 + diff --git a/0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch b/0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch deleted file mode 100644 index 739914c..0000000 --- a/0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch +++ /dev/null @@ -1,327 +0,0 @@ -From 50fbd6685ec88f1dc81451923d7c80fb0d18ca8b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= -Date: Thu, 14 Apr 2022 19:19:46 +0200 -Subject: [PATCH 12/24] Stop calling ranlib on created / installed libraries - (#11184) - -`ranlib` seems unnecessary if a POSIX-compliant `ar` is used and time stamps are preserved when a `.a` file is installed. - -(cherry picked from commit c8e41bade529998c4e66975c88fabf3ac47d7078) ---- - Changes | 5 +++++ - INSTALL.adoc | 4 ++-- - Makefile | 2 -- - Makefile.build_config.in | 2 +- - Makefile.config.in | 4 ---- - configure | Bin 581827 -> 581549 bytes - configure.ac | 16 +++------------- - otherlibs/Makefile.otherlibs.common | 2 -- - otherlibs/dynlink/Makefile | 11 +++++------ - otherlibs/systhreads/Makefile | 3 --- - stdlib/Makefile | 1 - - tools/ocamlmklib.ml | 6 ++---- - utils/Makefile | 1 - - utils/ccomp.ml | 8 ++------ - utils/config.mli | 3 --- - utils/config.mlp | 2 -- - 16 files changed, 20 insertions(+), 50 deletions(-) - -diff --git a/Changes b/Changes -index 13eb7fef98..6f92ee9965 100644 ---- a/Changes -+++ b/Changes -@@ -25,6 +25,11 @@ OCaml 4.14 maintenance branch - - #11392, #11392: assertion failure with -rectypes and external definitions - (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) - -+### Compiler user-interface and warnings: -+ -+- #11184: Stop calling ranlib on created / installed libraries -+ (Sébastien Hinderer, review by Xavier Leroy) -+ - ### Manual and documentation: - - - #11045, #11409: document that the array argument to `caml_callbackN` -diff --git a/INSTALL.adoc b/INSTALL.adoc -index f4199ca49a..08d67ebbbe 100644 ---- a/INSTALL.adoc -+++ b/INSTALL.adoc -@@ -43,8 +43,8 @@ - * Under Cygwin, the `gcc-core` package is required. `flexdll` is also necessary - for shared library support. - --* Binutils including `ar`, `ranlib`, and `strip` are required if your -- distribution does not already provide them with the C compiler. -+* Binutils including `ar` and `strip` are required if your distribution -+ does not already provide them with the C compiler. - - == Configuration - -diff --git a/Makefile b/Makefile -index 3c74bc79df..0e92785da2 100644 ---- a/Makefile -+++ b/Makefile -@@ -585,8 +585,6 @@ endif - ifeq "$(INSTALL_OCAMLNAT)" "true" - $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)" - endif -- cd "$(INSTALL_COMPLIBDIR)" && \ -- $(RANLIB) ocamlcommon.$(A) ocamlbytecomp.$(A) ocamloptcomp.$(A) - - # Installation of the *.ml sources of compiler-libs - .PHONY: install-compiler-sources -diff --git a/Makefile.build_config.in b/Makefile.build_config.in -index eeac09dd76..4d6705d252 100644 ---- a/Makefile.build_config.in -+++ b/Makefile.build_config.in -@@ -20,7 +20,7 @@ - # $(ROOTDIR) has been defined. - - include $(ROOTDIR)/Makefile.config --INSTALL ?= @INSTALL@ -+INSTALL ?= @INSTALL@ -p - INSTALL_DATA ?= @INSTALL_DATA@ - INSTALL_PROG ?= @INSTALL_PROGRAM@ - -diff --git a/Makefile.config.in b/Makefile.config.in -index eb3d85eb1d..4badb74c3f 100644 ---- a/Makefile.config.in -+++ b/Makefile.config.in -@@ -88,10 +88,6 @@ LDFLAGS?=@LDFLAGS@ - ### How to invoke the C preprocessor through the C compiler - CPP=@CPP@ - --### How to invoke ranlib --RANLIB=@RANLIB@ --RANLIBCMD=@RANLIBCMD@ -- - ### How to invoke ar - ARCMD=@AR@ - -diff --git a/configure b/configure -index 8a2c007fd221bc897a255b4aa80c7f23710fcb10..73ce66bfa0a3de5e886a88c973b2db288b5e4d03 100755 -GIT binary patch -delta 91 -zcmX?nP-EJyt==60{S#P(`nZ^plY(UJueamx2P^N?Ror2wRCOHK#ZgE(H{K3{og6RYK -zU>4b?CTHZsIKV)ezG4dNJs|}(H3gMwh?TVpF)A8{?X6Q;ftU@5*|)b&< - assert(String.length Config.ar > 0); -- let r1 = -- command(Printf.sprintf "%s rc %s %s" -- Config.ar quoted_archive (quote_files file_list)) in -- if r1 <> 0 || String.length Config.ranlib = 0 -- then r1 -- else command(Config.ranlib ^ " " ^ quoted_archive) -+ command(Printf.sprintf "%s rc %s %s" -+ Config.ar quoted_archive (quote_files file_list)) - - let expand_libname cclibs = - cclibs |> List.map (fun cclib -> -diff --git a/utils/config.mli b/utils/config.mli -index 7f70a52d52..94dee3cb92 100644 ---- a/utils/config.mli -+++ b/utils/config.mli -@@ -82,9 +82,6 @@ val mkexe: string - val mkmaindll: string - (** The linker command line to build main programs as dlls. *) - --val ranlib: string --(** Command to randomize a library, or "" if not needed *) -- - val default_rpath: string - (** Option to add a directory to be searched for libraries at runtime - (used by ocamlmklib) *) -diff --git a/utils/config.mlp b/utils/config.mlp -index 44c6ff8fa5..f758a9b483 100644 ---- a/utils/config.mlp -+++ b/utils/config.mlp -@@ -54,7 +54,6 @@ let native_c_compiler = - c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags - let native_c_libraries = "%%NATIVECCLIBS%%" - let native_pack_linker = "%%PACKLD%%" --let ranlib = "%%RANLIBCMD%%" - let default_rpath = "%%RPATH%%" - let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%" - let ar = "%%ARCMD%%" -@@ -177,7 +176,6 @@ let configuration_variables = - p "bytecomp_c_libraries" bytecomp_c_libraries; - p "native_c_libraries" native_c_libraries; - p "native_pack_linker" native_pack_linker; -- p "ranlib" ranlib; - p "architecture" architecture; - p "model" model; - p_int "int_size" Sys.int_size; --- -2.37.0.rc2 - diff --git a/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch b/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch new file mode 100644 index 0000000..5d87237 --- /dev/null +++ b/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch @@ -0,0 +1,27 @@ +From ffb2022797986324213891a59c02af46269b5c17 Mon Sep 17 00:00:00 2001 +From: Damien Doligez +Date: Mon, 17 Apr 2023 11:36:32 +0200 +Subject: [PATCH 12/18] suppress spurious alert when compiling stdlib + documentation + +(cherry picked from commit 5c0fb8e23865fdbf151bdbe15d91176903c284d3) +--- + api_docgen/ocamldoc/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/api_docgen/ocamldoc/Makefile b/api_docgen/ocamldoc/Makefile +index 1b3d5f57f7..b6419ae50d 100644 +--- a/api_docgen/ocamldoc/Makefile ++++ b/api_docgen/ocamldoc/Makefile +@@ -44,7 +44,7 @@ $(libref:%=build/libref/%.odoc): build/libref/%.odoc: %.mli | build/libref + $(OCAMLDOC_RUN) -nostdlib -hide Stdlib -lib Stdlib \ + -pp \ + "$(AWK) -v ocamldoc=true -f ../../stdlib/expand_module_aliases.awk" \ +- $(DOC_STDLIB_INCLUDES) -hide-warnings $< -dump $@ ++ $(DOC_STDLIB_INCLUDES) -hide-warnings -alert -all $< -dump $@ + + $(compilerlibref:%=build/compilerlibref/%.odoc):\ + build/compilerlibref/%.odoc: %.mli | build/compilerlibref +-- +2.41.0 + diff --git a/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch b/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch new file mode 100644 index 0000000..ed6f114 --- /dev/null +++ b/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch @@ -0,0 +1,70 @@ +From 4cc4eb8b0d71c64c5252d6764f4c4b0aa6020995 Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Sat, 3 Jun 2023 18:02:24 +0100 +Subject: [PATCH 13/18] Merge pull request #12285 from + smorimoto/update-deprecated-actions + +Update deprecated GitHub Actions + +(cherry picked from commit eadb05a504e0738f246a7dc846a442793005a27a) +--- + .github/workflows/build.yml | 8 ++++---- + .github/workflows/hygiene.yml | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml +index ae0fcace20..933c14a926 100644 +--- a/.github/workflows/build.yml ++++ b/.github/workflows/build.yml +@@ -18,7 +18,7 @@ jobs: + manual_changed: ${{ steps.manual.outputs.manual_changed }} + steps: + - name: Checkout +- uses: actions/checkout@v2 ++ uses: actions/checkout@v3 + - name: Check for manual changes + id: manual + run: >- +@@ -45,7 +45,7 @@ jobs: + git config --local --unset http.https://github.com/.extraheader + tar --zstd -cf /tmp/sources.tar.zstd . + - name: Upload Artifact +- uses: actions/upload-artifact@v2 ++ uses: actions/upload-artifact@v3 + with: + name: compiler + path: /tmp/sources.tar.zstd +@@ -57,7 +57,7 @@ jobs: + runs-on: ubuntu-latest + steps: + - name: Download Artifact +- uses: actions/download-artifact@v2 ++ uses: actions/download-artifact@v3 + with: + name: compiler + - name: Unpack Artifact +@@ -137,7 +137,7 @@ jobs: + - debug-s4096 + steps: + - name: Download artifact +- uses: actions/download-artifact@v2 ++ uses: actions/download-artifact@v3 + with: + name: compiler + - name: Unpack Artifact +diff --git a/.github/workflows/hygiene.yml b/.github/workflows/hygiene.yml +index e89efd2f47..3b2e10795f 100644 +--- a/.github/workflows/hygiene.yml ++++ b/.github/workflows/hygiene.yml +@@ -17,7 +17,7 @@ jobs: + # context variable. + if: failure() + +- - uses: actions/checkout@v2 ++ - uses: actions/checkout@v3 + with: + fetch-depth: 50 + +-- +2.41.0 + diff --git a/0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch b/0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch deleted file mode 100644 index 7d5b111..0000000 --- a/0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch +++ /dev/null @@ -1,27 +0,0 @@ -From c04f2fbb3ae4dc8f67882bfe35d8565f016dee0f Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Fri, 15 Jul 2022 14:23:10 +0200 -Subject: [PATCH 13/24] tests/lib-bigarray-2/has-gfortran.sh: don't print - anything on stdout - -It confuses the summarize.awk script. ---- - testsuite/tests/lib-bigarray-2/has-gfortran.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/testsuite/tests/lib-bigarray-2/has-gfortran.sh b/testsuite/tests/lib-bigarray-2/has-gfortran.sh -index 051122113a..7eef1e662e 100644 ---- a/testsuite/tests/lib-bigarray-2/has-gfortran.sh -+++ b/testsuite/tests/lib-bigarray-2/has-gfortran.sh -@@ -5,7 +5,7 @@ if ! which gfortran > /dev/null 2>&1; then - elif ! grep -q '^CC=gcc' ${ocamlsrcdir}/Makefile.config; then - echo "OCaml was not compiled with gcc" > ${ocamltest_response} - test_result=${TEST_SKIP} --elif gcc --version 2>&1 | grep 'Apple clang version'; then -+elif gcc --version 2>&1 | grep -q 'Apple clang version'; then - echo "OCaml was not compiled with gcc" > ${ocamltest_response} - test_result=${TEST_SKIP} - else --- -2.37.0.rc2 - diff --git a/0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch b/0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch deleted file mode 100644 index 5a53fad..0000000 --- a/0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch +++ /dev/null @@ -1,147 +0,0 @@ -From 4bb84be29e2ea5eb9f979c5e3bcbde1933aa300e Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Mon, 18 Jul 2022 10:08:53 +0200 -Subject: [PATCH 14/24] Merge pull request #11417 from - lpw25/fix-virtual-class-type-constrs - -Fix regression allowing virtual methods in non-virtual classes - -(cherry picked from commit 4be851ed8ea1f0c6be13dce04dcc97493c6c004b) ---- - Changes | 13 +----- - testsuite/tests/typing-objects/Tests.ml | 61 +++++++++++++++++++++++++ - typing/typeclass.ml | 11 +++++ - 3 files changed, 74 insertions(+), 11 deletions(-) - -diff --git a/Changes b/Changes -index 6f92ee9965..a9a9ee92f4 100644 ---- a/Changes -+++ b/Changes -@@ -25,17 +25,8 @@ OCaml 4.14 maintenance branch - - #11392, #11392: assertion failure with -rectypes and external definitions - (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev) - --### Compiler user-interface and warnings: -- --- #11184: Stop calling ranlib on created / installed libraries -- (Sébastien Hinderer, review by Xavier Leroy) -- --### Manual and documentation: -- --- #11045, #11409: document that the array argument to `caml_callbackN` -- must not have been declared by `CAMLlocalN`. -- (Xavier Leroy, report by Stephen Dolan, review by Gabriel Scherer.) -- -+- #11417: Fix regression allowing virtual methods in non-virtual classes. -+ (Leo White, review by Florian Angeletti) - - OCaml 4.14.0 (28 March 2022) - ---------------------------- -diff --git a/testsuite/tests/typing-objects/Tests.ml b/testsuite/tests/typing-objects/Tests.ml -index 3dcd87c43c..9cab28e432 100644 ---- a/testsuite/tests/typing-objects/Tests.ml -+++ b/testsuite/tests/typing-objects/Tests.ml -@@ -1344,3 +1344,64 @@ let _ = (new foo)#f true - class foo : object method f : bool -> bool end - - : bool = true - |}];; -+ -+ -+class c : object -+ method virtual m : int -+end = object -+ method m = 9 -+ end -+[%%expect {| -+Lines 1-3, characters 10-3: -+1 | ..........object -+2 | method virtual m : int -+3 | end......... -+Error: This non-virtual class type has virtual methods. -+ The following methods are virtual : m -+|}];; -+ -+class virtual c : object -+ method virtual m : int -+end = object -+ method m = 42 -+ end -+[%%expect {| -+class virtual c : object method virtual m : int end -+|}];; -+ -+class virtual cv = object -+ method virtual m : int -+ end -+ -+class c : cv = object -+ method m = 42 -+ end -+[%%expect {| -+class virtual cv : object method virtual m : int end -+Line 5, characters 10-12: -+5 | class c : cv = object -+ ^^ -+Error: This non-virtual class type has virtual methods. -+ The following methods are virtual : m -+|}];; -+ -+class virtual c : cv = object -+ method m = 41 -+ end -+[%%expect {| -+class virtual c : cv -+|}];; -+ -+class c = cv -+[%%expect {| -+Line 1, characters 10-12: -+1 | class c = cv -+ ^^ -+Error: This non-virtual class has virtual methods. -+ The following methods are virtual : m -+|}];; -+ -+class virtual c = cv -+[%%expect {| -+class virtual c : cv -+|}];; -diff --git a/typing/typeclass.ml b/typing/typeclass.ml -index fedbc0e025..8fa8523cc9 100644 ---- a/typing/typeclass.ml -+++ b/typing/typeclass.ml -@@ -177,6 +177,13 @@ let check_virtual loc env virt kind sign = - | meths, vars -> - raise(Error(loc, env, Virtual_class(kind, meths, vars))) - -+let rec check_virtual_clty loc env virt kind clty = -+ match clty with -+ | Cty_constr(_, _, clty) | Cty_arrow(_, _, clty) -> -+ check_virtual_clty loc env virt kind clty -+ | Cty_signature sign -> -+ check_virtual loc env virt kind sign -+ - (* Return the constructor type associated to a class type *) - let rec constructor_type constr cty = - match cty with -@@ -398,6 +405,8 @@ and class_type_aux env virt self_scope scty = - ) styl params - in - let typ = Cty_constr (path, params, clty) in -+ (* Check for unexpected virtual methods *) -+ check_virtual_clty scty.pcty_loc env virt Class_type typ; - cltyp (Tcty_constr ( path, lid , ctys)) typ - - | Pcty_signature pcsig -> -@@ -1077,6 +1086,8 @@ and class_expr_aux cl_num val_env met_env virt self_scope scl = - try Ctype.unify val_env ty' ty with Ctype.Unify err -> - raise(Error(cty'.ctyp_loc, val_env, Parameter_mismatch err))) - tyl params; -+ (* Check for unexpected virtual methods *) -+ check_virtual_clty scl.pcl_loc val_env virt Class clty'; - let cl = - rc {cl_desc = Tcl_ident (path, lid, tyl); - cl_loc = scl.pcl_loc; --- -2.37.0.rc2 - diff --git a/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch b/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch new file mode 100644 index 0000000..cf8c766 --- /dev/null +++ b/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch @@ -0,0 +1,40 @@ +From af3a67cd06e07825c63b70a038cf90481039b1ed Mon Sep 17 00:00:00 2001 +From: David Allsopp +Date: Fri, 9 Jun 2023 21:47:51 +0100 +Subject: [PATCH 14/18] Merge pull request #12286 from + smorimoto/replace-set-output + +Replace the set-output command with the GITHUB_OUTPUT environment file + +(cherry picked from commit 50054a632a5ac3bb4199276617d358e3fa4a108b) +--- + tools/ci/actions/check-manual-modified.sh | 2 +- + tools/ci/actions/runner.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/ci/actions/check-manual-modified.sh b/tools/ci/actions/check-manual-modified.sh +index dc8b6bd809..c5826c1fd0 100755 +--- a/tools/ci/actions/check-manual-modified.sh ++++ b/tools/ci/actions/check-manual-modified.sh +@@ -32,4 +32,4 @@ else + fi + + echo "Manual altered: $result" +-echo "::set-output name=manual_changed::$result" ++echo "manual_changed=$result" >>"$GITHUB_OUTPUT" +diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh +index 6e5a30f73a..295e58a83e 100755 +--- a/tools/ci/actions/runner.sh ++++ b/tools/ci/actions/runner.sh +@@ -159,7 +159,7 @@ ReportBuildStatus () { + else + STATUS='success' + fi +- echo "::set-output name=build-status::$STATUS" ++ echo "build-status=$STATUS" >>"$GITHUB_OUTPUT" + exit $CODE + } + +-- +2.41.0 + diff --git a/0015-Do-not-elide-the-whole-module-type-error-message-114.patch b/0015-Do-not-elide-the-whole-module-type-error-message-114.patch deleted file mode 100644 index 2922112..0000000 --- a/0015-Do-not-elide-the-whole-module-type-error-message-114.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 54eef17aeecfdbc6eeecd60b9cc64cd7c0129429 Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Wed, 20 Jul 2022 10:58:18 +0200 -Subject: [PATCH 15/24] Do not elide the whole module type error message - (#11416) - -(cherry picked from commit 8218be9e2b24907b8558776a34d12032bcc42496) ---- - Changes | 5 +- - .../inclusion_errors_elision.ml | 93 +++++++++++++++++++ - typing/includemod_errorprinter.ml | 11 ++- - 3 files changed, 107 insertions(+), 2 deletions(-) - create mode 100644 testsuite/tests/typing-modules/inclusion_errors_elision.ml - -diff --git a/Changes b/Changes -index a9a9ee92f4..6b9855f707 100644 ---- a/Changes -+++ b/Changes -@@ -14,7 +14,10 @@ OCaml 4.14 maintenance branch - (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and - Sebastien Hinderer) - --- #11358, #11378: Refactor the initialization of bytecode threading. -+- #11314, #11416: fix non-informative error message for module inclusion -+ (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer) -+ -+- #11358, #11379: Refactor the initialization of bytecode threading, - This avoids a "dangling pointer" warning of GCC 12.1. - (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer) - -diff --git a/testsuite/tests/typing-modules/inclusion_errors_elision.ml b/testsuite/tests/typing-modules/inclusion_errors_elision.ml -new file mode 100644 -index 0000000000..3dbd0e67ff ---- /dev/null -+++ b/testsuite/tests/typing-modules/inclusion_errors_elision.ml -@@ -0,0 +1,93 @@ -+(* TEST -+ flags ="-keep-original-error-size" -+ * expect -+ *) -+ -+ -+module A = struct -+ type a and b and c and d -+end -+ -+module type S = sig -+ module B = A -+end -+ -+module C : S = struct -+ module B = struct -+ type a and b and c and d and e and f and g and h -+ end -+end -+[%%expect {| -+module A : sig type a and b and c and d end -+module type S = sig module B = A end -+Lines 9-13, characters 15-3: -+ 9 | ...............struct -+10 | module B = struct -+11 | type a and b and c and d and e and f and g and h -+12 | end -+13 | end -+Error: Signature mismatch: -+ ... -+ In module B: -+ Modules do not match: -+ sig -+ type a = B.a -+ and b = B.b -+ and c = B.c -+ and d = B.d -+ and e = B.e -+ and f = B.f -+ and g = B.g -+ and h = B.h -+ end -+ is not included in -+ (module A) -+|}] -+ -+module A = struct -+ type a and b and c and d -+end -+ -+module type S = sig -+ module type B = sig -+ module C = A -+ end -+end -+ -+module D : S = struct -+ module type B = sig -+ module C: sig -+ type a and b and c and d and e and f and g and h -+ end -+ end -+end -+[%%expect{| -+module A : sig type a and b and c and d end -+module type S = sig module type B = sig module C = A end end -+Lines 11-17, characters 15-3: -+11 | ...............struct -+12 | module type B = sig -+13 | module C: sig -+14 | type a and b and c and d and e and f and g and h -+15 | end -+16 | end -+17 | end -+Error: Signature mismatch: -+ ... -+ ... -+ ... -+ At position module type B = sig module C : end -+ Modules do not match: -+ sig -+ type a = C.a -+ and b = C.b -+ and c = C.c -+ and d = C.d -+ and e = C.e -+ and f = C.f -+ and g = C.g -+ and h = C.h -+ end -+ is not included in -+ (module A) -+|}] -diff --git a/typing/includemod_errorprinter.ml b/typing/includemod_errorprinter.ml -index 24d452fddc..b719e1627d 100644 ---- a/typing/includemod_errorprinter.ml -+++ b/typing/includemod_errorprinter.ml -@@ -709,7 +709,16 @@ let rec module_type ~expansion_token ~eqmode ~env ~before ~ctx diff = - functor_params ~expansion_token ~env ~before ~ctx d - | _ -> - let inner = if eqmode then eq_module_types else module_types in -- let next = dwith_context_and_elision ctx inner diff in -+ let next = -+ match diff.symptom with -+ | Mt_core _ -> -+ (* In those cases, the refined error messages for the current error -+ will at most add some minor comments on the current error. -+ It is thus better to avoid eliding the current error message. -+ *) -+ dwith_context ctx (inner diff) -+ | _ -> dwith_context_and_elision ctx inner diff -+ in - let before = next :: before in - module_type_symptom ~eqmode ~expansion_token ~env ~before ~ctx - diff.symptom --- -2.37.0.rc2 - diff --git a/0022-Don-t-add-rpaths-to-libraries.patch b/0015-Don-t-add-rpaths-to-libraries.patch similarity index 76% rename from 0022-Don-t-add-rpaths-to-libraries.patch rename to 0015-Don-t-add-rpaths-to-libraries.patch index 52b102b..9d3092b 100644 --- a/0022-Don-t-add-rpaths-to-libraries.patch +++ b/0015-Don-t-add-rpaths-to-libraries.patch @@ -1,17 +1,17 @@ -From e5312a9c481f91f2ca2cae1dc4176a78baaebf40 Mon Sep 17 00:00:00 2001 +From 0e07dfdb530734ef4db351ecc24c6363e36916ec Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 22/24] Don't add rpaths to libraries. +Subject: [PATCH 15/18] Don't add rpaths to libraries. --- utils/config.mlp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/config.mlp b/utils/config.mlp -index f758a9b483..ee17a737dc 100644 +index 7e1848f433..811d9134dd 100644 --- a/utils/config.mlp +++ b/utils/config.mlp -@@ -54,8 +54,8 @@ let native_c_compiler = +@@ -42,8 +42,8 @@ let native_c_compiler = c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags let native_c_libraries = "%%NATIVECCLIBS%%" let native_pack_linker = "%%PACKLD%%" @@ -23,5 +23,5 @@ index f758a9b483..ee17a737dc 100644 let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%% let mkdll, mkexe, mkmaindll = -- -2.37.0.rc2 +2.41.0 diff --git a/0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch b/0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch deleted file mode 100644 index 059fc99..0000000 --- a/0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 4d316cbe4b564be3aa57b969acf9ba03910dcba4 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Sat, 30 Jul 2022 11:51:12 +0200 -Subject: [PATCH 16/24] Merge pull request #11373 from dra27/flexlink-detect - -Don't use CFLAGS when testing flexlink - -(cherry picked from commit 004d313ce4fdb071d0aeda8736b9e74bb6c6a21b) ---- - Changes | 6 ++++++ - aclocal.m4 | 1 + - configure | Bin 581549 -> 581563 bytes - 3 files changed, 7 insertions(+) - -diff --git a/Changes b/Changes -index 6b9855f707..99907b950a 100644 ---- a/Changes -+++ b/Changes -@@ -1,6 +1,12 @@ - OCaml 4.14 maintenance branch - ----------------------------- - -+### Build system: -+ -+- #11370, #11373: Don't pass CFLAGS to flexlink during configure. -+ (David Allsopp, report by William Hu, review by Xavier Leroy and -+ Sébastien Hinderer) -+ - ### Bug fixes: - - - #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when -diff --git a/aclocal.m4 b/aclocal.m4 -index 7e49468e48..2bc0a1dcc9 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -328,6 +328,7 @@ AC_DEFUN([OCAML_TEST_FLEXLINK], [ - CC="$1 -chain $2 -exe" - LIBS="conftest2.$ac_objext" - CPPFLAGS="$3 $CPPFLAGS" -+ CFLAGS="" - AC_LINK_IFELSE( - [AC_LANG_SOURCE([int main() { return 0; }])], - [AC_MSG_RESULT([yes])], -diff --git a/configure b/configure -index 73ce66bfa0a3de5e886a88c973b2db288b5e4d03..c0dde03f183f86677b22a81238defdba60ad0080 100755 -GIT binary patch -delta 57 -zcmZ3xUwQX_<%Sl<7N!>F7M3lnkFIk%yZJb}2iqzsO&46x?lIl3ot?8??*=OnvjH*t -KcD)-M_3Qv?gA|zn - -delta 47 -zcmdnJUwQ3*<%Sl<7N!>F7M3lnkFHM-Tg~P?U2ZNbN4xb6Rv=~rV)pIUH#i#D0n)${ -AvH$=8 - --- -2.37.0.rc2 - diff --git a/0023-configure-Allow-user-defined-C-compiler-flags.patch b/0016-configure-Allow-user-defined-C-compiler-flags.patch similarity index 64% rename from 0023-configure-Allow-user-defined-C-compiler-flags.patch rename to 0016-configure-Allow-user-defined-C-compiler-flags.patch index fc715f8..f618d37 100644 --- a/0023-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0016-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,17 +1,17 @@ -From 2501cd8b3c40188e5eb6dd2158d61cfa023236c2 Mon Sep 17 00:00:00 2001 +From 9d3722c87ab15dfbc4e1a934e09ddc8253712d9c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 23/24] configure: Allow user defined C compiler flags. +Subject: [PATCH 16/18] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac -index ebb8bbdb80..9e6c0b9745 100644 +index a7974b0426..8068de3cfc 100644 --- a/configure.ac +++ b/configure.ac -@@ -680,6 +680,10 @@ AS_CASE([$host], +@@ -670,6 +670,10 @@ AS_CASE([$host], internal_cflags="$cc_warnings"], [common_cflags="-O"])]) @@ -19,9 +19,9 @@ index ebb8bbdb80..9e6c0b9745 100644 +common_cflags="$common_cflags $CFLAGS" +cclibs="$cclibs $LDFLAGS" + - internal_cppflags="-DCAML_NAME_SPACE $internal_cppflags" - # Enable SSE2 on x86 mingw to avoid using 80-bit registers. + AS_CASE([$host], + [i686-*-mingw32], -- -2.37.0.rc2 +2.41.0 diff --git a/0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch b/0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch deleted file mode 100644 index 433fda9..0000000 --- a/0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch +++ /dev/null @@ -1,55 +0,0 @@ -From defecc867a0b5653554c41b06e78c0f24f6c10a8 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Tue, 2 Aug 2022 17:21:08 +0100 -Subject: [PATCH 17/24] Merge pull request #11468 from dra27/i686-mingw-ipv6 - -Fix detection of IPv6 on mingw-w64 i686 - -(cherry picked from commit 98392895940cc1c18534280ae001b70fa5bf24c2) ---- - Changes | 4 ++++ - configure | Bin 581563 -> 581611 bytes - configure.ac | 1 + - 3 files changed, 5 insertions(+) - -diff --git a/Changes b/Changes -index 99907b950a..6b537edca9 100644 ---- a/Changes -+++ b/Changes -@@ -37,6 +37,10 @@ OCaml 4.14 maintenance branch - - #11417: Fix regression allowing virtual methods in non-virtual classes. - (Leo White, review by Florian Angeletti) - -+- #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for -+ mingw-w64 i686 port. -+ (David Allsopp, review by Xavier Leroy and Sébastien Hinderer) -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - -diff --git a/configure b/configure -index c0dde03f183f86677b22a81238defdba60ad0080..536a1cbee58a430692bfa3de11901e7e2f6b4ee2 100755 -GIT binary patch -delta 53 -zcmdnJU-|WZ<%Sl<7N!>F7M2#)7Pc+y(YK}x+-47$p3}xEG`-+2o7nVsH`#OBfnwVQ -JZgZ?=0RTku6-595 - -delta 53 -zcmV-50LuUCzazW9BY=bfgaU*Egam{Iga)(+TiTa!+Xo<*Y=#9AmvH?C7MJeX2fc@o -L+XuIh+X!0(RZ +Date: Wed, 26 Jan 2022 15:47:02 +0000 +Subject: [PATCH 17/18] configure: Only use OC_* for building executables + +Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for +"package notes" which contains build paths. + +In any case it seems pointless having both the OC_* variables and also +including the regular CFLAGS/LDFLAGS. Give me full control over what +ocamlopt uses. +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 8068de3cfc..19b23f9400 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -36,7 +36,7 @@ CONFIGURE_ARGS="$*" + # rely on $CFLAGS because these cannot be processed by flexlink (and are not + # passed) + mkexe_cmd='$(CC)' +-mkexe_cflags='$(OC_CFLAGS) $(CFLAGS)' ++mkexe_cflags='$(OC_CFLAGS)' + mkexe_extra_flags='' + mkexe_via_cc_extra_cmd='' + mkexe_ldflags_prefix='' +@@ -2208,7 +2208,7 @@ ${mkdll_ldflags}" + ],[ + mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' + mkdll_ldflags_exp="${oc_dll_ldflags} ${LDFLAGS}" +- mkexe="${mkexe} \$(OC_LDFLAGS) \$(LDFLAGS)" ++ mkexe="${mkexe} \$(OC_LDFLAGS)" + mkexe_exp="${mkexe_exp} ${oc_ldflags} ${LDFLAGS}" + ]) + mkdll="$mkdll $mkdll_ldflags" +-- +2.41.0 + diff --git a/0018-Fix-skiplist-test-failure-12346.patch b/0018-Fix-skiplist-test-failure-12346.patch new file mode 100644 index 0000000..1668adc --- /dev/null +++ b/0018-Fix-skiplist-test-failure-12346.patch @@ -0,0 +1,39 @@ +From 69fdedd5c7747370879abbdc2beb5d7a1bd72194 Mon Sep 17 00:00:00 2001 +From: Jerry James +Date: Fri, 7 Jul 2023 07:07:09 -0600 +Subject: [PATCH 18/18] Fix skiplist test failure (#12346) + +Fix -Wmaybe-uninitialized warning in skiplist test +Fix -Wunused-variable warning in skiplist test + +Co-authored-by: Xavier Leroy +(cherry picked from commit 3027e3308d685af03caf4f605b4bec55b04ed28e) +(cherry picked from commit 9aa7761060a7c40d11237599382b892dbcb79cb5) +--- + testsuite/tests/lf_skiplist/stubs.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/testsuite/tests/lf_skiplist/stubs.c b/testsuite/tests/lf_skiplist/stubs.c +index 991483e408..acc0eaf9cf 100644 +--- a/testsuite/tests/lf_skiplist/stubs.c ++++ b/testsuite/tests/lf_skiplist/stubs.c +@@ -64,7 +64,7 @@ static int get_len(struct lf_skipcell *p, struct lf_skipcell *end) { + static uintnat count_marks(struct lf_skiplist *sk) { + uintnat r = 0; + struct lf_skipcell *p = sk->head; +- uintptr_t succ; ++ uintptr_t succ = 0; + + while (p) { + for (int k = p->top_level; k >= 0; k--) { +@@ -135,7 +135,6 @@ inline static uintnat calc_right(uintnat id,uintnat turn,uintnat ndoms) { return + CAMLprim value insert_skiplist(value turn_val,value ndoms_val,value domain_id_val) { + CAMLparam3(turn_val,ndoms_val,domain_id_val); + uintnat domain_id = Long_val(domain_id_val); +- uintnat ndoms = Long_val(ndoms_val); + uintnat turn = Long_val(turn_val); + uintnat k = calc_key(domain_id,turn) ; + uintnat v = calc_value(domain_id) ; +-- +2.41.0 + diff --git a/0018-More-prudent-deallocation-of-alternate-signal-stack-.patch b/0018-More-prudent-deallocation-of-alternate-signal-stack-.patch deleted file mode 100644 index 20b430f..0000000 --- a/0018-More-prudent-deallocation-of-alternate-signal-stack-.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 1c4df0352d5f75464acdb27377ccd10d1e0ba10a Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Mon, 22 Aug 2022 16:06:50 +0200 -Subject: [PATCH 18/24] More prudent deallocation of alternate signal stack - (#11496) - -After `caml_setup_stack_overflow_detection` is called, -a C library can install its own alternate stack for signal handling. - -Therefore, `caml_stop_stack_overflow_detection` must not free the -alternate signal stack block, only the block that -`caml_setup_stack_overflow_detection` allocated. - -Fixes: #11489 ---- - Changes | 4 +++ - otherlibs/systhreads/st_stubs.c | 5 ++-- - runtime/caml/signals.h | 4 +-- - runtime/signals_byt.c | 4 +-- - runtime/signals_nat.c | 47 +++++++++++++++++++++------------ - 5 files changed, 41 insertions(+), 23 deletions(-) - -diff --git a/Changes b/Changes -index 6b537edca9..4d1bb10435 100644 ---- a/Changes -+++ b/Changes -@@ -41,6 +41,10 @@ OCaml 4.14 maintenance branch - mingw-w64 i686 port. - (David Allsopp, review by Xavier Leroy and Sébastien Hinderer) - -+- #11489, #11496: More prudent deallocation of alternate signal stack -+ (Xavier Leroy, report by @rajdakin, review by Florian Angeletti) -+ -+ - OCaml 4.14.0 (28 March 2022) - ---------------------------- - -diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c -index b7a6a9a6bb..043e07031e 100644 ---- a/otherlibs/systhreads/st_stubs.c -+++ b/otherlibs/systhreads/st_stubs.c -@@ -524,6 +524,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg) - { - caml_thread_t th = (caml_thread_t) arg; - value clos; -+ void * signal_stack; - #ifdef NATIVE_CODE - struct longjmp_buffer termination_buf; - char tos; -@@ -536,7 +537,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg) - /* Acquire the global mutex */ - caml_leave_blocking_section(); - st_thread_set_id(Ident(th->descr)); -- caml_setup_stack_overflow_detection(); -+ signal_stack = caml_setup_stack_overflow_detection(); - #ifdef NATIVE_CODE - /* Setup termination handler (for caml_thread_exit) */ - if (sigsetjmp(termination_buf.buf, 0) == 0) { -@@ -550,7 +551,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg) - #ifdef NATIVE_CODE - } - #endif -- caml_stop_stack_overflow_detection(); -+ caml_stop_stack_overflow_detection(signal_stack); - /* The thread now stops running */ - return 0; - } -diff --git a/runtime/caml/signals.h b/runtime/caml/signals.h -index c6aeebfc78..62b0e7fafa 100644 ---- a/runtime/caml/signals.h -+++ b/runtime/caml/signals.h -@@ -87,8 +87,8 @@ 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 int caml_setup_stack_overflow_detection(void); --CAMLextern int caml_stop_stack_overflow_detection(void); -+CAMLextern void * caml_setup_stack_overflow_detection(void); -+CAMLextern int caml_stop_stack_overflow_detection(void *); - CAMLextern void caml_init_signals(void); - CAMLextern void caml_terminate_signals(void); - CAMLextern void (*caml_enter_blocking_section_hook)(void); -diff --git a/runtime/signals_byt.c b/runtime/signals_byt.c -index 439fb56404..7cb461ac4d 100644 ---- a/runtime/signals_byt.c -+++ b/runtime/signals_byt.c -@@ -81,7 +81,7 @@ int caml_set_signal_action(int signo, int action) - return 0; - } - --CAMLexport int caml_setup_stack_overflow_detection(void) { return 0; } --CAMLexport int caml_stop_stack_overflow_detection(void) { return 0; } -+CAMLexport void * caml_setup_stack_overflow_detection(void) { return NULL; } -+CAMLexport int caml_stop_stack_overflow_detection(void * p) { return 0; } - CAMLexport void caml_init_signals(void) { } - CAMLexport void caml_terminate_signals(void) { } -diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c -index 443f5d53b6..1dd8289c12 100644 ---- a/runtime/signals_nat.c -+++ b/runtime/signals_nat.c -@@ -254,6 +254,10 @@ DECLARE_SIGNAL_HANDLER(segv_handler) - - /* Initialization of signal stuff */ - -+#ifdef HAS_STACK_OVERFLOW_DETECTION -+static void * caml_signal_stack = NULL; -+#endif -+ - void caml_init_signals(void) - { - /* Bound-check trap handling */ -@@ -278,7 +282,8 @@ void caml_init_signals(void) - #endif - - #ifdef HAS_STACK_OVERFLOW_DETECTION -- if (caml_setup_stack_overflow_detection() != -1) { -+ caml_signal_stack = caml_setup_stack_overflow_detection(); -+ if (caml_signal_stack != NULL) { - struct sigaction act; - SET_SIGACT(act, segv_handler); - act.sa_flags |= SA_ONSTACK | SA_NODEFER; -@@ -314,7 +319,8 @@ void caml_terminate_signals(void) - - #ifdef HAS_STACK_OVERFLOW_DETECTION - set_signal_default(SIGSEGV); -- caml_stop_stack_overflow_detection(); -+ caml_stop_stack_overflow_detection(caml_signal_stack); -+ caml_signal_stack = NULL; - #endif - } - -@@ -323,37 +329,44 @@ void caml_terminate_signals(void) - 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). */ -+ may not be a compile-time constant (issue #10250). -+ Return the dynamically-allocated alternate signal stack, or NULL -+ if an error occurred. -+ The returned pointer must be passed to [caml_stop_stack_overflow_detection]. -+*/ - --CAMLexport int caml_setup_stack_overflow_detection(void) -+CAMLexport void * 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_sp = malloc(stk.ss_size); -+ if (stk.ss_sp == NULL) return NULL; - stk.ss_flags = 0; - if (sigaltstack(&stk, NULL) == -1) { - free(stk.ss_sp); -- return -1; -+ return NULL; - } -+ return stk.ss_sp; -+#else -+ return NULL; - #endif -- /* Success (or stack overflow detection not available) */ -- return 0; - } - --CAMLexport int caml_stop_stack_overflow_detection(void) -+CAMLexport int caml_stop_stack_overflow_detection(void * signal_stack) - { - #ifdef HAS_STACK_OVERFLOW_DETECTION - stack_t oldstk, stk; - stk.ss_flags = SS_DISABLE; -+ stk.ss_sp = NULL; /* not required but avoids a valgrind false alarm */ -+ stk.ss_size = SIGSTKSZ; /* macOS wants a valid size here */ - if (sigaltstack(&stk, &oldstk) == -1) return -1; -- /* If caml_setup_stack_overflow_detection 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); -- return 0; --#else -- return 0; -+ /* Check whether someone else installed their own signal stack */ -+ if (!(oldstk.ss_flags & SS_DISABLE) && oldstk.ss_sp != signal_stack) { -+ /* Re-activate their signal stack. */ -+ sigaltstack(&oldstk, NULL); -+ } -+ free(signal_stack); - #endif -+ return 0; - } --- -2.37.0.rc2 - diff --git a/0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch b/0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch deleted file mode 100644 index 67376f4..0000000 --- a/0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch +++ /dev/null @@ -1,54 +0,0 @@ -From a4633757e352b30f136d2a1cda827289d826ddc0 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Thu, 25 Aug 2022 08:44:47 +0100 -Subject: [PATCH 19/24] Merge pull request #11487 from - purplearmadillo77/fma_test - -Thwart FMA test optimization during configure - -(cherry picked from commit cd7dc7f6b9b5353acc2aa70bdc7bbecff56634d0) ---- - Changes | 3 +++ - aclocal.m4 | 2 +- - configure | Bin 581611 -> 581620 bytes - 3 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Changes b/Changes -index 4d1bb10435..763c0fa4b7 100644 ---- a/Changes -+++ b/Changes -@@ -7,6 +7,9 @@ OCaml 4.14 maintenance branch - (David Allsopp, report by William Hu, review by Xavier Leroy and - Sébastien Hinderer) - -+- #11???: Thwart FMA test optimization during configure -+ (William Hu, review by ???) -+ - ### Bug fixes: - - - #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when -diff --git a/aclocal.m4 b/aclocal.m4 -index 2bc0a1dcc9..addb0d8bbf 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -440,7 +440,7 @@ int main (void) { - broken implementations of Cygwin64, mingw-w64 (x86_64) and VS2013-2017. - The static volatile variables aim to thwart GCC's constant folding. */ - static volatile double x, y, z; -- double t264, t265, t266; -+ volatile double t264, t265, t266; - x = 0x3.bd5b7dde5fddap-496; - y = 0x3.bd5b7dde5fddap-496; - z = -0xd.fc352bc352bap-992; -diff --git a/configure b/configure -index 536a1cbee58a430692bfa3de11901e7e2f6b4ee2..1a1dd61863e0435952ba6d6baf8131e68f070b3d 100755 -GIT binary patch -delta 44 -zcmaF8U-`>^<%Sl<7N!>F7M2#)Eo_r#a+KxgB$j06q_$6*$p*yi+b7NBh;#!0qIVJx - -delta 35 -qcmeyeU-|WZ<%Sl<7N!>F7M2#)Eo_r#w$GW#2E^>!=gj1Ya037qBM!s> - --- -2.37.0.rc2 - diff --git a/0020-Fixup-Changes.patch b/0020-Fixup-Changes.patch deleted file mode 100644 index 1301d95..0000000 --- a/0020-Fixup-Changes.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 19f5ef04dc344a82a3831f4b16f0be75c813dbf6 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Thu, 25 Aug 2022 08:48:34 +0100 -Subject: [PATCH 20/24] Fixup Changes - ---- - Changes | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Changes b/Changes -index 763c0fa4b7..92d0837eb6 100644 ---- a/Changes -+++ b/Changes -@@ -7,8 +7,8 @@ OCaml 4.14 maintenance branch - (David Allsopp, report by William Hu, review by Xavier Leroy and - Sébastien Hinderer) - --- #11???: Thwart FMA test optimization during configure -- (William Hu, review by ???) -+- #11487: Thwart FMA test optimization during configure -+ (William Hu, review by David Allsopp and Sébastien Hinderer) - - ### Bug fixes: - -@@ -21,7 +21,7 @@ OCaml 4.14 maintenance branch - before using it to ensure that the headers can always be used in code which - turns on -Wundef (or equivalent). - (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and -- Sebastien Hinderer) -+ Sébastien Hinderer) - - - #11314, #11416: fix non-informative error message for module inclusion - (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer) --- -2.37.0.rc2 - diff --git a/0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch b/0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch deleted file mode 100644 index 913074d..0000000 --- a/0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e6dfa704c0f7847fe8e7a2a153714b4075019a0f Mon Sep 17 00:00:00 2001 -From: Chris Casinghino -Date: Fri, 2 Sep 2022 10:28:55 -0400 -Subject: [PATCH 21/24] Fix [@deprecated_mutable], which couldn't be triggered. - (#11524) - -Fixes #11516 - -(cherry picked from commit 024ca164ab844a9be94e0675bb5a1693bab7c08f) ---- - Changes | 2 ++ - .../warnings/deprecated_mutable.compilers.reference | 4 ++++ - testsuite/tests/warnings/deprecated_mutable.ml | 13 +++++++++++++ - typing/env.ml | 9 ++++++++- - 4 files changed, 27 insertions(+), 1 deletion(-) - create mode 100644 testsuite/tests/warnings/deprecated_mutable.compilers.reference - create mode 100644 testsuite/tests/warnings/deprecated_mutable.ml - -diff --git a/Changes b/Changes -index 92d0837eb6..aa8880ad07 100644 ---- a/Changes -+++ b/Changes -@@ -47,6 +47,8 @@ OCaml 4.14 maintenance branch - - #11489, #11496: More prudent deallocation of alternate signal stack - (Xavier Leroy, report by @rajdakin, review by Florian Angeletti) - -+- #11516, #11524: Fix the `deprecated_mutable` attribute. -+ (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti) - - OCaml 4.14.0 (28 March 2022) - ---------------------------- -diff --git a/testsuite/tests/warnings/deprecated_mutable.compilers.reference b/testsuite/tests/warnings/deprecated_mutable.compilers.reference -new file mode 100644 -index 0000000000..620dc57de9 ---- /dev/null -+++ b/testsuite/tests/warnings/deprecated_mutable.compilers.reference -@@ -0,0 +1,4 @@ -+File "deprecated_mutable.ml", line 13, characters 11-12: -+13 | let () = y.x <- 42 -+ ^ -+Alert deprecated: mutating field x -diff --git a/testsuite/tests/warnings/deprecated_mutable.ml b/testsuite/tests/warnings/deprecated_mutable.ml -new file mode 100644 -index 0000000000..78fb12ac41 ---- /dev/null -+++ b/testsuite/tests/warnings/deprecated_mutable.ml -@@ -0,0 +1,13 @@ -+(* TEST -+ -+flags = "-w +A-70" -+ -+* bytecode -+ -+*) -+ -+type t = {mutable x : int [@deprecated_mutable]} -+ -+let y : t = {x = 5} -+ -+let () = y.x <- 42 -diff --git a/typing/env.ml b/typing/env.ml -index 06b99f4159..29d7cdb0e4 100644 ---- a/typing/env.ml -+++ b/typing/env.ml -@@ -104,6 +104,10 @@ let add_label_usage lu usage = - lu.lu_mutation <- true; - lu.lu_construct <- true - -+let is_mutating_label_usage = function -+ | Mutation -> true -+ | (Projection | Construct | Exported_private | Exported) -> false -+ - let label_usages () = - {lu_projection = false; lu_mutation = false; lu_construct = false} - -@@ -2723,7 +2727,10 @@ let use_cltype ~use ~loc path desc = - let use_label ~use ~loc usage env lbl = - if use then begin - mark_label_description_used usage env lbl; -- Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name -+ Builtin_attributes.check_alerts loc lbl.lbl_attributes lbl.lbl_name; -+ if is_mutating_label_usage usage then -+ Builtin_attributes.check_deprecated_mutable loc lbl.lbl_attributes -+ lbl.lbl_name - end - - let use_constructor_desc ~use ~loc usage env cstr = --- -2.37.0.rc2 - diff --git a/0024-configure-Only-use-OC_-for-building-executables.patch b/0024-configure-Only-use-OC_-for-building-executables.patch deleted file mode 100644 index 1dbe2f2..0000000 --- a/0024-configure-Only-use-OC_-for-building-executables.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8e9ee6f765273d2c385b590a593e784472753d87 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 26 Jan 2022 15:47:02 +0000 -Subject: [PATCH 24/24] configure: Only use OC_* for building executables - -Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for -"package notes" which contains build paths. - -In any case it seems pointless having both the OC_* variables and also -including the regular CFLAGS/LDFLAGS. Give me full control over what -ocamlopt uses. ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 9e6c0b9745..cab4cbd579 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -37,7 +37,7 @@ CONFIGURE_ARGS="$*" - # at the moment they are not taken into account on Windows, because - # flexlink, which is used to build executables on this platform, can - # not handle them. --mkexe="\$(CC) \$(OC_CFLAGS) \$(CFLAGS) \$(OC_LDFLAGS) \$(LDFLAGS)" -+mkexe="\$(CC) \$(OC_CFLAGS) \$(OC_LDFLAGS)" - - # Flags for building executable files with debugging symbols - mkexedebugflag="-g" --- -2.37.0.rc2 - diff --git a/ocaml.spec b/ocaml.spec index a720f83..544a857 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -18,6 +18,9 @@ %global natdynlink 0 %endif +# i686 support was dropped in OCaml 5 / Fedora 39. +ExcludeArch: %{ix86} + # These are all the architectures that the tests run on. The tests # take a long time to run, so don't run them on slow machines. %global test_arches aarch64 %{power64} riscv64 x86_64 @@ -33,12 +36,12 @@ %global rcver %{nil} Name: ocaml -Version: 4.14.0 -Release: 5%{?dist} +Version: 5.0.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment -License: QPL and (LGPLv2+ with exceptions) +License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception URL: https://www.ocaml.org @@ -53,52 +56,50 @@ Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{vers # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-38-4.14.0 +# Current branch: fedora-39-5.0.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should # be incorporated into the git repo at a later time. -# Patches added after 4.14.0 was released -Patch0001: 0001-Do-not-trigger-warning-when-calling-virtual-methods-.patch -Patch0002: 0002-Merge-pull-request-11236-from-Nymphium-missing-since.patch -Patch0003: 0003-misc.h-fix-preprocessor-conditional-on-_MSC_VER.patch -Patch0004: 0004-Changes.patch -Patch0005: 0005-Guard-more-instances-of-undefined-_MSC_VER.patch -Patch0006: 0006-Better-documentation-for-string_of_float-.-11353.patch -Patch0007: 0007-Merge-pull-request-11380-from-damiendoligez-fix-fort.patch -Patch0008: 0008-Refactor-the-initialization-of-bytecode-threading-11.patch -Patch0009: 0009-Merge-pull-request-11397-from-Octachron-tast_mapper_.patch -Patch0010: 0010-Merge-pull-request-11396-from-gasche-fix11392.patch -Patch0011: 0011-Document-limitation-on-caml_callbackN-11409.patch -Patch0012: 0012-Stop-calling-ranlib-on-created-installed-libraries-1.patch -Patch0013: 0013-tests-lib-bigarray-2-has-gfortran.sh-don-t-print-any.patch -Patch0014: 0014-Merge-pull-request-11417-from-lpw25-fix-virtual-clas.patch -Patch0015: 0015-Do-not-elide-the-whole-module-type-error-message-114.patch -Patch0016: 0016-Merge-pull-request-11373-from-dra27-flexlink-detect.patch -Patch0017: 0017-Merge-pull-request-11468-from-dra27-i686-mingw-ipv6.patch -Patch0018: 0018-More-prudent-deallocation-of-alternate-signal-stack-.patch -Patch0019: 0019-Merge-pull-request-11487-from-purplearmadillo77-fma_.patch -Patch0020: 0020-Fixup-Changes.patch -Patch0021: 0021-Fix-deprecated_mutable-which-couldn-t-be-triggered.-.patch +# Patches added after 5.0.0 was released. +Patch: 0001-increment-version-number-after-tagging-5.0.0.patch +Patch: 0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch +Patch: 0003-Add-KC-Sivaramakrishnan-as-author.patch +Patch: 0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch +Patch: 0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch +Patch: 0006-Allow-installing-in-folder-with-space-in-name-11590.patch +Patch: 0007-Detect-unused-Makefile-variables-in-workflow.patch +Patch: 0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch +Patch: 0009-Provide-a-default-for-OCAMLDEPFLAGS.patch +Patch: 0010-Report-all-post-build-failures.patch +Patch: 0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch +Patch: 0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch +Patch: 0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch +Patch: 0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch # Fedora-specific patches -Patch0022: 0022-Don-t-add-rpaths-to-libraries.patch -Patch0023: 0023-configure-Allow-user-defined-C-compiler-flags.patch -Patch0024: 0024-configure-Only-use-OC_-for-building-executables.patch +Patch: 0015-Don-t-add-rpaths-to-libraries.patch +Patch: 0016-configure-Allow-user-defined-C-compiler-flags.patch +Patch: 0017-configure-Only-use-OC_-for-building-executables.patch + +# Fix skiplist test failure +# https://github.com/ocaml/ocaml/pull/12346 +Patch: 0018-Fix-skiplist-test-failure-12346.patch BuildRequires: make BuildRequires: git BuildRequires: gcc BuildRequires: autoconf -BuildRequires: binutils-devel -BuildRequires: ncurses-devel -BuildRequires: gdbm-devel BuildRequires: gawk BuildRequires: perl-interpreter BuildRequires: util-linux BuildRequires: /usr/bin/annocheck +# Documentation requirements +BuildRequires: asciidoc +BuildRequires: python3-pygments + # ocamlopt runs gcc to link binaries. Because Fedora includes # hardening flags automatically, redhat-rpm-config is also required. Requires: gcc @@ -150,6 +151,9 @@ Source code for OCaml libraries. %package ocamldoc +# LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception: the project as a whole +# LicenseRef-Fedora-Public-Domain: ocamldoc/ocamldoc.sty +License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception AND LicenseRef-Fedora-Public-Domain Summary: Documentation generator for OCaml Requires: ocaml%{?_isa} = %{version}-%{release} Provides: ocamldoc = %{version} @@ -160,6 +164,7 @@ Documentation generator for OCaml. %package docs Summary: Documentation for OCaml +BuildArch: noarch Requires: ocaml = %{version}-%{release} @@ -199,6 +204,9 @@ unset MAKEFLAGS make=make %endif +# Set ocamlmklib default flags to include Fedora linker flags +sed -i '/ld_opts/s|\[\]|["%{build_ldflags}"]|' tools/ocamlmklib.ml + # Don't use %%configure macro because it sets --build, --host which # breaks some incorrect assumptions made by OCaml's configure.ac # @@ -218,8 +226,15 @@ make=make --sysconfdir=%{_sysconfdir} \ --mandir=%{_mandir} \ --libdir=%{_libdir}/ocaml \ - OC_CFLAGS="$CFLAGS" \ - OC_LDFLAGS="$LDFLAGS" \ + --enable-flambda \ +%if %{native_compiler} + --enable-native-toplevel \ +%endif +%if 0%{?_include_frame_pointers} + --enable-frame-pointers \ +%endif + OC_CFLAGS='%{build_cflags}' \ + OC_LDFLAGS='%{build_ldflags}' \ %{nil} $make world %if %{native_compiler} @@ -227,6 +242,13 @@ $make opt $make opt.opt %endif +# Build the README and fix up references to other doc files +asciidoc -d book README.adoc +for fil in CONTRIBUTING.md HACKING.adoc INSTALL.adoc README.win32.adoc; do + sed -e "s,\"$fil\",\"https://github.com/ocaml/ocaml/blob/trunk/$fil\"," \ + -i README.html +done + %check %ifarch %{ocaml_native_compiler} @@ -260,10 +282,6 @@ echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release # Remove the installed documentation. We will install it using %%doc rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml -# Remove this file. It's only created in certain situations and it's -# unclear why it is created at all. -rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata - %files %license LICENSE @@ -271,8 +289,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_bindir}/ocamlcmt %{_bindir}/ocamldebug -#{_bindir}/ocaml-instr-graph -#{_bindir}/ocaml-instr-report %{_bindir}/ocamlyacc # symlink to either .byte or .opt version @@ -316,17 +332,17 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_bindir}/ocamlopt.opt %endif -#%%{_libdir}/ocaml/addlabels -#%%{_libdir}/ocaml/scrapelabels +%if %{native_compiler} +%{_bindir}/ocamlnat +%endif + %{_libdir}/ocaml/camlheader %{_libdir}/ocaml/camlheader_ur %{_libdir}/ocaml/expunge %{_libdir}/ocaml/ld.conf %{_libdir}/ocaml/Makefile.config + %{_libdir}/ocaml/*.a -%if %{natdynlink} -%{_libdir}/ocaml/*.cmxs -%endif %if %{native_compiler} %{_libdir}/ocaml/*.cmxa %{_libdir}/ocaml/*.cmx @@ -334,34 +350,64 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_libdir}/ocaml/libasmrun_shared.so %endif %{_libdir}/ocaml/*.mli +%{_libdir}/ocaml/sys.ml.in %{_libdir}/ocaml/libcamlrun_shared.so -#%%{_libdir}/ocaml/objinfo_helper -%{_libdir}/ocaml/threads/*.mli + +%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.a +%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.mli %if %{native_compiler} -%{_libdir}/ocaml/threads/*.a -%{_libdir}/ocaml/threads/*.cmxa -%{_libdir}/ocaml/threads/*.cmx +%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.cmxa +%{_libdir}/ocaml/{dynlink,profiling,runtime_events,str,threads,unix}/*.cmx +%{_libdir}/ocaml/profiling/*.o %endif +%if %{natdynlink} +%{_libdir}/ocaml/{runtime_events,str,unix}/*.cmxs +%endif + +# headers %{_libdir}/ocaml/caml %files runtime -%doc README.adoc Changes +%doc README.html Changes %license LICENSE %{_bindir}/ocamlrun %{_bindir}/ocamlrund %{_bindir}/ocamlruni %dir %{_libdir}/ocaml -#%%{_libdir}/ocaml/VERSION %{_libdir}/ocaml/*.cmo %{_libdir}/ocaml/*.cmi %{_libdir}/ocaml/*.cma %{_libdir}/ocaml/camlheaderd %{_libdir}/ocaml/camlheaderi %{_libdir}/ocaml/stublibs +%dir %{_libdir}/ocaml/dynlink +%{_libdir}/ocaml/dynlink/META +%{_libdir}/ocaml/dynlink/*.cmi +%{_libdir}/ocaml/dynlink/*.cma +%dir %{_libdir}/ocaml/ocamlmktop +%{_libdir}/ocaml/ocamlmktop/*.cmo +%{_libdir}/ocaml/ocamlmktop/*.cmi +%dir %{_libdir}/ocaml/profiling +%{_libdir}/ocaml/profiling/*.cmo +%{_libdir}/ocaml/profiling/*.cmi +%dir %{_libdir}/ocaml/runtime_events +%{_libdir}/ocaml/runtime_events/META +%{_libdir}/ocaml/runtime_events/*.cmi +%{_libdir}/ocaml/runtime_events/*.cma +%{_libdir}/ocaml/stdlib +%dir %{_libdir}/ocaml/str +%{_libdir}/ocaml/str/META +%{_libdir}/ocaml/str/*.cmi +%{_libdir}/ocaml/str/*.cma %dir %{_libdir}/ocaml/threads +%{_libdir}/ocaml/threads/META %{_libdir}/ocaml/threads/*.cmi %{_libdir}/ocaml/threads/*.cma +%dir %{_libdir}/ocaml/unix +%{_libdir}/ocaml/unix/META +%{_libdir}/ocaml/unix/*.cmi +%{_libdir}/ocaml/unix/*.cma %{_libdir}/ocaml/fedora-ocaml-release @@ -386,20 +432,16 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %files compiler-libs %license LICENSE -%dir %{_libdir}/ocaml/compiler-libs -%{_libdir}/ocaml/compiler-libs/*.mli -%{_libdir}/ocaml/compiler-libs/*.cmi -%{_libdir}/ocaml/compiler-libs/*.cmo -%{_libdir}/ocaml/compiler-libs/*.cma -%if %{native_compiler} -%{_libdir}/ocaml/compiler-libs/*.a -%{_libdir}/ocaml/compiler-libs/*.cmxa -%{_libdir}/ocaml/compiler-libs/*.cmx -%{_libdir}/ocaml/compiler-libs/*.o -%endif +%{_libdir}/ocaml/compiler-libs %changelog +* Wed Jun 14 2023 Jerry James - 5.0.0-1 +- Version 5.0.0 +- Convert License tag to SPDX +- Ship HTML documentation instead of asciidoc source +- Set ocamlmklib default flags to the Fedora linker flags + * Mon Jan 23 2023 Richard W.M. Jones - 4.14.0-5 - Rebuild OCaml packages for F38 diff --git a/sources b/sources index 6de827b..3a87a72 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-4.14.0.tar.gz) = 3c5e5b9f00bb109dd99b5f7b0078cf8663d4247e548f3e601d6b2a55582e04bb20f6de85005c4cf2f78ae9aaa449f5ca6f2bab2f6ce83eeb3aeb386e3f2fcc32 +SHA512 (ocaml-5.0.0.tar.gz) = c0cd445bdc2de5d45aae9aea78aab116807cc6782efbcb624a5843e2c0821ccb1e307cc23724f9636918495305cadc75abf04395cd9ede28597774ab60948167 From cec11e3cd81f1139491d7d4242dbf97eb5f45127 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 10 Jul 2023 22:43:58 +0100 Subject: [PATCH 18/54] --enable-frame-pointers only works on x86-64 --- ocaml.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ocaml.spec b/ocaml.spec index 544a857..4efd357 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -230,8 +230,10 @@ sed -i '/ld_opts/s|\[\]|["%{build_ldflags}"]|' tools/ocamlmklib.ml %if %{native_compiler} --enable-native-toplevel \ %endif +%ifarch x86_64 %if 0%{?_include_frame_pointers} --enable-frame-pointers \ +%endif %endif OC_CFLAGS='%{build_cflags}' \ OC_LDFLAGS='%{build_ldflags}' \ From be2dfe04dbe0e6111899a07a18afb0004b8a4507 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 11 Jul 2023 08:31:48 +0100 Subject: [PATCH 19/54] Fix compilation on bytecode-only arches File not found: /builddir/build/BUILDROOT/ocaml-5.0.0-1.fc39.ppc64le/usr/lib64/ocaml/{dynlink,runtime_events,str,threads,unix}/*.a --- ocaml.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 4efd357..0de2e66 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -355,9 +355,9 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml %{_libdir}/ocaml/sys.ml.in %{_libdir}/ocaml/libcamlrun_shared.so -%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.a %{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.mli %if %{native_compiler} +%{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.a %{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.cmxa %{_libdir}/ocaml/{dynlink,profiling,runtime_events,str,threads,unix}/*.cmx %{_libdir}/ocaml/profiling/*.o From 772b17b6662dc7fdeeaa750e3225a5e8d2274f3f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 11 Jul 2023 17:46:39 +0100 Subject: [PATCH 20/54] Drop downstream 0017-configure-Only-use-OC_-for-building-executables.patch This is no longer needed now we found another way to work around build notes breakage. --- ...t-version-number-after-tagging-5.0.0.patch | 2 +- ...st-11814-from-gasche-clarify-DLS.new.patch | 2 +- 0003-Add-KC-Sivaramakrishnan-as-author.patch | 2 +- ...unused-variables-in-yacc-reader.c-11.patch | 2 +- ...st-11860-from-Octachron-index_for_st.patch | 2 +- ...g-in-folder-with-space-in-name-11590.patch | 2 +- ...nused-Makefile-variables-in-workflow.patch | 2 +- ...variable-from-runtime-Makefile-merge.patch | 2 +- ...-Provide-a-default-for-OCAMLDEPFLAGS.patch | 2 +- 0010-Report-all-post-build-failures.patch | 2 +- ...emoval-of-FORCE_INSTRUMENTED_RUNTIME.patch | 2 +- ...s-alert-when-compiling-stdlib-docume.patch | 2 +- ...st-12285-from-smorimoto-update-depre.patch | 2 +- ...st-12286-from-smorimoto-replace-set-.patch | 2 +- 0015-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...0017-Fix-skiplist-test-failure-12346.patch | 4 +- ...nly-use-OC_-for-building-executables.patch | 40 ------------------- ocaml.spec | 7 ++-- 19 files changed, 21 insertions(+), 62 deletions(-) rename 0018-Fix-skiplist-test-failure-12346.patch => 0017-Fix-skiplist-test-failure-12346.patch (92%) delete mode 100644 0017-configure-Only-use-OC_-for-building-executables.patch diff --git a/0001-increment-version-number-after-tagging-5.0.0.patch b/0001-increment-version-number-after-tagging-5.0.0.patch index 7583a57..8103ef0 100644 --- a/0001-increment-version-number-after-tagging-5.0.0.patch +++ b/0001-increment-version-number-after-tagging-5.0.0.patch @@ -1,7 +1,7 @@ From 8741f4d88801e478e0ab7f871dc7dbcf9d7cc8f4 Mon Sep 17 00:00:00 2001 From: Florian Angeletti Date: Thu, 15 Dec 2022 14:28:32 +0100 -Subject: [PATCH 01/18] increment version number after tagging 5.0.0 +Subject: [PATCH 01/17] increment version number after tagging 5.0.0 --- VERSION | 2 +- diff --git a/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch b/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch index e25154a..6a68fc4 100644 --- a/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch +++ b/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch @@ -1,7 +1,7 @@ From 925bf9a6d828d7548751f9a21892cad6209fc950 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Fri, 16 Dec 2022 09:41:13 +0100 -Subject: [PATCH 02/18] Merge pull request #11814 from +Subject: [PATCH 02/17] Merge pull request #11814 from gasche/clarify-DLS.new_key-doc clarify the doc of Domain.DLS.new_key diff --git a/0003-Add-KC-Sivaramakrishnan-as-author.patch b/0003-Add-KC-Sivaramakrishnan-as-author.patch index 0a60404..3186f31 100644 --- a/0003-Add-KC-Sivaramakrishnan-as-author.patch +++ b/0003-Add-KC-Sivaramakrishnan-as-author.patch @@ -1,7 +1,7 @@ From 83ef99f67fda11b268098a271f56b990e295bbc2 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 20 Dec 2022 10:48:41 +0100 -Subject: [PATCH 03/18] Add KC Sivaramakrishnan as author +Subject: [PATCH 03/17] Add KC Sivaramakrishnan as author For the two new chapters "Parallel programming" and "Memory model". diff --git a/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch b/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch index d49f709..846f0be 100644 --- a/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch +++ b/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch @@ -1,7 +1,7 @@ From ea8b79eda165722d04b369f1811a5aa80ab5acc6 Mon Sep 17 00:00:00 2001 From: SSHz Date: Sun, 27 Nov 2022 14:46:16 +0000 -Subject: [PATCH 04/18] removed set but unused variables in yacc/reader.c +Subject: [PATCH 04/17] removed set but unused variables in yacc/reader.c (#11758) (cherry picked from commit 0114f62d3ed056254ac25192f724e92a2ff6c448) diff --git a/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch b/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch index c3e9555..8421941 100644 --- a/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch +++ b/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch @@ -1,7 +1,7 @@ From 848e28fc6f3f3c9802b23c00f2d77f568c761667 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Tue, 3 Jan 2023 17:41:12 +0100 -Subject: [PATCH 05/18] Merge pull request #11860 from +Subject: [PATCH 05/17] Merge pull request #11860 from Octachron/index_for_stdlib documentation: sort modules alphabetically diff --git a/0006-Allow-installing-in-folder-with-space-in-name-11590.patch b/0006-Allow-installing-in-folder-with-space-in-name-11590.patch index 2831ec8..ed6c490 100644 --- a/0006-Allow-installing-in-folder-with-space-in-name-11590.patch +++ b/0006-Allow-installing-in-folder-with-space-in-name-11590.patch @@ -1,7 +1,7 @@ From a3cd42bc03ed0fc706bb7364fdb14b29b1925600 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 4 Jan 2023 16:33:28 +0000 -Subject: [PATCH 06/18] Allow installing in folder with space in name (#11590) +Subject: [PATCH 06/17] Allow installing in folder with space in name (#11590) - fix(build): Repair make install (in man/Makefile) --- diff --git a/0007-Detect-unused-Makefile-variables-in-workflow.patch b/0007-Detect-unused-Makefile-variables-in-workflow.patch index e13b225..0af534d 100644 --- a/0007-Detect-unused-Makefile-variables-in-workflow.patch +++ b/0007-Detect-unused-Makefile-variables-in-workflow.patch @@ -1,7 +1,7 @@ From 44f4015f9a649e164b332e6ab1302139191d4a4f Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 3 Mar 2021 12:24:36 +0000 -Subject: [PATCH 07/18] Detect unused Makefile variables in workflow +Subject: [PATCH 07/17] Detect unused Makefile variables in workflow --- tools/ci/actions/runner.sh | 13 ++++++++++++- diff --git a/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch b/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch index f57e2bd..504a5fd 100644 --- a/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch +++ b/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch @@ -1,7 +1,7 @@ From 2eccdd3cd78624b0f2664d6152afbcae167f6f8b Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 20 Feb 2023 20:27:58 +0000 -Subject: [PATCH 08/18] Fix incorrect variable from runtime/Makefile merge +Subject: [PATCH 08/17] Fix incorrect variable from runtime/Makefile merge Wrong CPPFLAGS used when assembling with ASPP. --- diff --git a/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch b/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch index 0c10ff5..cdb8e60 100644 --- a/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch +++ b/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch @@ -1,7 +1,7 @@ From 5f3f8bf734bdc02adc69cf92f066547bd71e8a25 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 20 Feb 2023 20:31:31 +0000 -Subject: [PATCH 09/18] Provide a default for $(OCAMLDEPFLAGS) +Subject: [PATCH 09/17] Provide a default for $(OCAMLDEPFLAGS) --- Makefile.common | 1 + diff --git a/0010-Report-all-post-build-failures.patch b/0010-Report-all-post-build-failures.patch index bf8f6e2..952529f 100644 --- a/0010-Report-all-post-build-failures.patch +++ b/0010-Report-all-post-build-failures.patch @@ -1,7 +1,7 @@ From 7f4569e22c2a19d51324c44a2954b10427df2cd8 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 21 Feb 2023 14:44:21 +0000 -Subject: [PATCH 10/18] Report all post-build failures +Subject: [PATCH 10/17] Report all post-build failures Rather than just reporting un-prefixed symbol names, also report undefined variables. diff --git a/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch b/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch index 5ffca5f..543afca 100644 --- a/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch +++ b/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch @@ -1,7 +1,7 @@ From 0f6dc503bf3814e5547ffb4e9d6ea0a75ffd1ec0 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 22 Feb 2023 10:47:00 +0000 -Subject: [PATCH 11/18] Finish off removal of FORCE_INSTRUMENTED_RUNTIME +Subject: [PATCH 11/17] Finish off removal of FORCE_INSTRUMENTED_RUNTIME --- utils/Makefile | 1 - diff --git a/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch b/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch index 5d87237..d0416ba 100644 --- a/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch +++ b/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch @@ -1,7 +1,7 @@ From ffb2022797986324213891a59c02af46269b5c17 Mon Sep 17 00:00:00 2001 From: Damien Doligez Date: Mon, 17 Apr 2023 11:36:32 +0200 -Subject: [PATCH 12/18] suppress spurious alert when compiling stdlib +Subject: [PATCH 12/17] suppress spurious alert when compiling stdlib documentation (cherry picked from commit 5c0fb8e23865fdbf151bdbe15d91176903c284d3) diff --git a/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch b/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch index ed6f114..519c245 100644 --- a/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch +++ b/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch @@ -1,7 +1,7 @@ From 4cc4eb8b0d71c64c5252d6764f4c4b0aa6020995 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 3 Jun 2023 18:02:24 +0100 -Subject: [PATCH 13/18] Merge pull request #12285 from +Subject: [PATCH 13/17] Merge pull request #12285 from smorimoto/update-deprecated-actions Update deprecated GitHub Actions diff --git a/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch b/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch index cf8c766..c29b0c7 100644 --- a/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch +++ b/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch @@ -1,7 +1,7 @@ From af3a67cd06e07825c63b70a038cf90481039b1ed Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 9 Jun 2023 21:47:51 +0100 -Subject: [PATCH 14/18] Merge pull request #12286 from +Subject: [PATCH 14/17] Merge pull request #12286 from smorimoto/replace-set-output Replace the set-output command with the GITHUB_OUTPUT environment file diff --git a/0015-Don-t-add-rpaths-to-libraries.patch b/0015-Don-t-add-rpaths-to-libraries.patch index 9d3092b..74c6dfa 100644 --- a/0015-Don-t-add-rpaths-to-libraries.patch +++ b/0015-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 0e07dfdb530734ef4db351ecc24c6363e36916ec Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 15/18] Don't add rpaths to libraries. +Subject: [PATCH 15/17] Don't add rpaths to libraries. --- utils/config.mlp | 4 ++-- diff --git a/0016-configure-Allow-user-defined-C-compiler-flags.patch b/0016-configure-Allow-user-defined-C-compiler-flags.patch index f618d37..a3d322a 100644 --- a/0016-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0016-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From 9d3722c87ab15dfbc4e1a934e09ddc8253712d9c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 16/18] configure: Allow user defined C compiler flags. +Subject: [PATCH 16/17] configure: Allow user defined C compiler flags. --- configure.ac | 4 ++++ diff --git a/0018-Fix-skiplist-test-failure-12346.patch b/0017-Fix-skiplist-test-failure-12346.patch similarity index 92% rename from 0018-Fix-skiplist-test-failure-12346.patch rename to 0017-Fix-skiplist-test-failure-12346.patch index 1668adc..87219e7 100644 --- a/0018-Fix-skiplist-test-failure-12346.patch +++ b/0017-Fix-skiplist-test-failure-12346.patch @@ -1,7 +1,7 @@ -From 69fdedd5c7747370879abbdc2beb5d7a1bd72194 Mon Sep 17 00:00:00 2001 +From 74b0eee42f616cb05c640c0ceac0cc391e4a7ef1 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Fri, 7 Jul 2023 07:07:09 -0600 -Subject: [PATCH 18/18] Fix skiplist test failure (#12346) +Subject: [PATCH 17/17] Fix skiplist test failure (#12346) Fix -Wmaybe-uninitialized warning in skiplist test Fix -Wunused-variable warning in skiplist test diff --git a/0017-configure-Only-use-OC_-for-building-executables.patch b/0017-configure-Only-use-OC_-for-building-executables.patch deleted file mode 100644 index ff1e02b..0000000 --- a/0017-configure-Only-use-OC_-for-building-executables.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 1c908c961738067dd52a5ba4515cc35abd35b96b Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 26 Jan 2022 15:47:02 +0000 -Subject: [PATCH 17/18] configure: Only use OC_* for building executables - -Fedora >= 36 fills LD_FLAGS with lots of cruft, particularly stuff for -"package notes" which contains build paths. - -In any case it seems pointless having both the OC_* variables and also -including the regular CFLAGS/LDFLAGS. Give me full control over what -ocamlopt uses. ---- - configure.ac | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 8068de3cfc..19b23f9400 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -36,7 +36,7 @@ CONFIGURE_ARGS="$*" - # rely on $CFLAGS because these cannot be processed by flexlink (and are not - # passed) - mkexe_cmd='$(CC)' --mkexe_cflags='$(OC_CFLAGS) $(CFLAGS)' -+mkexe_cflags='$(OC_CFLAGS)' - mkexe_extra_flags='' - mkexe_via_cc_extra_cmd='' - mkexe_ldflags_prefix='' -@@ -2208,7 +2208,7 @@ ${mkdll_ldflags}" - ],[ - mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' - mkdll_ldflags_exp="${oc_dll_ldflags} ${LDFLAGS}" -- mkexe="${mkexe} \$(OC_LDFLAGS) \$(LDFLAGS)" -+ mkexe="${mkexe} \$(OC_LDFLAGS)" - mkexe_exp="${mkexe_exp} ${oc_ldflags} ${LDFLAGS}" - ]) - mkdll="$mkdll $mkdll_ldflags" --- -2.41.0 - diff --git a/ocaml.spec b/ocaml.spec index 0de2e66..55f3e50 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -37,7 +37,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -81,11 +81,10 @@ Patch: 0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch # Fedora-specific patches Patch: 0015-Don-t-add-rpaths-to-libraries.patch Patch: 0016-configure-Allow-user-defined-C-compiler-flags.patch -Patch: 0017-configure-Only-use-OC_-for-building-executables.patch # Fix skiplist test failure # https://github.com/ocaml/ocaml/pull/12346 -Patch: 0018-Fix-skiplist-test-failure-12346.patch +Patch: 0017-Fix-skiplist-test-failure-12346.patch BuildRequires: make BuildRequires: git @@ -438,7 +437,7 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml %changelog -* Wed Jun 14 2023 Jerry James - 5.0.0-1 +* Wed Jun 14 2023 Jerry James - 5.0.0-2 - Version 5.0.0 - Convert License tag to SPDX - Ship HTML documentation instead of asciidoc source From 5ebc943f989aa6a54499f540b04a87a4ea9f3b0a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 11 Jul 2023 17:49:54 +0100 Subject: [PATCH 21/54] Add all further differences with jjames's OCaml 5 package --- ocaml.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ocaml.spec b/ocaml.spec index 55f3e50..860c653 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -114,7 +114,11 @@ Provides: bundled(md5-plumb) Provides: ocaml(compiler) = %{version} +%if %{native_compiler} %global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' +%else +%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' -i Backend_intf -i Inlining_decision_intf -i Simplify_boxed_integer_ops_intf +%endif %global __ocaml_provides_opts -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' @@ -227,7 +231,11 @@ sed -i '/ld_opts/s|\[\]|["%{build_ldflags}"]|' tools/ocamlmklib.ml --libdir=%{_libdir}/ocaml \ --enable-flambda \ %if %{native_compiler} + --enable-native-compiler \ --enable-native-toplevel \ +%else + --disable-native-compiler \ + --disable-native-toplevel \ %endif %ifarch x86_64 %if 0%{?_include_frame_pointers} @@ -442,6 +450,7 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml - Convert License tag to SPDX - Ship HTML documentation instead of asciidoc source - Set ocamlmklib default flags to the Fedora linker flags +- Enable frame pointers on x86_64 * Mon Jan 23 2023 Richard W.M. Jones - 4.14.0-5 - Rebuild OCaml packages for F38 From 64f662b9c585a90232c8b172bceff6dc9ba3e620 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 12 Jul 2023 11:28:00 +0100 Subject: [PATCH 22/54] Force ocaml-srpm-macros to be the latest version. --- ocaml.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 860c653..0658ebd 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -37,7 +37,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.0.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -109,6 +109,10 @@ Requires: redhat-rpm-config # of ocaml-runtime. Requires: ocaml-runtime%{?_isa} = %{version}-%{release} +# Force ocaml-srpm-macros to be at the latest version, since OCaml 5.0 +# has a different set of native code generators than previous versions. +Requires: ocaml-srpm-macros >= 8 + # Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c Provides: bundled(md5-plumb) @@ -445,6 +449,9 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml %changelog +* Wed Jul 12 2023 Richard W.M. Jones - 5.0.0-3 +- Force ocaml-srpm-macros to be the latest version. + * Wed Jun 14 2023 Jerry James - 5.0.0-2 - Version 5.0.0 - Convert License tag to SPDX From 4a09b96d7b6c97f47d2824aab1d942aee0daa7a7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 17:09:37 +0000 Subject: [PATCH 23/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 0658ebd..78683d0 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -37,7 +37,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.0.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -449,6 +449,9 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 5.0.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed Jul 12 2023 Richard W.M. Jones - 5.0.0-3 - Force ocaml-srpm-macros to be the latest version. From a433439c107b2c295d22003187a95935db16aeee Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 4 Oct 2023 20:56:33 -0600 Subject: [PATCH 24/54] Version 5.1.0 Other changes: - Add LicenseRef-Fedora-Public-Domain to the runtime License field - New ocaml-rpm-macros subpackage - Depend on libzstd-devel for compressed marshaling - Disable LTO --- 0001-Don-t-add-rpaths-to-libraries.patch | 25 + ...t-version-number-after-tagging-5.0.0.patch | 86 --- ...st-11814-from-gasche-clarify-DLS.new.patch | 66 -- ...-Allow-user-defined-C-compiler-flags.patch | 45 ++ 0003-Add-KC-Sivaramakrishnan-as-author.patch | 31 - ...elivery-of-effect-related-exceptions.patch | 34 + ...ters-tests-to-avoid-false-positive-w.patch | 696 ++++++++++++++++++ ...unused-variables-in-yacc-reader.c-11.patch | 39 - ...st-11860-from-Octachron-index_for_st.patch | 68 -- ...g-in-folder-with-space-in-name-11590.patch | 42 -- ...nused-Makefile-variables-in-workflow.patch | 45 -- ...variable-from-runtime-Makefile-merge.patch | 33 - ...-Provide-a-default-for-OCAMLDEPFLAGS.patch | 24 - 0010-Report-all-post-build-failures.patch | 41 -- ...emoval-of-FORCE_INSTRUMENTED_RUNTIME.patch | 24 - ...s-alert-when-compiling-stdlib-docume.patch | 27 - ...st-12285-from-smorimoto-update-depre.patch | 70 -- ...st-12286-from-smorimoto-replace-set-.patch | 40 - 0015-Don-t-add-rpaths-to-libraries.patch | 27 - ...-Allow-user-defined-C-compiler-flags.patch | 27 - 0017-Fix-skiplist-test-failure-12346.patch | 39 - macros.ocaml-rpm | 69 ++ ocaml.spec | 127 ++-- ocaml_files.py | 451 ++++++++++++ sources | 2 +- 25 files changed, 1397 insertions(+), 781 deletions(-) create mode 100644 0001-Don-t-add-rpaths-to-libraries.patch delete mode 100644 0001-increment-version-number-after-tagging-5.0.0.patch delete mode 100644 0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch create mode 100644 0002-configure-Allow-user-defined-C-compiler-flags.patch delete mode 100644 0003-Add-KC-Sivaramakrishnan-as-author.patch create mode 100644 0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch create mode 100644 0004-Update-framepointers-tests-to-avoid-false-positive-w.patch delete mode 100644 0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch delete mode 100644 0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch delete mode 100644 0006-Allow-installing-in-folder-with-space-in-name-11590.patch delete mode 100644 0007-Detect-unused-Makefile-variables-in-workflow.patch delete mode 100644 0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch delete mode 100644 0009-Provide-a-default-for-OCAMLDEPFLAGS.patch delete mode 100644 0010-Report-all-post-build-failures.patch delete mode 100644 0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch delete mode 100644 0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch delete mode 100644 0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch delete mode 100644 0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch delete mode 100644 0015-Don-t-add-rpaths-to-libraries.patch delete mode 100644 0016-configure-Allow-user-defined-C-compiler-flags.patch delete mode 100644 0017-Fix-skiplist-test-failure-12346.patch create mode 100644 macros.ocaml-rpm create mode 100644 ocaml_files.py diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch new file mode 100644 index 0000000..344a528 --- /dev/null +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -0,0 +1,25 @@ +From 03435cc789bfb783c1d5566e8abd387eea1b9155 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 24 Jun 2014 10:00:15 +0100 +Subject: [PATCH 1/4] Don't add rpaths to libraries. + +--- + configure.ac | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7c7d9a814c..d5040c279c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1106,8 +1106,6 @@ AS_IF([test x"$enable_shared" != "xno"], + [[*-*-openbsd7.[3-9]|*-*-openbsd[89].*]], + [mkdll_flags="${mkdll_flags} -Wl,--no-execute-only"]) + oc_ldflags="$oc_ldflags -Wl,-E" +- rpath="-Wl,-rpath," +- mksharedlibrpath="-Wl,-rpath," + natdynlinkopts="-Wl,-E" + supports_shared_libraries=true], + [mkdll='shared-libs-not-available']) +-- +2.41.0 + diff --git a/0001-increment-version-number-after-tagging-5.0.0.patch b/0001-increment-version-number-after-tagging-5.0.0.patch deleted file mode 100644 index 8103ef0..0000000 --- a/0001-increment-version-number-after-tagging-5.0.0.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 8741f4d88801e478e0ab7f871dc7dbcf9d7cc8f4 Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Thu, 15 Dec 2022 14:28:32 +0100 -Subject: [PATCH 01/17] increment version number after tagging 5.0.0 - ---- - VERSION | 2 +- - build-aux/ocaml_version.m4 | 6 +++--- - configure | Bin 617024 -> 617302 bytes - ocaml-variants.opam | 6 +++--- - 4 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/VERSION b/VERSION -index fc40ac52d7..314f8ec760 100644 ---- a/VERSION -+++ b/VERSION -@@ -1,4 +1,4 @@ --5.0.0 -+5.0.1+dev0-2022-12-15 - - # Starting with OCaml 4.14, although the version string that appears above is - # still correct and this file can thus still be used to figure it out, -diff --git a/build-aux/ocaml_version.m4 b/build-aux/ocaml_version.m4 -index ba48c00277..78049eaab0 100644 ---- a/build-aux/ocaml_version.m4 -+++ b/build-aux/ocaml_version.m4 -@@ -25,7 +25,7 @@ - # The following macro, OCAML__DEVELOPMENT_VERSION, should be either - # [true] of [false]. - --m4_define([OCAML__DEVELOPMENT_VERSION], [false]) -+m4_define([OCAML__DEVELOPMENT_VERSION], [true]) - - # The three following components (major, minor and patch level) MUST be - # integers. They MUST NOT be left-padded with zeros and all of them, -@@ -33,10 +33,10 @@ m4_define([OCAML__DEVELOPMENT_VERSION], [false]) - - m4_define([OCAML__VERSION_MAJOR], [5]) - m4_define([OCAML__VERSION_MINOR], [0]) --m4_define([OCAML__VERSION_PATCHLEVEL], [0]) -+m4_define([OCAML__VERSION_PATCHLEVEL], [1]) - # Note that the OCAML__VERSION_EXTRA string defined below is always empty - # for officially-released versions of OCaml. --m4_define([OCAML__VERSION_EXTRA], []) -+m4_define([OCAML__VERSION_EXTRA], [dev0-2022-12-15]) - - # The OCAML__VERSION_EXTRA_PREFIX macro defined below should be a - # single character: -diff --git a/configure b/configure -index 19764d19a9b8fb1a9f01868f8f7863733a4c4ecd..f54df41388272a49e583ca20f325508c5b814eff 100755 -GIT binary patch -delta 558 -zcmX?bMfKV>)eSNnf`-~DsbvPbMg~Skx`sexx>=UvgA=CkWIk^hOwrBS-boQyg!>lT -z^I#D^w|=RVFoum>>61UO%Wj^0>LnI?x7YGA-j2jHYkHy%qwMsubVfN$x$RTa8SPkv -zFfE!a6)I(ITT)b-%EjgH?C9$gALQ!e>KN=A?-~&jgcdML -zn(EW}a~M6D47nz63=t8qMU&s2pTqc^h0$<&pcn(`ObkI${VGs4{AT -zl=Ds(C}Lzq($6>DyNHn&(|gk&sxgYT=M^ymF%u9o12N0?ydu`PGG?IP+Aq9d1!A`C -q7hbSOxPU~a14U%Fd+Kt$%*A3FFo1ow*U#pd&5kL#U3xKx>Tv-4Xq`R) - -delta 271 -zcmcb1P4&PP)eSNnj0T%^IX*Zs8cf#nmH~32y^|t<)Vam>JU~ir!%`_`1FrPRAJ}C# -ze?IjRsBZgPUdG#zj0V#$>M+Vq|CY`u2NYAyV6m!Fq9{ZtO4CrI(b5D`Y(?UuQW&sl)xDHbt0O)n~9be#S` -zl~Hqge<33;n}VqU5P+mi`GP}&JpJ4iVw6nv4D<}z1B)4fmcP84Jkj -x_Tw*EftYRk@t5ooE?}YQKq1-f_IeyIbAdJiec-dbbq>dDcA(P@mvE>a2LKy+Taf?& - -diff --git a/ocaml-variants.opam b/ocaml-variants.opam -index 5928f357f2..a0876e02c9 100644 ---- a/ocaml-variants.opam -+++ b/ocaml-variants.opam -@@ -1,9 +1,9 @@ - opam-version: "2.0" --version: "5.0.0" -+version: "5.0.1+trunk" - license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" --synopsis: "Official release of OCaml 5.0.0" -+synopsis: "OCaml development version" - depends: [ -- "ocaml" {= "5.0.0" & post} -+ "ocaml" {= "5.0.1" & post} - "base-unix" {post} - "base-bigarray" {post} - "base-threads" {post} --- -2.41.0 - diff --git a/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch b/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch deleted file mode 100644 index 6a68fc4..0000000 --- a/0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 925bf9a6d828d7548751f9a21892cad6209fc950 Mon Sep 17 00:00:00 2001 -From: Gabriel Scherer -Date: Fri, 16 Dec 2022 09:41:13 +0100 -Subject: [PATCH 02/17] Merge pull request #11814 from - gasche/clarify-DLS.new_key-doc - -clarify the doc of Domain.DLS.new_key - -(cherry picked from commit be210179503c4a82b72dd4762560e13c408d37b7) ---- - stdlib/domain.mli | 37 ++++++++++++++++++++++++++++++------- - 1 file changed, 30 insertions(+), 7 deletions(-) - -diff --git a/stdlib/domain.mli b/stdlib/domain.mli -index 7763043aa5..2d79b3b0c3 100644 ---- a/stdlib/domain.mli -+++ b/stdlib/domain.mli -@@ -96,15 +96,38 @@ module DLS : sig - - val new_key : ?split_from_parent:('a -> 'a) -> (unit -> 'a) -> 'a key - (** [new_key f] returns a new key bound to initialiser [f] for accessing -- domain-local variables. -+, domain-local variables. - -- If [split_from_parent] is provided, spawning a domain will derive the -- child value (for this key) from the parent value. -+ If [split_from_parent] is not provided, the value for a new -+ domain will be computed on-demand by the new domain: the first -+ [get] call will call the initializer [f] and store that value. - -- Note that the [split_from_parent] call is computed in the parent -- domain, and is always computed regardless of whether the child domain -- will use it. If the splitting function is expensive or requires -- client-side computation, consider using ['a Lazy.t key]. -+ If [split_from_parent] is provided, spawning a domain will -+ derive the child value (for this key) from the parent -+ value. This computation happens in the parent domain and it -+ always happens, regardless of whether the child domain will -+ use it. -+ If the splitting function is expensive or requires -+ child-side computation, consider using ['a Lazy.t key]: -+ -+ {[ -+ let init () = ... -+ -+ let split_from_parent parent_value = -+ ... parent-side computation ...; -+ lazy ( -+ ... child-side computation ... -+ ) -+ -+ let key = Domain.DLS.new_key ~split_from_parent init -+ -+ let get () = Lazy.force (Domain.DLS.get key) -+ ]} -+ -+ In this case a part of the computation happens on the child -+ domain; in particular, it can access [parent_value] -+ concurrently with the parent domain, which may require -+ explicit synchronization to avoid data races. - *) - - val get : 'a key -> 'a --- -2.41.0 - diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch new file mode 100644 index 0000000..0d70a04 --- /dev/null +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -0,0 +1,45 @@ +From d9bcdb9d0a27e10350b1ca90df43b401656324f1 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 29 May 2012 20:44:18 +0100 +Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. + +--- + configure.ac | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index d5040c279c..4cbba04557 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -759,6 +759,10 @@ AS_CASE([$host], + internal_cflags="$cc_warnings"], + [common_cflags="-O"])]) + ++# Allow CFLAGS and LDFLAGS to be added. ++common_cflags="$common_cflags $CFLAGS" ++cclibs="$cclibs $LDFLAGS" ++ + # Enable SSE2 on x86 mingw to avoid using 80-bit registers. + AS_CASE([$host], + [i686-*-mingw32*], +@@ -2325,7 +2329,7 @@ AC_CONFIG_COMMANDS_PRE([ + [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) + mkdll_ldflags="" + AS_IF([test -n "${LDFLAGS}"], +- [for flag in ${LDFLAGS}; do ++ [for flag in "${LDFLAGS}"; do + mkdll_ldflags="${mkdll_ldflags} ${mkexe_ldflags_prefix}${flag}" + done + mkdll_ldflags_exp="$mkdll_ldflags"]) +@@ -2351,7 +2355,7 @@ ${mkdll_ldflags}" + ],[ + mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' + mkdll_ldflags_exp="${oc_dll_ldflags}" +- AS_IF([test -n ${LDFLAGS}], ++ AS_IF([test -n "${LDFLAGS}"], + [mkdll_ldflags_exp="$mkdll_ldflags_exp $LDFLAGS"]) + mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)" + mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}" +-- +2.41.0 + diff --git a/0003-Add-KC-Sivaramakrishnan-as-author.patch b/0003-Add-KC-Sivaramakrishnan-as-author.patch deleted file mode 100644 index 3186f31..0000000 --- a/0003-Add-KC-Sivaramakrishnan-as-author.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 83ef99f67fda11b268098a271f56b990e295bbc2 Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Tue, 20 Dec 2022 10:48:41 +0100 -Subject: [PATCH 03/17] Add KC Sivaramakrishnan as author - -For the two new chapters "Parallel programming" and "Memory model". - -Follow-up to #11280. - -(cherry picked from commit e6340ced8ca1d46f11eaea8e0474d1eb2142fe1c) ---- - manual/src/allfiles.etex | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/manual/src/allfiles.etex b/manual/src/allfiles.etex -index 6600943f54..3e07555b85 100644 ---- a/manual/src/allfiles.etex -+++ b/manual/src/allfiles.etex -@@ -12,7 +12,8 @@ - release \ocamlversion \\[1cm] - \Large Documentation and user's manual \\[1cm] - \large Xavier Leroy, \\ -- Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon \\[1cm] -+ Damien Doligez, Alain Frisch, Jacques Garrigue, \\ -+ Didier Rémy, KC Sivaramakrishnan and Jérôme Vouillon \\[1cm] - \today \\ - ~ - \vfill --- -2.41.0 - diff --git a/0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch b/0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch new file mode 100644 index 0000000..6d40ec0 --- /dev/null +++ b/0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch @@ -0,0 +1,34 @@ +From 352789925e44f012fbddc5dfae63abd15a447577 Mon Sep 17 00:00:00 2001 +From: Miod Vallat +Date: Mon, 4 Sep 2023 13:50:30 -0600 +Subject: [PATCH 3/4] Fix x86_64 delivery of effect-related exceptions + +--- + runtime/amd64.S | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/runtime/amd64.S b/runtime/amd64.S +index 7e6f95c680..24dfa7111b 100644 +--- a/runtime/amd64.S ++++ b/runtime/amd64.S +@@ -902,6 +902,7 @@ LBL(112): + movq Caml_state(current_stack), %rsi + SWITCH_OCAML_STACKS + /* No parent stack. Raise Effect.Unhandled. */ ++ ENTER_FUNCTION + movq %rax, C_ARG_1 + LEA_VAR(caml_raise_unhandled_effect, %rax) + jmp LBL(caml_c_call) +@@ -946,7 +947,8 @@ CFI_STARTPROC + UPDATE_BASE_POINTER(%rcx) + SWITCH_OCAML_STACKS + jmp *(%rbx) +-2: LEA_VAR(caml_raise_continuation_already_resumed, %rax) ++2: ENTER_FUNCTION ++ LEA_VAR(caml_raise_continuation_already_resumed, %rax) + jmp LBL(caml_c_call) + CFI_ENDPROC + ENDFUNCTION(G(caml_resume)) +-- +2.41.0 + diff --git a/0004-Update-framepointers-tests-to-avoid-false-positive-w.patch b/0004-Update-framepointers-tests-to-avoid-false-positive-w.patch new file mode 100644 index 0000000..2025d57 --- /dev/null +++ b/0004-Update-framepointers-tests-to-avoid-false-positive-w.patch @@ -0,0 +1,696 @@ +From 210f9b439b264fb6ab16802f468992086a4af58c Mon Sep 17 00:00:00 2001 +From: Fabrice Buoro +Date: Fri, 10 Mar 2023 09:36:22 -0700 +Subject: [PATCH 4/4] Update framepointers tests to avoid false positive with + inlined C functions + +--- + testsuite/tests/frame-pointers/c_call.ml | 14 +- + .../tests/frame-pointers/c_call.reference | 9 - + testsuite/tests/frame-pointers/c_call.run | 4 - + testsuite/tests/frame-pointers/c_call_.c | 14 +- + testsuite/tests/frame-pointers/effects.ml | 12 +- + .../tests/frame-pointers/effects.reference | 15 -- + testsuite/tests/frame-pointers/effects.run | 4 - + .../tests/frame-pointers/exception_handler.ml | 4 +- + .../exception_handler.reference | 12 -- + .../frame-pointers/exception_handler.run | 4 - + .../tests/frame-pointers/filter-locations.sh | 23 --- + testsuite/tests/frame-pointers/fp_backtrace.c | 186 +++++++++++------- + testsuite/tests/frame-pointers/reperform.ml | 4 +- + .../tests/frame-pointers/reperform.reference | 3 - + testsuite/tests/frame-pointers/reperform.run | 4 - + .../tests/frame-pointers/stack_realloc.ml | 4 +- + .../frame-pointers/stack_realloc.reference | 3 - + .../tests/frame-pointers/stack_realloc.run | 4 - + .../tests/frame-pointers/stack_realloc2.ml | 4 +- + .../frame-pointers/stack_realloc2.reference | 3 - + .../tests/frame-pointers/stack_realloc2.run | 4 - + 21 files changed, 144 insertions(+), 190 deletions(-) + delete mode 100644 testsuite/tests/frame-pointers/c_call.run + delete mode 100644 testsuite/tests/frame-pointers/effects.run + delete mode 100644 testsuite/tests/frame-pointers/exception_handler.run + delete mode 100755 testsuite/tests/frame-pointers/filter-locations.sh + delete mode 100644 testsuite/tests/frame-pointers/reperform.run + delete mode 100644 testsuite/tests/frame-pointers/stack_realloc.run + delete mode 100644 testsuite/tests/frame-pointers/stack_realloc2.run + +diff --git a/testsuite/tests/frame-pointers/c_call.ml b/testsuite/tests/frame-pointers/c_call.ml +index 7d48b4947d..f552b0df8f 100644 +--- a/testsuite/tests/frame-pointers/c_call.ml ++++ b/testsuite/tests/frame-pointers/c_call.ml +@@ -7,20 +7,20 @@ all_modules = "${readonly_files} c_call. + + *) + +-external fp_backtrace : unit -> unit = "fp_backtrace" +-external fp_backtrace_no_alloc : unit -> unit = "fp_backtrace" [@@noalloc] +-external fp_backtrace_many_args : int -> int -> int -> int -> int -> int -> int +- -> int -> int -> int -> int -> unit = ++external fp_backtrace : string -> unit = "fp_backtrace" ++external fp_backtrace_no_alloc : string -> unit = "fp_backtrace" [@@noalloc] ++external fp_backtrace_many_args : string -> int -> int -> int -> int -> int ++ -> int -> int -> int -> int -> int -> int -> unit = + "fp_backtrace_many_args_argv" "fp_backtrace_many_args" + + let[@inline never] f () = + (* Check backtrace through caml_c_call_stack_args *) +- fp_backtrace_many_args 1 2 3 4 5 6 7 8 9 10 11; ++ fp_backtrace_many_args Sys.argv.(0) 1 2 3 4 5 6 7 8 9 10 11; + (* Check backtrace through caml_c_call. + * Also check that caml_c_call_stack_args correctly restores rbp register *) +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + (* Check caml_c_call correctly restores rbp register *) +- fp_backtrace_no_alloc (); ++ fp_backtrace_no_alloc Sys.argv.(0); + 42 + + let () = ignore (f ()) +diff --git a/testsuite/tests/frame-pointers/c_call.reference b/testsuite/tests/frame-pointers/c_call.reference +index 92fb40a238..23095e7431 100644 +--- a/testsuite/tests/frame-pointers/c_call.reference ++++ b/testsuite/tests/frame-pointers/c_call.reference +@@ -3,19 +3,10 @@ caml_c_call_stack_args + camlC_call.f + camlC_call.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + caml_c_call + camlC_call.f + camlC_call.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + camlC_call.f + camlC_call.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main +diff --git a/testsuite/tests/frame-pointers/c_call.run b/testsuite/tests/frame-pointers/c_call.run +deleted file mode 100644 +index e96b5ea13a..0000000000 +--- a/testsuite/tests/frame-pointers/c_call.run ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/sh +- +-${program} 2>&1 \ +- | ${test_source_directory}/filter-locations.sh ${program} >${output} +diff --git a/testsuite/tests/frame-pointers/c_call_.c b/testsuite/tests/frame-pointers/c_call_.c +index 634c4dd937..a75100b213 100644 +--- a/testsuite/tests/frame-pointers/c_call_.c ++++ b/testsuite/tests/frame-pointers/c_call_.c +@@ -16,10 +16,10 @@ + #include + #include "caml/mlvalues.h" + +-void fp_backtrace(void); ++void fp_backtrace(value); + +-value fp_backtrace_many_args(value a, value b, value c, value d, value e, +- value f, value g, value h, value i, value j, value k) ++value fp_backtrace_many_args(value argv0, value a, value b, value c, ++ value d, value e, value f, value g, value h, value i, value j, value k) + { + assert(Int_val(a) == 1); + assert(Int_val(b) == 2); +@@ -33,15 +33,15 @@ value fp_backtrace_many_args(value a, value b, value c, value d, value e, + assert(Int_val(j) == 10); + assert(Int_val(k) == 11); + +- fp_backtrace(); ++ fp_backtrace(argv0); + + return Val_unit; + } + +-value fp_bactrace_many_args_argv(value *argv, int argc) ++value fp_bactrace_many_args_argv(value argv0, value *argv, int argc) + { + assert(argc == 11); + +- return fp_backtrace_many_args(argv[0], argv[1], argv[2], argv[3], argv[4], +- argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]); ++ return fp_backtrace_many_args(argv0, argv[0], argv[1], argv[2], argv[3], ++ argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]); + } +diff --git a/testsuite/tests/frame-pointers/effects.ml b/testsuite/tests/frame-pointers/effects.ml +index 2aa7012606..ac304683fe 100644 +--- a/testsuite/tests/frame-pointers/effects.ml ++++ b/testsuite/tests/frame-pointers/effects.ml +@@ -11,26 +11,26 @@ open Printf + open Effect + open Effect.Deep + +-external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ++external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] + + type _ t += E : int -> int t + + let[@inline never] f () = + printf "# computation f\n%!"; +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + printf "# perform effect (E 0)\n%!"; + let v = perform (E 0) in + printf "# perform returns %d\n%!" v; +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + v + 1 + + let h (type a) (eff : a t) : ((a, 'b) continuation -> 'b) option = + let[@inline never] h_effect_e v k = + printf "# caught effect (E %d). continuing...\n%!" v; +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + let v = continue k (v + 1) in + printf "# continue returns %d\n%!" v; +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + v + 1 + in + match eff with +@@ -41,7 +41,7 @@ let h (type a) (eff : a t) : ((a, 'b) continuation -> 'b) option = + let v = + let[@inline never] v_retc v = + printf "# done %d\n%!" v; +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + v + 1 + in + match_with f () +diff --git a/testsuite/tests/frame-pointers/effects.reference b/testsuite/tests/frame-pointers/effects.reference +index c8bd0a391a..8ae3fc26df 100644 +--- a/testsuite/tests/frame-pointers/effects.reference ++++ b/testsuite/tests/frame-pointers/effects.reference +@@ -3,39 +3,24 @@ camlEffects.f + caml_runstack + camlEffects.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + # perform effect (E 0) + # caught effect (E 0). continuing... + camlEffects.h_effect_e + camlEffects.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + # perform returns 1 + camlEffects.f + caml_runstack + camlEffects.h_effect_e + camlEffects.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + # done 2 + camlEffects.v_retc + camlEffects.h_effect_e + camlEffects.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + # continue returns 3 + camlEffects.h_effect_e + camlEffects.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + # result=4 +diff --git a/testsuite/tests/frame-pointers/effects.run b/testsuite/tests/frame-pointers/effects.run +deleted file mode 100644 +index e96b5ea13a..0000000000 +--- a/testsuite/tests/frame-pointers/effects.run ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/sh +- +-${program} 2>&1 \ +- | ${test_source_directory}/filter-locations.sh ${program} >${output} +diff --git a/testsuite/tests/frame-pointers/exception_handler.ml b/testsuite/tests/frame-pointers/exception_handler.ml +index 6bf5bf470d..19773f78de 100644 +--- a/testsuite/tests/frame-pointers/exception_handler.ml ++++ b/testsuite/tests/frame-pointers/exception_handler.ml +@@ -8,7 +8,7 @@ + *) + + (* https://github.com/ocaml/ocaml/pull/11031 *) +-external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ++external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] + + exception Exn1 + exception Exn2 +@@ -38,7 +38,7 @@ let[@inline never] handler () = + let _ = Sys.opaque_identity x0 in + let _ = Sys.opaque_identity x1 in + let _ = Sys.opaque_identity x2 in +- fp_backtrace () ++ fp_backtrace Sys.argv.(0) + + let[@inline never] nested i = + begin +diff --git a/testsuite/tests/frame-pointers/exception_handler.reference b/testsuite/tests/frame-pointers/exception_handler.reference +index 513ca488b9..e012fb6d4f 100644 +--- a/testsuite/tests/frame-pointers/exception_handler.reference ++++ b/testsuite/tests/frame-pointers/exception_handler.reference +@@ -2,27 +2,15 @@ camlException_handler.handler + camlException_handler.bare + camlException_handler.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + camlException_handler.handler + camlException_handler.bare + camlException_handler.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + camlException_handler.handler + camlException_handler.nested + camlException_handler.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main + camlException_handler.handler + camlException_handler.nested + camlException_handler.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main +diff --git a/testsuite/tests/frame-pointers/exception_handler.run b/testsuite/tests/frame-pointers/exception_handler.run +deleted file mode 100644 +index e96b5ea13a..0000000000 +--- a/testsuite/tests/frame-pointers/exception_handler.run ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/sh +- +-${program} 2>&1 \ +- | ${test_source_directory}/filter-locations.sh ${program} >${output} +diff --git a/testsuite/tests/frame-pointers/filter-locations.sh b/testsuite/tests/frame-pointers/filter-locations.sh +deleted file mode 100755 +index 31c7fc3189..0000000000 +--- a/testsuite/tests/frame-pointers/filter-locations.sh ++++ /dev/null +@@ -1,23 +0,0 @@ +-#!/bin/sh +- +-set -eu +- +-program="${1}" +-# https://stackoverflow.com/questions/29613304/is-it-possible-to-escape-regex-metacharacters-reliably-with-sed/29626460#29626460 +-program_escaped=$(echo ${program} | sed 's/[^^\\]/[&]/g; s/\^/\\^/g; s/\\/\\\\/g') +-regex_backtrace='^.*(\(.*\)+0x[[:xdigit:]]*)[0x[[:xdigit:]]*]$' +-regex_trim_fun='^\(caml.*\)_[[:digit:]]*$' +- +-# - Ignore backtrace not coming from the program binary +-# - Discard the number suffix from OCaml function name +-# - Remove strange '[0x.....]' entries inserted by some implementation +-# of backtrace_symbols_fd +-# - Keep the other lines +-sed -e \ +- "/${regex_backtrace}/ { +- /^${program_escaped}/ ! d +- s/${regex_backtrace}/\1/ +- s/${regex_trim_fun}/\1/ +- s;caml_\(main\|startup\);caml_main/caml_startup; +- }" \ +- -e '/^\[0x/d' +diff --git a/testsuite/tests/frame-pointers/fp_backtrace.c b/testsuite/tests/frame-pointers/fp_backtrace.c +index a521218a38..cef7ccd9f2 100644 +--- a/testsuite/tests/frame-pointers/fp_backtrace.c ++++ b/testsuite/tests/frame-pointers/fp_backtrace.c +@@ -1,10 +1,17 @@ + #include +-#include +-#include +-#include ++#include ++#include + #include ++#include ++#include + +-#define ARRSIZE(a) (sizeof(a) / sizeof(*(a))) ++#include "caml/mlvalues.h" ++ ++#define ARR_SIZE(a) (sizeof(a) / sizeof(*(a))) ++ ++#define RE_FUNC_NAME "^.*\\((.+)\\+0x[[:xdigit:]]+\\) \\[0x[[:xdigit:]]+\\]$" ++#define RE_TRIM_FUNC "(caml.*)_[[:digit:]]+" ++#define CAML_ENTRY "caml_program" + + typedef struct frame_info + { +@@ -12,99 +19,138 @@ typedef struct frame_info + void* retaddr; /* rip */ + } frame_info; + +-jmp_buf resume_buf; + ++/* ++ * A backtrace symbol looks like: ++ * ./path/to/binary(camlModule_fn_123+0xAABBCC) [0xAABBCCDDEE] ++ */ ++static const char* backtrace_symbol(const struct frame_info* fi) ++{ ++ char** symbols = backtrace_symbols(&fi->retaddr, 1); ++ if (!symbols) { ++ perror("backtrace_symbols"); ++ return NULL; ++ } ++ ++ const char* symbol = strdup(symbols[0]); ++ free(symbols); ++ return symbol; ++} + +-static void signal_handler(int signum) ++static bool is_from_executable(const char* symbol, const char* execname) + { +- /* Should be safe to be called from a signal handler. +- * See 21.2.1 "Performing a nonlocal goto from a signal handler" from +- * The Linux Programming Interface, Michael Kerrisk */ +- siglongjmp(resume_buf, 1); ++ return strncmp(symbol, execname, strlen(execname)) == 0; + } + +-static int install_signal_handlers(const int signals[], struct sigaction +- handlers[], int count) ++static regmatch_t func_name_from_symbol(const char* symbol) + { +- for (int i = 0; i < count; i++) { +- struct sigaction action = { 0 }; +- action.sa_handler = signal_handler; +- sigemptyset(&action.sa_mask); +- action.sa_flags = 0; +- +- if (sigaction(signals[i], &action, &handlers[i]) != 0) { +- perror("sigaction"); +- return -1; +- } ++ regex_t regex; ++ regmatch_t match[2] = { {-1, -1}, {-1, -1}}; ++ char errbuf[128]; ++ int err; ++ ++ err = regcomp(®ex, RE_FUNC_NAME, REG_EXTENDED); ++ if (err) { ++ regerror(err, ®ex, errbuf, ARR_SIZE(errbuf)); ++ fprintf(stderr, "regcomp: %s\n", errbuf); ++ return match[0]; + } +- return 0; ++ ++ err = regexec(®ex, symbol, ARR_SIZE(match), match, 0); ++ if (err == REG_NOMATCH) ++ return match[0]; ++ ++ return match[1]; + } + +-static int restore_signal_handlers(const int signals[], struct sigaction +- handlers[], int count) ++static bool is_caml_entry(const char* symbol, const regmatch_t* funcname) + { +- for (int i = 0; i < count; i++) { +- if (sigaction(signals[i], &handlers[i], NULL) != 0) { +- perror("sigaction"); +- return -1; +- } +- } +- return 0; ++ //regoff_t len = funcname->rm_eo - funcname->rm_so; ++ //return strnstr(symbol + funcname->rm_so, CAML_ENTRY, len) == 0; ++ return strstr(symbol + funcname->rm_so, CAML_ENTRY) != NULL; + } + +-static int safe_read(const struct frame_info* fi, struct frame_info** prev, +- void** retaddr) ++static regmatch_t trim_func_name(const char* symbol, const regmatch_t* funcname) + { +- /* Signals to ignore while attempting to read frame_info members */ +- const int signals[] = { SIGSEGV, SIGBUS }; +- /* Store original signal handers */ +- struct sigaction handlers[ARRSIZE(signals)] = { 0 }; +- int ret = 0; +- +- if (install_signal_handlers(signals, handlers, ARRSIZE(signals)) != 0) +- return -1; +- +- if (!sigsetjmp(resume_buf, 1)) { +- *prev = fi->prev; +- *retaddr = fi->retaddr; +- } else { +- ret = -1; ++ regex_t regex; ++ regmatch_t match[2] = { {-1, -1}, {-1, -1}}; ++ char errbuf[128]; ++ int err; ++ ++ err = regcomp(®ex, RE_TRIM_FUNC, REG_EXTENDED); ++ if (err) { ++ regerror(err, ®ex, errbuf, ARR_SIZE(errbuf)); ++ fprintf(stderr, "regcomp: %s\n", errbuf); ++ return match[0]; + } + +- if (restore_signal_handlers(signals, handlers, ARRSIZE(signals)) != 0) +- return -1; ++ match[0] = *funcname; ++ err = regexec(®ex, symbol, ARR_SIZE(match), match, REG_STARTEND); ++ if (err == REG_NOMATCH) { ++ /* match[0] has already been overwritten to hold the function full name for ++ regexec */ ++ return match[1]; ++ } + +- return ret; ++ return match[1]; + } + +-static void print_location(void* addr) ++static void print_symbol(const char* symbol, const regmatch_t* match) + { +- if (!addr) +- return; ++ regoff_t off = match->rm_so; ++ regoff_t len = match->rm_eo - match->rm_so; + +- /* This requires the binary to be linked with '-rdynamic' */ +- backtrace_symbols_fd(&addr, 1, STDOUT_FILENO); ++ fprintf(stdout, "%.*s\n", len, symbol + off); ++ fflush(stdout); + } + +-void fp_backtrace(void) ++void fp_backtrace(value argv0) + { +- struct frame_info *fi; +- struct frame_info* next; +- void* retaddr; ++ const char* execname = String_val(argv0); ++ struct frame_info* next = NULL; ++ const char* symbol = NULL; + +- fi = __builtin_frame_address(0); +- retaddr = __builtin_extract_return_addr(__builtin_return_address(0)); +- +- for (; fi; fi = next) { +- if (safe_read(fi, &next, &retaddr) != 0) +- return; +- +- print_location(retaddr); ++ for (struct frame_info* fi = __builtin_frame_address(0); fi; fi = next) { ++ next = fi->prev; + + /* Detect the simplest kind of infinite loop */ + if (fi == next) { +- printf("fp_backtrace: loop detected\n"); +- return; ++ fprintf(stderr, "fp_backtrace: loop detected\n"); ++ break; + } ++ ++ symbol = backtrace_symbol(fi); ++ if (!symbol) ++ continue; ++ ++ /* Skip entries not from the test */ ++ if (!is_from_executable(symbol, execname)) ++ goto skip; ++ ++ /* Exctract the full function name */ ++ regmatch_t funcname = func_name_from_symbol(symbol); ++ if (funcname.rm_so == -1) ++ goto skip; ++ ++ /* Trim numeric suffix from caml functions */ ++ regmatch_t functrimmed = trim_func_name(symbol, &funcname); ++ ++ /* Use the trimmed caml name if available, otherwise use the full function ++ name */ ++ const regmatch_t* match = (functrimmed.rm_so != -1) ? ++ &functrimmed : &funcname; ++ ++ print_symbol(symbol, match); ++ ++ /* Stop the backtrace at caml_program */ ++ if (is_caml_entry(symbol, &funcname)) ++ break; ++ ++skip: ++ free((void*)symbol); ++ symbol = NULL; + } ++ ++ if (symbol) ++ free((void*)symbol); + } +diff --git a/testsuite/tests/frame-pointers/reperform.ml b/testsuite/tests/frame-pointers/reperform.ml +index ec5393907c..7a3b09162b 100644 +--- a/testsuite/tests/frame-pointers/reperform.ml ++++ b/testsuite/tests/frame-pointers/reperform.ml +@@ -11,7 +11,7 @@ + open Effect + open Effect.Deep + +-external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ++external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] + + type _ Effect.t += E : unit t + | F : unit t +@@ -22,7 +22,7 @@ let rec foo n = + if n = 5 then begin + perform E; + print_endline "# resumed..."; +- fp_backtrace () ++ fp_backtrace Sys.argv.(0) + end; + foo (n + 1) + n + end +diff --git a/testsuite/tests/frame-pointers/reperform.reference b/testsuite/tests/frame-pointers/reperform.reference +index 9ac6681d4b..e215f77169 100644 +--- a/testsuite/tests/frame-pointers/reperform.reference ++++ b/testsuite/tests/frame-pointers/reperform.reference +@@ -15,6 +15,3 @@ camlReperform.bar + caml_runstack + camlReperform.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main +diff --git a/testsuite/tests/frame-pointers/reperform.run b/testsuite/tests/frame-pointers/reperform.run +deleted file mode 100644 +index e96b5ea13a..0000000000 +--- a/testsuite/tests/frame-pointers/reperform.run ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/sh +- +-${program} 2>&1 \ +- | ${test_source_directory}/filter-locations.sh ${program} >${output} +diff --git a/testsuite/tests/frame-pointers/stack_realloc.ml b/testsuite/tests/frame-pointers/stack_realloc.ml +index fc4e9e9d3b..cacc43c216 100644 +--- a/testsuite/tests/frame-pointers/stack_realloc.ml ++++ b/testsuite/tests/frame-pointers/stack_realloc.ml +@@ -13,7 +13,7 @@ open Effect.Deep + + type _ t += E : int -> int t + +-external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ++external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] + external c_fun : unit -> int = "c_fun" + + let[@inline never][@local never] f x = x +@@ -42,7 +42,7 @@ let[@inline never] consume_stack () = + + let[@inline never] callback () = + consume_stack (); +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + 0 + + let _ = Callback.register "callback" callback +diff --git a/testsuite/tests/frame-pointers/stack_realloc.reference b/testsuite/tests/frame-pointers/stack_realloc.reference +index 016a03550a..e61d4104e0 100644 +--- a/testsuite/tests/frame-pointers/stack_realloc.reference ++++ b/testsuite/tests/frame-pointers/stack_realloc.reference +@@ -7,6 +7,3 @@ camlStack_realloc.f_comp + caml_runstack + camlStack_realloc.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main +diff --git a/testsuite/tests/frame-pointers/stack_realloc.run b/testsuite/tests/frame-pointers/stack_realloc.run +deleted file mode 100644 +index e96b5ea13a..0000000000 +--- a/testsuite/tests/frame-pointers/stack_realloc.run ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/sh +- +-${program} 2>&1 \ +- | ${test_source_directory}/filter-locations.sh ${program} >${output} +diff --git a/testsuite/tests/frame-pointers/stack_realloc2.ml b/testsuite/tests/frame-pointers/stack_realloc2.ml +index a4aea249ea..b2a602fa4a 100644 +--- a/testsuite/tests/frame-pointers/stack_realloc2.ml ++++ b/testsuite/tests/frame-pointers/stack_realloc2.ml +@@ -13,7 +13,7 @@ open Effect.Deep + + type _ t += E : int -> int t + +-external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] ++external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] + external c_fun : unit -> int = "c_fun" + + let[@inline never][@local never] f x = x +@@ -41,7 +41,7 @@ let[@inline never] consume_stack () = + ignore (gobbler count) + + let[@inline never] callback () = +- fp_backtrace (); ++ fp_backtrace Sys.argv.(0); + 0 + + let _ = Callback.register "callback" callback +diff --git a/testsuite/tests/frame-pointers/stack_realloc2.reference b/testsuite/tests/frame-pointers/stack_realloc2.reference +index ae492abd88..0051f3bad0 100644 +--- a/testsuite/tests/frame-pointers/stack_realloc2.reference ++++ b/testsuite/tests/frame-pointers/stack_realloc2.reference +@@ -7,6 +7,3 @@ camlStack_realloc2.f_comp + caml_runstack + camlStack_realloc2.entry + caml_program +-caml_start_program +-caml_main/caml_startup +-main +diff --git a/testsuite/tests/frame-pointers/stack_realloc2.run b/testsuite/tests/frame-pointers/stack_realloc2.run +deleted file mode 100644 +index e96b5ea13a..0000000000 +--- a/testsuite/tests/frame-pointers/stack_realloc2.run ++++ /dev/null +@@ -1,4 +0,0 @@ +-#!/bin/sh +- +-${program} 2>&1 \ +- | ${test_source_directory}/filter-locations.sh ${program} >${output} +-- +2.41.0 + diff --git a/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch b/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch deleted file mode 100644 index 846f0be..0000000 --- a/0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ea8b79eda165722d04b369f1811a5aa80ab5acc6 Mon Sep 17 00:00:00 2001 -From: SSHz -Date: Sun, 27 Nov 2022 14:46:16 +0000 -Subject: [PATCH 04/17] removed set but unused variables in yacc/reader.c - (#11758) - -(cherry picked from commit 0114f62d3ed056254ac25192f724e92a2ff6c448) ---- - yacc/reader.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/yacc/reader.c b/yacc/reader.c -index 7377967994..7a0b888961 100644 ---- a/yacc/reader.c -+++ b/yacc/reader.c -@@ -1049,12 +1049,10 @@ void read_declarations(void) - void output_token_type(void) - { - bucket * bp; -- int n; - - fprintf(interface_file, "type token =\n"); - if (!rflag) ++outline; - fprintf(output_file, "type token =\n"); -- n = 0; - for (bp = first_symbol; bp; bp = bp->next) { - if (bp->class == TERM && bp->true_token) { - fprintf(interface_file, " | %s", bp->name); -@@ -1068,7 +1066,6 @@ void output_token_type(void) - fprintf(interface_file, "\n"); - if (!rflag) ++outline; - fprintf(output_file, "\n"); -- n++; - } - } - fprintf(interface_file, "\n"); --- -2.41.0 - diff --git a/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch b/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch deleted file mode 100644 index 8421941..0000000 --- a/0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 848e28fc6f3f3c9802b23c00f2d77f568c761667 Mon Sep 17 00:00:00 2001 -From: Gabriel Scherer -Date: Tue, 3 Jan 2023 17:41:12 +0100 -Subject: [PATCH 05/17] Merge pull request #11860 from - Octachron/index_for_stdlib - -documentation: sort modules alphabetically - -fixes #11857 - -(cherry picked from commit 14004c6d4bedadb7215ded2c77230270e52307ff) ---- - api_docgen/Makefile.docfiles | 24 +++++++++++++++--------- - 1 file changed, 15 insertions(+), 9 deletions(-) - -diff --git a/api_docgen/Makefile.docfiles b/api_docgen/Makefile.docfiles -index 0c2412b192..f12830b1ec 100644 ---- a/api_docgen/Makefile.docfiles -+++ b/api_docgen/Makefile.docfiles -@@ -26,10 +26,6 @@ define capitalize - $(foreach m,$(1),$(call capitalize_one,$m)) - endef - --define sort --$(shell $(OCAMLDEP) -sort $(1)) --endef -- - runtime_events_MLIS := runtime_events.mli - str_MLIS := str.mli - unix_MLIS := unix.mli unixLabels.mli -@@ -62,10 +58,8 @@ endif - libref_TEXT=Ocaml_operators Format_tutorial - libref_C=$(call capitalize,$(libref)) - --PARSING_MLIS := $(call sort, \ -- $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))\ --) --UTILS_MLIS := $(call sort,$(notdir $(wildcard $(ROOTDIR)/utils/*.mli))) -+PARSING_MLIS := $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli)) -+UTILS_MLIS := $(notdir $(wildcard $(ROOTDIR)/utils/*.mli)) - DRIVER_MLIS := pparse.mli - - compilerlibref_MLIS= \ -@@ -76,8 +70,20 @@ compilerlibref=$(compilerlibref_MLIS:%.mli=%) - compilerlibref_TEXT=Compiler_libs - compilerlibref_C=$(call capitalize,$(compilerlibref)) - --ALL_LIBREF= $(libref_TEXT:%=libref/%) $(libref:%=libref/%) -+ALL_LIBREF= \ -+ $(sort $(libref_TEXT:%=libref/%)) \ -+ $(sort $(filter-out libref/camlinternal%, $(libref:%=libref/%))) \ -+ $(sort $(filter libref/camlinternal%, $(libref:%=libref/%))) -+ - ALL_COMPILERLIBREF= \ - $(compilerlibref_TEXT:%=compilerlibref/%) \ - $(compilerlibref:%=compilerlibref/%) -+# Note that the output of $(wildcard ...) is sorted alphabetically. -+# The compilerlibs index will be thus be sorted first by category: -+# - text documentation -+# - parsing modules -+# - utils modules -+# - driver modules -+# And then alphabetically inside each category. -+ - ALL_DOC= $(ALL_LIBREF) $(ALL_COMPILERLIBREF) --- -2.41.0 - diff --git a/0006-Allow-installing-in-folder-with-space-in-name-11590.patch b/0006-Allow-installing-in-folder-with-space-in-name-11590.patch deleted file mode 100644 index ed6c490..0000000 --- a/0006-Allow-installing-in-folder-with-space-in-name-11590.patch +++ /dev/null @@ -1,42 +0,0 @@ -From a3cd42bc03ed0fc706bb7364fdb14b29b1925600 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Wed, 4 Jan 2023 16:33:28 +0000 -Subject: [PATCH 06/17] Allow installing in folder with space in name (#11590) - -- fix(build): Repair make install (in man/Makefile) ---- - Changes | 8 ++++++++ - man/Makefile | 4 ++-- - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/Changes b/Changes -index 776f6e7a45..438c0f3ec2 100644 ---- a/Changes -+++ b/Changes -@@ -1,3 +1,11 @@ -+OCaml 5.0 maintenance version -+----------------------------- -+ -+### Build system: -+ -+- #11590: Allow installing to a destination path containing spaces. -+ (Élie Brami, review by Sébastien Hinderer and David Allsopp) -+ - OCaml 5.0 (16 December 2022) - ---------------------------- - -diff --git a/man/Makefile b/man/Makefile -index 36d3126563..10cc8bbe41 100644 ---- a/man/Makefile -+++ b/man/Makefile -@@ -22,5 +22,5 @@ MANPAGES = $(addsuffix .1,\ - - .PHONY: install - install: -- $(MKDIR) $(INSTALL_PROGRAMS_MAN_DIR) -- $(INSTALL_DATA) $(MANPAGES) $(INSTALL_PROGRAMS_MAN_DIR) -+ $(MKDIR) '$(INSTALL_PROGRAMS_MAN_DIR)' -+ $(INSTALL_DATA) $(MANPAGES) '$(INSTALL_PROGRAMS_MAN_DIR)' --- -2.41.0 - diff --git a/0007-Detect-unused-Makefile-variables-in-workflow.patch b/0007-Detect-unused-Makefile-variables-in-workflow.patch deleted file mode 100644 index 0af534d..0000000 --- a/0007-Detect-unused-Makefile-variables-in-workflow.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 44f4015f9a649e164b332e6ab1302139191d4a4f Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Wed, 3 Mar 2021 12:24:36 +0000 -Subject: [PATCH 07/17] Detect unused Makefile variables in workflow - ---- - tools/ci/actions/runner.sh | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh -index ede27f710a..26123b40d1 100755 ---- a/tools/ci/actions/runner.sh -+++ b/tools/ci/actions/runner.sh -@@ -21,6 +21,8 @@ PREFIX=~/local - MAKE="make $MAKE_ARG" - SHELL=dash - -+MAKE_WARN="$MAKE --warn-undefined-variables" -+ - export PATH=$PREFIX/bin:$PATH - - Configure () { -@@ -60,9 +62,18 @@ EOF - } - - Build () { -- $MAKE world.opt -+ if [ "$(uname)" = 'Darwin' ]; then -+ script -q build.log $MAKE_WARN -+ else -+ script --return --command "$MAKE_WARN" build.log -+ fi - echo Ensuring that all names are prefixed in the runtime - ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a -+ if grep -Fq ' warning: undefined variable ' build.log; then -+ echo Undefined Makefile variables detected -+ exit 1 -+ fi -+ rm build.log - } - - Test () { --- -2.41.0 - diff --git a/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch b/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch deleted file mode 100644 index 504a5fd..0000000 --- a/0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2eccdd3cd78624b0f2664d6152afbcae167f6f8b Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Mon, 20 Feb 2023 20:27:58 +0000 -Subject: [PATCH 08/17] Fix incorrect variable from runtime/Makefile merge - -Wrong CPPFLAGS used when assembling with ASPP. ---- - Makefile | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/Makefile b/Makefile -index bb2c245eab..3ea3296c7f 100644 ---- a/Makefile -+++ b/Makefile -@@ -952,6 +952,15 @@ ASPP_ERROR = \ - runtime/%.o: runtime/%.S - $(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR) - -+# $(OC_DEBUG_CPPFLAGS) and $(OC_INSTR_CPPFLAGS) are still used in the two -+# recipes just below instead of the correct $(ocamlrund_CPPFLAGS) and -+# $(ocamlruni_CPPFLAGS). This has been fixed on trunk, but in the -+# 5.0 maintenance branch here we just define default values for those OC_* -+# variables to avoid an undefined-variable warning, preserving exactly the -+# (somewhat strange) behaviour of the 5.0.0 release. -+OC_DEBUG_CPPFLAGS ?= -+OC_INSTR_CPPFLAGS ?= -+ - runtime/%.d.o: runtime/%.S - $(ASPP) $(OC_ASPPFLAGS) $(OC_DEBUG_CPPFLAGS) -o $@ $< || $(ASPP_ERROR) - --- -2.41.0 - diff --git a/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch b/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch deleted file mode 100644 index cdb8e60..0000000 --- a/0009-Provide-a-default-for-OCAMLDEPFLAGS.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 5f3f8bf734bdc02adc69cf92f066547bd71e8a25 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Mon, 20 Feb 2023 20:31:31 +0000 -Subject: [PATCH 09/17] Provide a default for $(OCAMLDEPFLAGS) - ---- - Makefile.common | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Makefile.common b/Makefile.common -index 536e2a28ca..e2a9176a5c 100644 ---- a/Makefile.common -+++ b/Makefile.common -@@ -169,6 +169,7 @@ endef # PROGRAM_SYNONYM - # should take place *before* Makefile.common is included. - - OCAMLDEP ?= $(BEST_OCAMLDEP) -+OCAMLDEPFLAGS ?= - OC_OCAMLDEPFLAGS = -slash - OC_OCAMLDEPDIRS = - OCAMLDEP_CMD = $(OCAMLDEP) $(OC_OCAMLDEPFLAGS) \ --- -2.41.0 - diff --git a/0010-Report-all-post-build-failures.patch b/0010-Report-all-post-build-failures.patch deleted file mode 100644 index 952529f..0000000 --- a/0010-Report-all-post-build-failures.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7f4569e22c2a19d51324c44a2954b10427df2cd8 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Tue, 21 Feb 2023 14:44:21 +0000 -Subject: [PATCH 10/17] Report all post-build failures - -Rather than just reporting un-prefixed symbol names, also report -undefined variables. ---- - tools/ci/actions/runner.sh | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh -index 26123b40d1..6e5a30f73a 100755 ---- a/tools/ci/actions/runner.sh -+++ b/tools/ci/actions/runner.sh -@@ -67,13 +67,19 @@ Build () { - else - script --return --command "$MAKE_WARN" build.log - fi -- echo Ensuring that all names are prefixed in the runtime -- ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a -+ failed=0 - if grep -Fq ' warning: undefined variable ' build.log; then - echo Undefined Makefile variables detected -- exit 1 -+ failed=1 - fi - rm build.log -+ echo Ensuring that all names are prefixed in the runtime -+ if ! ./tools/check-symbol-names runtime/*.a otherlibs/*/lib*.a ; then -+ failed=1 -+ fi -+ if ((failed)); then -+ exit 1 -+ fi - } - - Test () { --- -2.41.0 - diff --git a/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch b/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch deleted file mode 100644 index 543afca..0000000 --- a/0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0f6dc503bf3814e5547ffb4e9d6ea0a75ffd1ec0 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Wed, 22 Feb 2023 10:47:00 +0000 -Subject: [PATCH 11/17] Finish off removal of FORCE_INSTRUMENTED_RUNTIME - ---- - utils/Makefile | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/utils/Makefile b/utils/Makefile -index 0fcbc59ce5..efd8574fa5 100644 ---- a/utils/Makefile -+++ b/utils/Makefile -@@ -90,7 +90,6 @@ config_main.ml: config.mlp $(ROOTDIR)/Makefile.config Makefile config.common.ml - $(call SUBST,FUNCTION_SECTIONS) \ - $(call SUBST,CC_HAS_DEBUG_PREFIX_MAP) \ - $(call SUBST,AS_HAS_DEBUG_PREFIX_MAP) \ -- $(call SUBST,FORCE_INSTRUMENTED_RUNTIME) \ - $< > $@ - cat config.common.ml >> $@ - --- -2.41.0 - diff --git a/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch b/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch deleted file mode 100644 index d0416ba..0000000 --- a/0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch +++ /dev/null @@ -1,27 +0,0 @@ -From ffb2022797986324213891a59c02af46269b5c17 Mon Sep 17 00:00:00 2001 -From: Damien Doligez -Date: Mon, 17 Apr 2023 11:36:32 +0200 -Subject: [PATCH 12/17] suppress spurious alert when compiling stdlib - documentation - -(cherry picked from commit 5c0fb8e23865fdbf151bdbe15d91176903c284d3) ---- - api_docgen/ocamldoc/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/api_docgen/ocamldoc/Makefile b/api_docgen/ocamldoc/Makefile -index 1b3d5f57f7..b6419ae50d 100644 ---- a/api_docgen/ocamldoc/Makefile -+++ b/api_docgen/ocamldoc/Makefile -@@ -44,7 +44,7 @@ $(libref:%=build/libref/%.odoc): build/libref/%.odoc: %.mli | build/libref - $(OCAMLDOC_RUN) -nostdlib -hide Stdlib -lib Stdlib \ - -pp \ - "$(AWK) -v ocamldoc=true -f ../../stdlib/expand_module_aliases.awk" \ -- $(DOC_STDLIB_INCLUDES) -hide-warnings $< -dump $@ -+ $(DOC_STDLIB_INCLUDES) -hide-warnings -alert -all $< -dump $@ - - $(compilerlibref:%=build/compilerlibref/%.odoc):\ - build/compilerlibref/%.odoc: %.mli | build/compilerlibref --- -2.41.0 - diff --git a/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch b/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch deleted file mode 100644 index 519c245..0000000 --- a/0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 4cc4eb8b0d71c64c5252d6764f4c4b0aa6020995 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Sat, 3 Jun 2023 18:02:24 +0100 -Subject: [PATCH 13/17] Merge pull request #12285 from - smorimoto/update-deprecated-actions - -Update deprecated GitHub Actions - -(cherry picked from commit eadb05a504e0738f246a7dc846a442793005a27a) ---- - .github/workflows/build.yml | 8 ++++---- - .github/workflows/hygiene.yml | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml -index ae0fcace20..933c14a926 100644 ---- a/.github/workflows/build.yml -+++ b/.github/workflows/build.yml -@@ -18,7 +18,7 @@ jobs: - manual_changed: ${{ steps.manual.outputs.manual_changed }} - steps: - - name: Checkout -- uses: actions/checkout@v2 -+ uses: actions/checkout@v3 - - name: Check for manual changes - id: manual - run: >- -@@ -45,7 +45,7 @@ jobs: - git config --local --unset http.https://github.com/.extraheader - tar --zstd -cf /tmp/sources.tar.zstd . - - name: Upload Artifact -- uses: actions/upload-artifact@v2 -+ uses: actions/upload-artifact@v3 - with: - name: compiler - path: /tmp/sources.tar.zstd -@@ -57,7 +57,7 @@ jobs: - runs-on: ubuntu-latest - steps: - - name: Download Artifact -- uses: actions/download-artifact@v2 -+ uses: actions/download-artifact@v3 - with: - name: compiler - - name: Unpack Artifact -@@ -137,7 +137,7 @@ jobs: - - debug-s4096 - steps: - - name: Download artifact -- uses: actions/download-artifact@v2 -+ uses: actions/download-artifact@v3 - with: - name: compiler - - name: Unpack Artifact -diff --git a/.github/workflows/hygiene.yml b/.github/workflows/hygiene.yml -index e89efd2f47..3b2e10795f 100644 ---- a/.github/workflows/hygiene.yml -+++ b/.github/workflows/hygiene.yml -@@ -17,7 +17,7 @@ jobs: - # context variable. - if: failure() - -- - uses: actions/checkout@v2 -+ - uses: actions/checkout@v3 - with: - fetch-depth: 50 - --- -2.41.0 - diff --git a/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch b/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch deleted file mode 100644 index c29b0c7..0000000 --- a/0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch +++ /dev/null @@ -1,40 +0,0 @@ -From af3a67cd06e07825c63b70a038cf90481039b1ed Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Fri, 9 Jun 2023 21:47:51 +0100 -Subject: [PATCH 14/17] Merge pull request #12286 from - smorimoto/replace-set-output - -Replace the set-output command with the GITHUB_OUTPUT environment file - -(cherry picked from commit 50054a632a5ac3bb4199276617d358e3fa4a108b) ---- - tools/ci/actions/check-manual-modified.sh | 2 +- - tools/ci/actions/runner.sh | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tools/ci/actions/check-manual-modified.sh b/tools/ci/actions/check-manual-modified.sh -index dc8b6bd809..c5826c1fd0 100755 ---- a/tools/ci/actions/check-manual-modified.sh -+++ b/tools/ci/actions/check-manual-modified.sh -@@ -32,4 +32,4 @@ else - fi - - echo "Manual altered: $result" --echo "::set-output name=manual_changed::$result" -+echo "manual_changed=$result" >>"$GITHUB_OUTPUT" -diff --git a/tools/ci/actions/runner.sh b/tools/ci/actions/runner.sh -index 6e5a30f73a..295e58a83e 100755 ---- a/tools/ci/actions/runner.sh -+++ b/tools/ci/actions/runner.sh -@@ -159,7 +159,7 @@ ReportBuildStatus () { - else - STATUS='success' - fi -- echo "::set-output name=build-status::$STATUS" -+ echo "build-status=$STATUS" >>"$GITHUB_OUTPUT" - exit $CODE - } - --- -2.41.0 - diff --git a/0015-Don-t-add-rpaths-to-libraries.patch b/0015-Don-t-add-rpaths-to-libraries.patch deleted file mode 100644 index 74c6dfa..0000000 --- a/0015-Don-t-add-rpaths-to-libraries.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0e07dfdb530734ef4db351ecc24c6363e36916ec Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 15/17] Don't add rpaths to libraries. - ---- - utils/config.mlp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/utils/config.mlp b/utils/config.mlp -index 7e1848f433..811d9134dd 100644 ---- a/utils/config.mlp -+++ b/utils/config.mlp -@@ -42,8 +42,8 @@ let native_c_compiler = - c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags - let native_c_libraries = "%%NATIVECCLIBS%%" - let native_pack_linker = "%%PACKLD%%" --let default_rpath = "%%RPATH%%" --let mksharedlibrpath = "%%MKSHAREDLIBRPATH%%" -+let default_rpath = "" -+let mksharedlibrpath = "" - let ar = "%%ARCMD%%" - let supports_shared_libraries = %%SUPPORTS_SHARED_LIBRARIES%% - let mkdll, mkexe, mkmaindll = --- -2.41.0 - diff --git a/0016-configure-Allow-user-defined-C-compiler-flags.patch b/0016-configure-Allow-user-defined-C-compiler-flags.patch deleted file mode 100644 index a3d322a..0000000 --- a/0016-configure-Allow-user-defined-C-compiler-flags.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9d3722c87ab15dfbc4e1a934e09ddc8253712d9c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 16/17] configure: Allow user defined C compiler flags. - ---- - configure.ac | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/configure.ac b/configure.ac -index a7974b0426..8068de3cfc 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -670,6 +670,10 @@ AS_CASE([$host], - internal_cflags="$cc_warnings"], - [common_cflags="-O"])]) - -+# Allow CFLAGS and LDFLAGS to be added. -+common_cflags="$common_cflags $CFLAGS" -+cclibs="$cclibs $LDFLAGS" -+ - # Enable SSE2 on x86 mingw to avoid using 80-bit registers. - AS_CASE([$host], - [i686-*-mingw32], --- -2.41.0 - diff --git a/0017-Fix-skiplist-test-failure-12346.patch b/0017-Fix-skiplist-test-failure-12346.patch deleted file mode 100644 index 87219e7..0000000 --- a/0017-Fix-skiplist-test-failure-12346.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 74b0eee42f616cb05c640c0ceac0cc391e4a7ef1 Mon Sep 17 00:00:00 2001 -From: Jerry James -Date: Fri, 7 Jul 2023 07:07:09 -0600 -Subject: [PATCH 17/17] Fix skiplist test failure (#12346) - -Fix -Wmaybe-uninitialized warning in skiplist test -Fix -Wunused-variable warning in skiplist test - -Co-authored-by: Xavier Leroy -(cherry picked from commit 3027e3308d685af03caf4f605b4bec55b04ed28e) -(cherry picked from commit 9aa7761060a7c40d11237599382b892dbcb79cb5) ---- - testsuite/tests/lf_skiplist/stubs.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/testsuite/tests/lf_skiplist/stubs.c b/testsuite/tests/lf_skiplist/stubs.c -index 991483e408..acc0eaf9cf 100644 ---- a/testsuite/tests/lf_skiplist/stubs.c -+++ b/testsuite/tests/lf_skiplist/stubs.c -@@ -64,7 +64,7 @@ static int get_len(struct lf_skipcell *p, struct lf_skipcell *end) { - static uintnat count_marks(struct lf_skiplist *sk) { - uintnat r = 0; - struct lf_skipcell *p = sk->head; -- uintptr_t succ; -+ uintptr_t succ = 0; - - while (p) { - for (int k = p->top_level; k >= 0; k--) { -@@ -135,7 +135,6 @@ inline static uintnat calc_right(uintnat id,uintnat turn,uintnat ndoms) { return - CAMLprim value insert_skiplist(value turn_val,value ndoms_val,value domain_id_val) { - CAMLparam3(turn_val,ndoms_val,domain_id_val); - uintnat domain_id = Long_val(domain_id_val); -- uintnat ndoms = Long_val(ndoms_val); - uintnat turn = Long_val(turn_val); - uintnat k = calc_key(domain_id,turn) ; - uintnat v = calc_value(domain_id) ; --- -2.41.0 - diff --git a/macros.ocaml-rpm b/macros.ocaml-rpm new file mode 100644 index 0000000..ac94c48 --- /dev/null +++ b/macros.ocaml-rpm @@ -0,0 +1,69 @@ +# Make %files lists from an installed tree of files. +# Options: +# -s: separate packaging; every subdirectory of %%{ocamldir}, except stublibs, +# is placed in its own package. This option requires the existence of opam +# *.install files in the build tree. +# -n: suppress creation of a devel subpackage. +%ocaml_files(sn) %{python3} /usr/lib/rpm/redhat/ocaml_files.py %{-s} %{-n} %{buildroot} %{ocamldir} + +# Internal macro holding the common parts of ocaml_install and dune_install +%ocaml_install_common(sn) %{expand: +rm -rf %{buildroot}%{_prefix}/doc +mlis=$(find %{buildroot}%{_libdir}/ocaml -name '*.mli') +rm -f ${mlis//.mli/.ml} +%ocaml_files %{-s} %{-n}} + +# Install files listed in opam *.install files. +# Options: +# -s: separate packaging; every subdirectory of %%{ocamldir}, except stublibs, +# is placed in its own package. +# -n: suppress creation of a devel subpackage. +%ocaml_install(sn) %{expand: +%{python3} /usr/lib/rpm/redhat/ocaml_files.py -i %{-s} %{-n} %{buildroot} %{ocamldir} +%ocaml_install_common %{-s} %{-n}} + +# Add smp_mflags to arguments if no -j release option is given. +# Add --release to arguments if no -p or --release option is given. +# Add --verbose to arguments if it is not given. +%dune_add_flags(-) %{lua: + has_j = false + has_p = false + has_v = false + for _, flag in pairs(arg) do + if flag:find("^-j") then + has_j = true + elseif flag:find("^-p") or flag:find("^--release)") then + has_p = true + elseif flag:find("^--verbose") then + has_v = true + end + end + if not has_j then + table.insert(arg, 1, rpm.expand("%{?_smp_mflags}")) + end + if not has_p then + table.insert(arg, 1, "--release") + end + if not has_v then + table.insert(arg, 1, "--verbose") + end + print(table.concat(arg, " ")) +} + +# Build with dune +%dune_build(-) dune build %{dune_add_flags %*} + +# Run tests with dune +%dune_check(-) dune runtest %{dune_add_flags %*} + +# Install with dune +# Options: +# -s: separate packaging; every subdirectory of %%{ocamldir}, except stublibs, +# is placed in its own package. +# -n: suppress creation of a devel subpackage. +%dune_install(sn) %{expand: +dune install --destdir=%{buildroot} %{dune_add_flags %*} +if [ -d _build/default/_doc/_html ]; then + find _build/default/_doc/_html -name .dune-keep -delete +fi +%ocaml_install_common %{-s} %{-n}} diff --git a/ocaml.spec b/ocaml.spec index 78683d0..2669eac 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,6 +1,12 @@ # Don't add -Wl,-dT, %undefine _package_note_flags +# OCaml 5.1 broke building with LTO. A file prims.c is generated with primitive +# function declarations, all with "void" for their parameter list. This does +# not match the real definitions, leading to lots of -Wlto-type-mismatch +# warnings. These change the output of the tests, leading to many failed tests. +%global _lto_cflags %{nil} + # OCaml has a bytecode backend that works on anything with a C # compiler, and a native code backend available on a subset of # architectures. A further subset of architectures support native @@ -23,7 +29,7 @@ ExcludeArch: %{ix86} # These are all the architectures that the tests run on. The tests # take a long time to run, so don't run them on slow machines. -%global test_arches aarch64 %{power64} riscv64 x86_64 +%global test_arches aarch64 %{power64} riscv64 s390x x86_64 # These are the architectures for which the tests must pass otherwise # the build will fail. #global test_arches_required aarch64 ppc64le x86_64 @@ -36,8 +42,8 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.0.0 -Release: 4%{?dist} +Version: 5.1.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -46,6 +52,8 @@ License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception URL: https://www.ocaml.org Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{version}.tar.gz +Source1: macros.ocaml-rpm +Source2: ocaml_files.py # IMPORTANT NOTE: # @@ -56,44 +64,33 @@ Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{vers # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-39-5.0.0 +# Current branch: fedora-40-5.1.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should # be incorporated into the git repo at a later time. -# Patches added after 5.0.0 was released. -Patch: 0001-increment-version-number-after-tagging-5.0.0.patch -Patch: 0002-Merge-pull-request-11814-from-gasche-clarify-DLS.new.patch -Patch: 0003-Add-KC-Sivaramakrishnan-as-author.patch -Patch: 0004-removed-set-but-unused-variables-in-yacc-reader.c-11.patch -Patch: 0005-Merge-pull-request-11860-from-Octachron-index_for_st.patch -Patch: 0006-Allow-installing-in-folder-with-space-in-name-11590.patch -Patch: 0007-Detect-unused-Makefile-variables-in-workflow.patch -Patch: 0008-Fix-incorrect-variable-from-runtime-Makefile-merge.patch -Patch: 0009-Provide-a-default-for-OCAMLDEPFLAGS.patch -Patch: 0010-Report-all-post-build-failures.patch -Patch: 0011-Finish-off-removal-of-FORCE_INSTRUMENTED_RUNTIME.patch -Patch: 0012-suppress-spurious-alert-when-compiling-stdlib-docume.patch -Patch: 0013-Merge-pull-request-12285-from-smorimoto-update-depre.patch -Patch: 0014-Merge-pull-request-12286-from-smorimoto-replace-set-.patch +# Patches added after 5.1.0 was released. # Fedora-specific patches -Patch: 0015-Don-t-add-rpaths-to-libraries.patch -Patch: 0016-configure-Allow-user-defined-C-compiler-flags.patch - -# Fix skiplist test failure -# https://github.com/ocaml/ocaml/pull/12346 -Patch: 0017-Fix-skiplist-test-failure-12346.patch +Patch: 0001-Don-t-add-rpaths-to-libraries.patch +Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch +# https://github.com/ocaml/ocaml/pull/12530 +Patch: 0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch +# https://github.com/ocaml/ocaml/pull/11594 +Patch: 0004-Update-framepointers-tests-to-avoid-false-positive-w.patch BuildRequires: make BuildRequires: git BuildRequires: gcc BuildRequires: autoconf BuildRequires: gawk +BuildRequires: hardlink +BuildRequires: parallel BuildRequires: perl-interpreter BuildRequires: util-linux BuildRequires: /usr/bin/annocheck +BuildRequires: pkgconfig(libzstd) # Documentation requirements BuildRequires: asciidoc @@ -101,17 +98,19 @@ BuildRequires: python3-pygments # ocamlopt runs gcc to link binaries. Because Fedora includes # hardening flags automatically, redhat-rpm-config is also required. +# Compressed marshaling requires libzstd-devel. Requires: gcc Requires: redhat-rpm-config +Requires: libzstd-devel%{?_isa} # Because we pass -c flag to ocaml-find-requires (to avoid circular # dependencies) we also have to explicitly depend on the right version # of ocaml-runtime. Requires: ocaml-runtime%{?_isa} = %{version}-%{release} -# Force ocaml-srpm-macros to be at the latest version, since OCaml 5.0 +# Force ocaml-srpm-macros to be at the latest version, since OCaml 5.1 # has a different set of native code generators than previous versions. -Requires: ocaml-srpm-macros >= 8 +Requires: ocaml-srpm-macros >= 9 # Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c Provides: bundled(md5-plumb) @@ -137,6 +136,10 @@ and a comprehensive library. %package runtime +# LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception: the project as a whole +# LicenseRef-Fedora-Public-Domain: the MD5 implementation in runtime/caml/md5.h +# and runtime/md5.c +License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception AND LicenseRef-Fedora-Public-Domain Summary: OCaml runtime environment Requires: util-linux Provides: ocaml(runtime) = %{version} @@ -197,6 +200,20 @@ Note that this exposes internal details of the OCaml compiler which may not be portable between versions. +%package rpm-macros +# LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception: the project as a whole +# BSD-3-Clause: ocaml_files.py +License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception AND BSD-3-Clause +Summary: RPM macros for building OCaml packages +BuildArch: noarch +Requires: ocaml = %{version}-%{release} +Requires: python3 + + +%description rpm-macros +This package contains macros that are useful for building OCaml RPMs. + + %prep %autosetup -S git -n %{name}-%{version}%{rcver} # Patches touch configure.ac, so rebuild it: @@ -214,6 +231,9 @@ make=make # Set ocamlmklib default flags to include Fedora linker flags sed -i '/ld_opts/s|\[\]|["%{build_ldflags}"]|' tools/ocamlmklib.ml +# Expose a dependency on the math library +sed -i '/^EXTRACAMLFLAGS=/aLINKOPTS=-cclib -lm' otherlibs/unix/Makefile + # Don't use %%configure macro because it sets --build, --host which # breaks some incorrect assumptions made by OCaml's configure.ac # @@ -295,58 +315,54 @@ echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release # Remove the installed documentation. We will install it using %%doc rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml +mkdir -p $RPM_BUILD_ROOT%{rpmmacrodir} +install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{rpmmacrodir}/macros.ocaml-rpm + +mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/redhat +install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/redhat + +# Link, rather than copy, identical binaries +hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs + %files %license LICENSE %{_bindir}/ocaml %{_bindir}/ocamlcmt +%{_bindir}/ocamlcp %{_bindir}/ocamldebug +%{_bindir}/ocamlmklib +%{_bindir}/ocamlmktop +%{_bindir}/ocamlprof %{_bindir}/ocamlyacc # symlink to either .byte or .opt version %{_bindir}/ocamlc -%{_bindir}/ocamlcp %{_bindir}/ocamldep %{_bindir}/ocamllex -%{_bindir}/ocamlmklib -%{_bindir}/ocamlmktop %{_bindir}/ocamlobjinfo -%{_bindir}/ocamloptp -%{_bindir}/ocamlprof # bytecode versions %{_bindir}/ocamlc.byte -%{_bindir}/ocamlcp.byte %{_bindir}/ocamldep.byte %{_bindir}/ocamllex.byte -%{_bindir}/ocamlmklib.byte -%{_bindir}/ocamlmktop.byte %{_bindir}/ocamlobjinfo.byte -%{_bindir}/ocamloptp.byte -%{_bindir}/ocamlprof.byte %if %{native_compiler} # native code versions %{_bindir}/ocamlc.opt -%{_bindir}/ocamlcp.opt %{_bindir}/ocamldep.opt %{_bindir}/ocamllex.opt -%{_bindir}/ocamlmklib.opt -%{_bindir}/ocamlmktop.opt %{_bindir}/ocamlobjinfo.opt -%{_bindir}/ocamloptp.opt -%{_bindir}/ocamlprof.opt -%endif - -%if %{native_compiler} -%{_bindir}/ocamlopt -%{_bindir}/ocamlopt.byte -%{_bindir}/ocamlopt.opt %endif %if %{native_compiler} %{_bindir}/ocamlnat +%{_bindir}/ocamlopt +%{_bindir}/ocamlopt.byte +%{_bindir}/ocamlopt.opt +%{_bindir}/ocamloptp %endif %{_libdir}/ocaml/camlheader @@ -398,9 +414,6 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml %{_libdir}/ocaml/dynlink/META %{_libdir}/ocaml/dynlink/*.cmi %{_libdir}/ocaml/dynlink/*.cma -%dir %{_libdir}/ocaml/ocamlmktop -%{_libdir}/ocaml/ocamlmktop/*.cmo -%{_libdir}/ocaml/ocamlmktop/*.cmi %dir %{_libdir}/ocaml/profiling %{_libdir}/ocaml/profiling/*.cmo %{_libdir}/ocaml/profiling/*.cmi @@ -448,7 +461,19 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ocaml %{_libdir}/ocaml/compiler-libs +%files rpm-macros +%{rpmmacrodir}/macros.ocaml-rpm +%{_rpmconfigdir}/redhat/ocaml_files.py + + %changelog +* Wed Oct 4 2023 Jerry James - 5.1.0-1 +- Version 5.1.0 +- Add LicenseRef-Fedora-Public-Domain to the runtime License field +- New ocaml-rpm-macros subpackage +- Depend on libzstd-devel for compressed marshaling +- Disable LTO + * Thu Jul 20 2023 Fedora Release Engineering - 5.0.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/ocaml_files.py b/ocaml_files.py new file mode 100644 index 0000000..cf4afd1 --- /dev/null +++ b/ocaml_files.py @@ -0,0 +1,451 @@ +# Copyright 2022-3, Jerry James +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of Red Hat nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import argparse +import os +import shutil +import string +import sys +from collections.abc import Iterable, Iterator +from enum import Enum, auto +from typing import Callable, final + +# Version of this script +version=2 + +# +# BUILDROOT CATEGORIZATION +# + +# Directories to ignore when generating %dir entries +root_dirs: set[str] = { + '/', + '/etc', + '/usr', + '/usr/bin', + '/usr/lib', + '/usr/lib/ocaml', + '/usr/lib/ocaml/caml', + '/usr/lib/ocaml/stublibs', + '/usr/lib/ocaml/threads', + '/usr/lib64', + '/usr/lib64/ocaml', + '/usr/lib64/ocaml/caml', + '/usr/lib64/ocaml/stublibs', + '/usr/lib64/ocaml/threads', + '/usr/libexec', + '/usr/sbin', + '/usr/share', + '/usr/share/doc' +} + +def find_buildroot_toplevel(buildroot: str) -> list[str]: + """Find toplevel files and directories in the buildroot. + + :param str buildroot: path to the buildroot + :return: a list of toplevel files and directories in the buildroot + """ + bfiles: list[str] = [] + for path, dirs, files in os.walk(buildroot): + for i in range(len(dirs) - 1, -1, -1): + d = os.path.join(path, dirs[i])[len(buildroot):] + if d not in root_dirs and not d.startswith('/usr/share/man'): + bfiles.append(d) + del dirs[i] + for f in files: + realfile = os.path.join(path, f)[len(buildroot):] + if realfile.startswith('/usr/share/man'): + bfiles.append(realfile + '*') + else: + bfiles.append(realfile) + return bfiles + +# File suffixes that go into a devel subpackage +dev_suffixes: set[str] = { + 'a', 'cmo', 'cmt', 'cmti', 'cmx', 'cmxa', 'h', 'idl', 'ml', 'mli', 'o' +} + +def is_devel_file(filname: str) -> bool: + """Determine whether a file belongs to a devel subpackage. + + :param str filname: the filename to check + :return: True if the file belongs to a devel subpackage, else False + """ + return (filname == 'dune-package' or filname == 'opam' or + (os.path.splitext(filname)[1][1:] in dev_suffixes + and not filname.endswith('_top_init.ml'))) + +def find_buildroot_all(buildroot: str, devel: bool, add_star: bool) -> list[set[str]]: + """Find all files and directories in the buildroot and optionally + categorize them as 'main' or 'devel'. + + :param Namespace args: parsed command line arguments + :param bool devel: True to split into 'main' and 'devel', False otherwise + :param bool add_star: True to add a star to man page filenames + :return: a list of files and directories, in this order: main files, + main directories, devel files, and devel directories + """ + bfiles: list[set[str]] = [set(), set(), set()] + bdirs: set[str] = set() + for path, dirs, files in os.walk(buildroot): + for d in dirs: + realdir = os.path.join(path, d)[len(buildroot):] + if realdir not in root_dirs and not realdir.startswith('/usr/share/man'): + bdirs.add(realdir) + for f in files: + realfile = os.path.join(path, f)[len(buildroot):] + if devel and is_devel_file(os.path.basename(realfile)): + bfiles[2].add(realfile) + else: + if add_star and realfile.startswith('/usr/share/man'): + bfiles[0].add(realfile + '*') + else: + bfiles[0].add(realfile) + parentdir = os.path.dirname(realfile) + if parentdir in bdirs: + bfiles[1].add(parentdir) + bdirs.remove(parentdir) + # Catch intermediate directories, as in ocaml-mtime + parentdir = os.path.dirname(parentdir) + if parentdir in bdirs: + bfiles[1].add(parentdir) + bdirs.remove(parentdir) + bfiles.append(bdirs) + return bfiles + +# +# INSTALL FILE LEXER AND PARSER +# + +class TokenType(Enum): + """The types of tokens that can appear in an opam *.install file.""" + ERROR = auto() + COLON = auto() + LBRACE = auto() + RBRACE = auto() + LBRACK = auto() + RBRACK = auto() + STRING = auto() + FIELD = auto() + +@final +class InstallFileLexer(Iterator[tuple[TokenType, str]]): + """Convert an opam *.install file into a sequence of tokens.""" + __slots__ = ['index', 'text'] + + def __init__(self, filname: str) -> None: + """Create an opam *.install file lexer. + + :param str filname: the name of the file to read from + """ + self.index = 0 + with open(filname, 'r') as f: + # Limit reads to 4 MB in case this file is bogus. + # Most install files are under 4K. + self.text = f.read(4194304) + + def skip_whitespace(self) -> None: + """Skip over whitespace in the input.""" + while self.index < len(self.text) and \ + (self.text[self.index] == '#' or + self.text[self.index] in string.whitespace): + if self.text[self.index] == '#': + while (self.index < len(self.text) and + self.text[self.index] != '\n' and + self.text[self.index] != '\r'): + self.index += 1 + else: + self.index += 1 + + def __next__(self) -> tuple[TokenType, str]: + """Get the next token from the opam *.install file. + + :return: a pair containing the type and text of the next token + """ + self.skip_whitespace() + if self.index < len(self.text): + ch = self.text[self.index] + if ch == ':': + self.index += 1 + return (TokenType.COLON, ch) + if ch == '{': + self.index += 1 + return (TokenType.LBRACE, ch) + if ch == '}': + self.index += 1 + return (TokenType.RBRACE, ch) + if ch == '[': + self.index += 1 + return (TokenType.LBRACK, ch) + if ch == ']': + self.index += 1 + return (TokenType.RBRACK, ch) + if ch == '"': + start = self.index + 1 + end = start + while end < len(self.text) and self.text[end] != '"': + end += 2 if self.text[end] == '\\' else 1 + self.index = end + 1 + return (TokenType.STRING, self.text[start:end]) + if ch in string.ascii_letters: + start = self.index + end = start + 1 + while (end < len(self.text) and + (self.text[end] == '_' or + self.text[end] in string.ascii_letters)): + end += 1 + self.index = end + return (TokenType.FIELD, self.text[start:end]) + return (TokenType.ERROR, ch) + else: + raise StopIteration + +@final +class InstallFileParser(Iterable[tuple[str, bool, str, str]]): + """Parse opam *.install files.""" + + __slots__ = ['pkgname', 'lexer', 'libdir'] + + def __init__(self, filname: str, libdir: str) -> None: + """Initialize an OCaml .install file parser. + + :param str filname: name of the .install file to parse + :param str libdir: the OCaml library directory + """ + self.pkgname = os.path.splitext(os.path.basename(filname))[0] + self.lexer = InstallFileLexer(filname) + self.libdir = libdir + + def __iter__(self) -> Iterator[tuple[str, bool, str, str]]: + """Parse a .install file. + If there are any parse errors, we assume this file is not really an + opam .install file and abandon the parse. + """ + # Map opam installer names to directories + opammap: dict[str, str] = { + 'lib': os.path.join(self.libdir, self.pkgname), + 'lib_root': self.libdir, + 'libexec': os.path.join(self.libdir, self.pkgname), + 'libexec_root': self.libdir, + 'bin': '/usr/bin', + 'sbin': '/usr/sbin', + 'toplevel': os.path.join(self.libdir, 'toplevel'), + 'share': os.path.join('/usr/share', self.pkgname), + 'share_root': '/usr/share', + 'etc': os.path.join('/etc', self.pkgname), + 'doc': os.path.join('/usr/doc', self.pkgname), + 'stublibs': os.path.join(self.libdir, 'stublibs'), + 'man': '/usr/share/man' + } + + # Parse the file + try: + toktyp, token = next(self.lexer) + while toktyp == TokenType.FIELD: + libname = token + toktyp, token = next(self.lexer) + if toktyp != TokenType.COLON: + return + + toktyp, token = next(self.lexer) + if toktyp != TokenType.LBRACK: + return + + directory = opammap.get(libname) + if not directory: + return + + toktyp, token = next(self.lexer) + while toktyp == TokenType.STRING: + source = token + optional = source[0] == '?' + if optional: + source = source[1:] + nexttp, nexttk = next(self.lexer) + if nexttp == TokenType.LBRACE: + nexttp, nexttk = next(self.lexer) + if nexttp == TokenType.STRING: + filname = os.path.join(directory, nexttk) + bracetp, bractk = next(self.lexer) + if bracetp != TokenType.RBRACE: + return + nexttp, nexttk = next(self.lexer) + else: + return + elif libname == 'man': + index = token.rfind('.') + if index < 0: + return + mandir = os.path.join(directory, 'man' + token[index+1:]) + filname = os.path.join(mandir, os.path.basename(token)) + else: + filname = os.path.join(directory, os.path.basename(token)) + toktyp, token = nexttp, nexttk + yield (self.pkgname, optional, source, filname) + + if toktyp != TokenType.RBRACK: + return + toktyp, token = next(self.lexer) + except StopIteration: + return + +def install_files(buildroot: str, libdir: str) -> None: + """Install the files listed in opam .install files in the buildroot. + + For some projects, there are install files in both the project root + directory and somewhere under "_build", so be careful not to parse the same + install file twice. + + :param str buildroot: path to the buildroot + :param str libdir: the OCaml library directory + """ + install_files = set() + for path, dirs, files in os.walk('.'): + for f in files: + if f.endswith('.install') and f not in install_files: + install_files.add(f) + parser = InstallFileParser(os.path.join(path, f), libdir) + for _, optional, source, filname in parser: + if not optional or os.path.exists(source): + installpath = os.path.join(buildroot, filname[1:]) + os.makedirs(os.path.dirname(installpath), exist_ok=True) + shutil.copy2(source, installpath) + +def get_package_map(buildroot: str, libdir: str, devel: bool) -> dict[str, set[str]]: + """Create a map from package names to installed files from the opam .install + files in the buildroot. + + For some projects, there are install files in both the project root + directory and somewhere under "_build", so be careful not to parse the same + install file twice.""" + + pmap: dict[str, set[str]] = dict() + install_files = set() + + def add_pkg(pkgname: str, filname: str) -> None: + """Add a mapping from a package name to a filename. + + :param str pkgname: the package that acts as the map key + :param str filname: the filename to add to the package set + """ + if pkgname not in pmap: + pmap[pkgname] = set() + pmap[pkgname].add(filname) + + installed = find_buildroot_all(buildroot, devel, False) + for path, dirs, files in os.walk('.'): + for f in files: + if f.endswith('.install') and f not in install_files: + install_files.add(f) + parser = InstallFileParser(os.path.join(path, f), libdir) + for pkgname, _, _, filname in parser: + if filname in installed[0]: + if filname.startswith('/usr/share/man'): + add_pkg(pkgname, filname + '*') + else: + add_pkg(pkgname, filname) + dirname = os.path.dirname(filname) + if dirname in installed[1]: + add_pkg(pkgname, '%dir ' + dirname) + installed[1].remove(dirname) + elif filname in installed[2]: + if filname.startswith('/usr/share/man'): + add_pkg(pkgname + '-devel', filname + '*') + else: + add_pkg(pkgname + '-devel', filname) + dirname = os.path.dirname(filname) + if dirname in installed[3]: + add_pkg(pkgname + '-devel', '%dir ' + dirname) + installed[3].remove(dirname) + return pmap + +# +# MAIN INTERFACE +# + +def ocaml_files(no_devel: bool, separate: bool, install: bool, buildroot: str, + libdir: str) -> None: + """Generate %files lists from an installed buildroot. + + :param bool no_devel: False to split files into a main package and a devel + package + :param bool separate: True to place each OCaml module in an RPM package + :param bool install: True to install files, False to generate %files + :param str buildroot: the installed buildroot + :param str libdir: the OCaml library directory + """ + if install: + install_files(buildroot, libdir) + elif separate: + pkgmap = get_package_map(buildroot, libdir, not no_devel) + for pkg in pkgmap: + with open('.ofiles-' + pkg, 'w') as f: + for entry in pkgmap[pkg]: + f.write(entry + '\n') + elif no_devel: + with open('.ofiles', 'w') as f: + for entry in find_buildroot_toplevel(buildroot): + f.write(entry + '\n') + else: + files = find_buildroot_all(buildroot, True, True) + with open('.ofiles', 'w') as f: + for entry in files[0]: + f.write(entry + '\n') + for entry in files[1]: + f.write('%dir ' + entry + '\n') + with open('.ofiles-devel', 'w') as f: + for entry in files[2]: + f.write(entry + '\n') + for entry in files[3]: + f.write('%dir ' + entry + '\n') + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Support for building OCaml RPM packages') + parser.add_argument('-i', '--install', + action='store_true', + default=False, + help='install files instead of generating %files') + parser.add_argument('-n', '--no-devel', + action='store_true', + default=False, + help='suppress creation of a devel subpackage') + parser.add_argument('-s', '--separate', + action='store_true', + default=False, + help='separate packaging. Each OCaml module is in a distinct RPM package. All modules are in a single RPM package by default.') + parser.add_argument('-v', '--version', + action='version', + version=f'%(prog)s {str(version)}') + parser.add_argument('buildroot', help='RPM build root') + parser.add_argument('libdir', help='OCaml library directory') + args = parser.parse_args() + ocaml_files(args.no_devel, + args.separate, + args.install, + args.buildroot, + args.libdir) diff --git a/sources b/sources index 3a87a72..1da2f82 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.0.0.tar.gz) = c0cd445bdc2de5d45aae9aea78aab116807cc6782efbcb624a5843e2c0821ccb1e307cc23724f9636918495305cadc75abf04395cd9ede28597774ab60948167 +SHA512 (ocaml-5.1.0.tar.gz) = 814ea71de656eadc59a658ad3b6c4d786815c348ab883b1cdb22d5d0f99d11768f5646f03725f6b44c3b8f4ffeb71e89dadaea157711a7afbe86f23846fc5b52 From c37874e2662370f4998145cbc1a39eb7bcfb809e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 5 Oct 2023 09:58:44 +0100 Subject: [PATCH 25/54] Add upstream patch added after 5.1.0 --- 0001-Fix-variance-composition-12623.patch | 176 ++++++++++++++++++ ...> 0002-Don-t-add-rpaths-to-libraries.patch | 6 +- ...-Allow-user-defined-C-compiler-flags.patch | 6 +- ...elivery-of-effect-related-exceptions.patch | 6 +- ...ters-tests-to-avoid-false-positive-w.patch | 38 ++-- ocaml.spec | 14 +- 6 files changed, 213 insertions(+), 33 deletions(-) create mode 100644 0001-Fix-variance-composition-12623.patch rename 0001-Don-t-add-rpaths-to-libraries.patch => 0002-Don-t-add-rpaths-to-libraries.patch (79%) rename 0002-configure-Allow-user-defined-C-compiler-flags.patch => 0003-configure-Allow-user-defined-C-compiler-flags.patch (89%) rename 0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch => 0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch (84%) rename 0004-Update-framepointers-tests-to-avoid-false-positive-w.patch => 0005-Update-framepointers-tests-to-avoid-false-positive-w.patch (97%) diff --git a/0001-Fix-variance-composition-12623.patch b/0001-Fix-variance-composition-12623.patch new file mode 100644 index 0000000..34db2ab --- /dev/null +++ b/0001-Fix-variance-composition-12623.patch @@ -0,0 +1,176 @@ +From 4c03e721b4c53240a9091790acb401b27e72dce0 Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Wed, 4 Oct 2023 10:05:44 +0200 +Subject: [PATCH 1/5] Fix variance composition (#12623) + +Possible positive occurrence under possible negative occurrence were +forgotten, making the typechecker accepts the absurd statement + + type -'a n + type +'a p + type +'a ko = 'a p n + +(cherry picked from commit 1a9c45317b2c6c9ca9b4cb95fe4891f9f1a2820e) +--- + Changes | 8 +++ + boot/ocamlc | Bin 3051798 -> 3051796 bytes + boot/ocamllex | Bin 391863 -> 391861 bytes + testsuite/tests/typing-misc/variance.ml | 87 ++++++++++++++++++++++++ + typing/types.ml | 2 +- + 5 files changed, 96 insertions(+), 1 deletion(-) + +diff --git a/Changes b/Changes +index 20b7b8ee22..dccdc9baba 100644 +--- a/Changes ++++ b/Changes +@@ -1,3 +1,11 @@ ++OCaml 5.1.1 ++----------- ++ ++### Bug fixes: ++ ++- #12623, fix the computation of variance composition ++ (Florian Angeletti, report by Vesa Karvonen, review by Gabriel Scherer) ++ + OCaml 5.1.0 (14 September 2023) + ------------------------------- + +diff --git a/boot/ocamlc b/boot/ocamlc +index f3b2cba8df84a5f1326c7fe7bdf12b85159f65b3..4db4d848dbc3c2411a9e6160e9d932dd7ba35a34 100755 +GIT binary patch +delta 244 +zcmZ9=y)pw)7zW@yD_A75h=~7x4sq6QNTHKLLz5Y;l1i^m@y)Byq%e*dP4>M3jS*A| +zH=r=XOm0DACarO5#nU`Dd{Ng71+*IApk>g1RMp&zydf97QqRy1Wtle;50Y`&VqB`Jh%WZf=l2sxB{+% +zYvB4LHS4)A&pSWz{Q8@xo}b$HKl;!&)oPSPN%{2bA~uz{vSZ>slkC18)N0Mv{`SAV +Z)LrdtIGaw{*=p;q`M6Wx_O}_8{s6iiTe|=N + +delta 266 +zcmbQTXcyx&AZ}=3Y+-6)ZeeL*ZDDI+Z{cX+Y~gC*ZsBR+ZQ*O--y(2h;q(<<0zA`W +z77B1oUvN>3W%_}I0zB=17775dAP@@yu`m#e0I?_#ivh7X5K92DBoIphu{03N0I@6( +z%K@=G5Gw$&A`mM9u`&>=0I@0%s{yh4_CE_XmId(MW?;znW?%|9%D}jD=l1oVG`yJf +z%}n(S^$fIAQp*fYb&U*+jCBnxbq!1pxH>vaSm0oQF5a&8RRf4MfmjQOwSib?yV_UX +OtFsy3PyaJPPXYiZJ96a! + +diff --git a/boot/ocamllex b/boot/ocamllex +index cfdfbe8b4541516ef49c895ea691ea534706de67..b2b5404e69f35a1eb7d0a74fe687a4f4508a7149 100755 +GIT binary patch +delta 98 +zcmdn~RebAL@rD-07N!>F7M3lnT~@qO3=Hgl7#JKo7#Or4Zl7+&>cymMYN}_bXQ-W$ +qT4tbYWME{hYhbBsXmY^S(Q(282Yoc*?EF7M3lnT~@p@3=Hgl7#JKo85p!5ZJ%z%>cymQW~yhXXP}*u +rT4rdfYh++#tZQJYYhZf7)zM+X0tW+h@$G!JtbKbK4W`fi#VP>+{6`&d + +diff --git a/testsuite/tests/typing-misc/variance.ml b/testsuite/tests/typing-misc/variance.ml +index d0f754f716..419e348f48 100644 +--- a/testsuite/tests/typing-misc/variance.ml ++++ b/testsuite/tests/typing-misc/variance.ml +@@ -36,3 +36,90 @@ type !'a t = (module s with type t = 'a);; + module type s = sig type t end + type 'a t = (module s with type t = 'a) + |}] ++ ++(* Composition *) ++type -'a n ++type +'a p ++type !'a i ++ ++type +'a error_np = 'a n p;; ++[%%expect{| ++type -'a n ++type +'a p ++type !'a i ++Line 5, characters 0-26: ++5 | type +'a error_np = 'a n p;; ++ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be covariant, ++ but it is contravariant. ++|}] ++ ++ ++type +'a error_pn = 'a p n;; ++[%%expect{| ++Line 1, characters 0-26: ++1 | type +'a error_pn = 'a p n;; ++ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be covariant, ++ but it is contravariant. ++|}] ++ ++type -'a error_pp = 'a p p;; ++[%%expect{| ++Line 1, characters 0-26: ++1 | type -'a error_pp = 'a p p;; ++ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be contravariant, ++ but it is covariant. ++|}] ++ ++type -'a error_nn = 'a n n;; ++[%%expect{| ++Line 1, characters 0-26: ++1 | type -'a error_nn = 'a n n;; ++ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be contravariant, ++ but it is covariant. ++|}] ++ ++type !'a inj_in = 'a i n ++[%%expect{| ++Line 1, characters 0-24: ++1 | type !'a inj_in = 'a i n ++ ^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be injective invariant, ++ but it is invariant. ++|}] ++ ++type !'a inj_in = 'a n i ++[%%expect{| ++Line 1, characters 0-24: ++1 | type !'a inj_in = 'a n i ++ ^^^^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be injective invariant, ++ but it is invariant. ++|}] ++ ++module Make_covariant(M: sig type 'a t end): sig ++ type 'a i = 'a ++ type +'a t = 'a i M.t ++end = struct ++ type 'a i = 'a ++ type +'a t = 'a i M.t ++end ++ ++module Positive_ref = Make_covariant(struct type 'a t = 'a ref end) ++[%%expect {| ++Line 6, characters 2-23: ++6 | type +'a t = 'a i M.t ++ ^^^^^^^^^^^^^^^^^^^^^ ++Error: In this definition, expected parameter variances are not satisfied. ++ The 1st type parameter was expected to be covariant, ++ but it is invariant. ++|}] +diff --git a/typing/types.ml b/typing/types.ml +index 45a4f896d6..c1dbdb6895 100644 +--- a/typing/types.ml ++++ b/typing/types.ml +@@ -186,7 +186,7 @@ module Variance = struct + let mp = + mem May_pos v1 && mem May_pos v2 || mem May_neg v1 && mem May_neg v2 + and mn = +- mem May_pos v1 && mem May_neg v2 || mem May_pos v1 && mem May_neg v2 ++ mem May_pos v1 && mem May_neg v2 || mem May_neg v1 && mem May_pos v2 + and mw = mem May_weak v1 && v2 <> null || v1 <> null && mem May_weak v2 + and inj = mem Inj v1 && mem Inj v2 + and pos = mem Pos v1 && mem Pos v2 || mem Neg v1 && mem Neg v2 +-- +2.41.0 + diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0002-Don-t-add-rpaths-to-libraries.patch similarity index 79% rename from 0001-Don-t-add-rpaths-to-libraries.patch rename to 0002-Don-t-add-rpaths-to-libraries.patch index 344a528..d1362a5 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0002-Don-t-add-rpaths-to-libraries.patch @@ -1,14 +1,14 @@ -From 03435cc789bfb783c1d5566e8abd387eea1b9155 Mon Sep 17 00:00:00 2001 +From 56fafd588484ceb9b8e998b5e569d7df27deae3b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/4] Don't add rpaths to libraries. +Subject: [PATCH 2/5] Don't add rpaths to libraries. --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 7c7d9a814c..d5040c279c 100644 +index aba3569f7c..6c50ba6c71 100644 --- a/configure.ac +++ b/configure.ac @@ -1106,8 +1106,6 @@ AS_IF([test x"$enable_shared" != "xno"], diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0003-configure-Allow-user-defined-C-compiler-flags.patch similarity index 89% rename from 0002-configure-Allow-user-defined-C-compiler-flags.patch rename to 0003-configure-Allow-user-defined-C-compiler-flags.patch index 0d70a04..8c64262 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0003-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,14 +1,14 @@ -From d9bcdb9d0a27e10350b1ca90df43b401656324f1 Mon Sep 17 00:00:00 2001 +From e8170e71efb93f10c27935acc95093eb3f53ab6c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. +Subject: [PATCH 3/5] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index d5040c279c..4cbba04557 100644 +index 6c50ba6c71..db6ea8a8d1 100644 --- a/configure.ac +++ b/configure.ac @@ -759,6 +759,10 @@ AS_CASE([$host], diff --git a/0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch b/0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch similarity index 84% rename from 0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch rename to 0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch index 6d40ec0..2a90a81 100644 --- a/0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch +++ b/0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch @@ -1,14 +1,14 @@ -From 352789925e44f012fbddc5dfae63abd15a447577 Mon Sep 17 00:00:00 2001 +From 8d0e4af8141f6ba925c1de426a9600a96816c86b Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 4 Sep 2023 13:50:30 -0600 -Subject: [PATCH 3/4] Fix x86_64 delivery of effect-related exceptions +Subject: [PATCH 4/5] Fix x86_64 delivery of effect-related exceptions --- runtime/amd64.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/amd64.S b/runtime/amd64.S -index 7e6f95c680..24dfa7111b 100644 +index 8dc9f81ec6..72d96f502d 100644 --- a/runtime/amd64.S +++ b/runtime/amd64.S @@ -902,6 +902,7 @@ LBL(112): diff --git a/0004-Update-framepointers-tests-to-avoid-false-positive-w.patch b/0005-Update-framepointers-tests-to-avoid-false-positive-w.patch similarity index 97% rename from 0004-Update-framepointers-tests-to-avoid-false-positive-w.patch rename to 0005-Update-framepointers-tests-to-avoid-false-positive-w.patch index 2025d57..a160acb 100644 --- a/0004-Update-framepointers-tests-to-avoid-false-positive-w.patch +++ b/0005-Update-framepointers-tests-to-avoid-false-positive-w.patch @@ -1,7 +1,7 @@ -From 210f9b439b264fb6ab16802f468992086a4af58c Mon Sep 17 00:00:00 2001 +From e1ee698f482664237bfb693966987cd167c22b68 Mon Sep 17 00:00:00 2001 From: Fabrice Buoro Date: Fri, 10 Mar 2023 09:36:22 -0700 -Subject: [PATCH 4/4] Update framepointers tests to avoid false positive with +Subject: [PATCH 5/5] Update framepointers tests to avoid false positive with inlined C functions --- @@ -36,10 +36,10 @@ Subject: [PATCH 4/4] Update framepointers tests to avoid false positive with delete mode 100644 testsuite/tests/frame-pointers/stack_realloc2.run diff --git a/testsuite/tests/frame-pointers/c_call.ml b/testsuite/tests/frame-pointers/c_call.ml -index 7d48b4947d..f552b0df8f 100644 +index c2493b3a99..9b98e86520 100644 --- a/testsuite/tests/frame-pointers/c_call.ml +++ b/testsuite/tests/frame-pointers/c_call.ml -@@ -7,20 +7,20 @@ all_modules = "${readonly_files} c_call. +@@ -7,20 +7,20 @@ all_modules = "${readonly_files} c_call.ml" *) @@ -140,7 +140,7 @@ index 634c4dd937..a75100b213 100644 + argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]); } diff --git a/testsuite/tests/frame-pointers/effects.ml b/testsuite/tests/frame-pointers/effects.ml -index 2aa7012606..ac304683fe 100644 +index e14633a374..4d14190320 100644 --- a/testsuite/tests/frame-pointers/effects.ml +++ b/testsuite/tests/frame-pointers/effects.ml @@ -11,26 +11,26 @@ open Printf @@ -239,10 +239,10 @@ index e96b5ea13a..0000000000 -${program} 2>&1 \ - | ${test_source_directory}/filter-locations.sh ${program} >${output} diff --git a/testsuite/tests/frame-pointers/exception_handler.ml b/testsuite/tests/frame-pointers/exception_handler.ml -index 6bf5bf470d..19773f78de 100644 +index 575f7329bf..95a4f0d75c 100644 --- a/testsuite/tests/frame-pointers/exception_handler.ml +++ b/testsuite/tests/frame-pointers/exception_handler.ml -@@ -8,7 +8,7 @@ +@@ -8,7 +8,7 @@ all_modules = "${readonly_files} exception_handler.ml" *) (* https://github.com/ocaml/ocaml/pull/11031 *) @@ -374,13 +374,13 @@ index a521218a38..cef7ccd9f2 100644 + perror("backtrace_symbols"); + return NULL; + } -+ + +-static void signal_handler(int signum) + const char* symbol = strdup(symbols[0]); + free(symbols); + return symbol; +} - --static void signal_handler(int signum) ++ +static bool is_from_executable(const char* symbol, const char* execname) { - /* Should be safe to be called from a signal handler. @@ -504,17 +504,17 @@ index a521218a38..cef7ccd9f2 100644 - struct frame_info *fi; - struct frame_info* next; - void* retaddr; -+ const char* execname = String_val(argv0); -+ struct frame_info* next = NULL; -+ const char* symbol = NULL; - +- - fi = __builtin_frame_address(0); - retaddr = __builtin_extract_return_addr(__builtin_return_address(0)); - - for (; fi; fi = next) { - if (safe_read(fi, &next, &retaddr) != 0) - return; -- ++ const char* execname = String_val(argv0); ++ struct frame_info* next = NULL; ++ const char* symbol = NULL; + - print_location(retaddr); + for (struct frame_info* fi = __builtin_frame_address(0); fi; fi = next) { + next = fi->prev; @@ -563,10 +563,10 @@ index a521218a38..cef7ccd9f2 100644 + free((void*)symbol); } diff --git a/testsuite/tests/frame-pointers/reperform.ml b/testsuite/tests/frame-pointers/reperform.ml -index ec5393907c..7a3b09162b 100644 +index 1af8452e5f..da251c98a7 100644 --- a/testsuite/tests/frame-pointers/reperform.ml +++ b/testsuite/tests/frame-pointers/reperform.ml -@@ -11,7 +11,7 @@ +@@ -11,7 +11,7 @@ all_modules = "${readonly_files} reperform.ml" open Effect open Effect.Deep @@ -606,7 +606,7 @@ index e96b5ea13a..0000000000 -${program} 2>&1 \ - | ${test_source_directory}/filter-locations.sh ${program} >${output} diff --git a/testsuite/tests/frame-pointers/stack_realloc.ml b/testsuite/tests/frame-pointers/stack_realloc.ml -index fc4e9e9d3b..cacc43c216 100644 +index 79e70c2add..f24e4795d5 100644 --- a/testsuite/tests/frame-pointers/stack_realloc.ml +++ b/testsuite/tests/frame-pointers/stack_realloc.ml @@ -13,7 +13,7 @@ open Effect.Deep @@ -649,7 +649,7 @@ index e96b5ea13a..0000000000 -${program} 2>&1 \ - | ${test_source_directory}/filter-locations.sh ${program} >${output} diff --git a/testsuite/tests/frame-pointers/stack_realloc2.ml b/testsuite/tests/frame-pointers/stack_realloc2.ml -index a4aea249ea..b2a602fa4a 100644 +index a3d21bf2bf..218dd6a1c3 100644 --- a/testsuite/tests/frame-pointers/stack_realloc2.ml +++ b/testsuite/tests/frame-pointers/stack_realloc2.ml @@ -13,7 +13,7 @@ open Effect.Deep diff --git a/ocaml.spec b/ocaml.spec index 2669eac..8382b01 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -71,14 +71,15 @@ Source2: ocaml_files.py # be incorporated into the git repo at a later time. # Patches added after 5.1.0 was released. +Patch: 0001-Fix-variance-composition-12623.patch # Fedora-specific patches -Patch: 0001-Don-t-add-rpaths-to-libraries.patch -Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch +Patch: 0002-Don-t-add-rpaths-to-libraries.patch +Patch: 0003-configure-Allow-user-defined-C-compiler-flags.patch # https://github.com/ocaml/ocaml/pull/12530 -Patch: 0003-Fix-x86_64-delivery-of-effect-related-exceptions.patch +Patch: 0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch # https://github.com/ocaml/ocaml/pull/11594 -Patch: 0004-Update-framepointers-tests-to-avoid-false-positive-w.patch +Patch: 0005-Update-framepointers-tests-to-avoid-false-positive-w.patch BuildRequires: make BuildRequires: git @@ -467,6 +468,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Oct 5 2023 Richard W.M. Jones - 5.1.0-2 +- Add upstream patch added after 5.1.0 + * Wed Oct 4 2023 Jerry James - 5.1.0-1 - Version 5.1.0 - Add LicenseRef-Fedora-Public-Domain to the runtime License field From a8e366538adc5550add1d3840372022e090f03c0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 5 Oct 2023 10:53:11 +0100 Subject: [PATCH 26/54] Rebuild against updated ocaml-srpm-macros I managed to build it against the old ocaml-srpm-macros, thus native compilation was disabled still on s390x. Hopefully bump and rebuild after adding ocaml-srpm-macros to the side tag will fix this. --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 8382b01..e6d1c1a 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -468,6 +468,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Oct 05 2023 Richard W.M. Jones - 5.1.0-3 +- Rebuild against updated ocaml-srpm-macros + * Thu Oct 5 2023 Richard W.M. Jones - 5.1.0-2 - Add upstream patch added after 5.1.0 From 2ec55e949b92244d2b119f71e83c38a5ea878efc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 6 Oct 2023 12:40:21 +0100 Subject: [PATCH 27/54] Use BR ocaml-srpm-macros to force latest to be built against --- ocaml.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index e6d1c1a..6aa019b 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -109,8 +109,10 @@ Requires: libzstd-devel%{?_isa} # of ocaml-runtime. Requires: ocaml-runtime%{?_isa} = %{version}-%{release} -# Force ocaml-srpm-macros to be at the latest version, since OCaml 5.1 -# has a different set of native code generators than previous versions. +# Force ocaml-srpm-macros to be at the latest version, both for builds +# and installs, since OCaml 5.1 has a different set of native code +# generators than previous versions. +BuildRequires: ocaml-srpm-macros >= 9 Requires: ocaml-srpm-macros >= 9 # Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c @@ -468,6 +470,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Fri Oct 06 2023 Richard W.M. Jones - 5.1.0-4 +- Use BR ocaml-srpm-macros to force latest to be built against + * Thu Oct 05 2023 Richard W.M. Jones - 5.1.0-3 - Rebuild against updated ocaml-srpm-macros From ebbf4c122f2f8804a6da5b29c56cfeacc425b49e Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 12 Oct 2023 12:34:40 -0600 Subject: [PATCH 28/54] Configure with --enable-ocamltest on test_arches --- ocaml.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index 6aa019b..8fbbb76 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -268,6 +268,11 @@ sed -i '/^EXTRACAMLFLAGS=/aLINKOPTS=-cclib -lm' otherlibs/unix/Makefile %if 0%{?_include_frame_pointers} --enable-frame-pointers \ %endif +%endif +%ifarch %{test_arches} + --enable-ocamltest \ +%else + --disable-ocamltest \ %endif OC_CFLAGS='%{build_cflags}' \ OC_LDFLAGS='%{build_ldflags}' \ @@ -297,10 +302,6 @@ annocheck -v hello ||: %endif %ifarch %{test_arches} -make ocamltest -%ifarch %{ocaml_native_compiler} -make ocamltest.opt -%endif %ifarch %{test_arches_required} make -j1 tests %else From 48b6d0088d09695a373cbd10e7ad045de477bb56 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 13 Nov 2023 22:14:13 -0500 Subject: [PATCH 29/54] Drop unused BR parallel GNU parallel is only used by make parallel in the testsuite directory; the toplevel make tests calls make all in testsuite. --- ocaml.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index 8fbbb76..7984dc4 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: OCaml compiler and programming environment @@ -87,7 +87,6 @@ BuildRequires: gcc BuildRequires: autoconf BuildRequires: gawk BuildRequires: hardlink -BuildRequires: parallel BuildRequires: perl-interpreter BuildRequires: util-linux BuildRequires: /usr/bin/annocheck @@ -471,6 +470,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Tue Nov 14 2023 Yaakov Selkowitz - 5.1.0-5 +- Drop unused BR parallel + * Fri Oct 06 2023 Richard W.M. Jones - 5.1.0-4 - Use BR ocaml-srpm-macros to force latest to be built against From b40114b0c94016adf6340b67be20f49fde56e211 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 11 Dec 2023 22:33:21 +0000 Subject: [PATCH 30/54] New upstream version 5.1.1 (RHBZ#2239227) --- ...> 0001-Don-t-add-rpaths-to-libraries.patch | 10 +- 0001-Fix-variance-composition-12623.patch | 176 ------------------ ...-Allow-user-defined-C-compiler-flags.patch | 14 +- ...ters-tests-to-avoid-false-positive-w.patch | 6 +- ...elivery-of-effect-related-exceptions.patch | 34 ---- ocaml.spec | 21 +-- sources | 2 +- 7 files changed, 26 insertions(+), 237 deletions(-) rename 0002-Don-t-add-rpaths-to-libraries.patch => 0001-Don-t-add-rpaths-to-libraries.patch (72%) delete mode 100644 0001-Fix-variance-composition-12623.patch rename 0003-configure-Allow-user-defined-C-compiler-flags.patch => 0002-configure-Allow-user-defined-C-compiler-flags.patch (80%) rename 0005-Update-framepointers-tests-to-avoid-false-positive-w.patch => 0003-Update-framepointers-tests-to-avoid-false-positive-w.patch (99%) delete mode 100644 0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch diff --git a/0002-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch similarity index 72% rename from 0002-Don-t-add-rpaths-to-libraries.patch rename to 0001-Don-t-add-rpaths-to-libraries.patch index d1362a5..92f75dd 100644 --- a/0002-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,17 +1,17 @@ -From 56fafd588484ceb9b8e998b5e569d7df27deae3b Mon Sep 17 00:00:00 2001 +From 799bf9088c131fc71626a48e9987e4d44a2f0194 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 2/5] Don't add rpaths to libraries. +Subject: [PATCH 1/3] Don't add rpaths to libraries. --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac -index aba3569f7c..6c50ba6c71 100644 +index b81da53c42..892a2a894f 100644 --- a/configure.ac +++ b/configure.ac -@@ -1106,8 +1106,6 @@ AS_IF([test x"$enable_shared" != "xno"], +@@ -1107,8 +1107,6 @@ AS_IF([test x"$enable_shared" != "xno"], [[*-*-openbsd7.[3-9]|*-*-openbsd[89].*]], [mkdll_flags="${mkdll_flags} -Wl,--no-execute-only"]) oc_ldflags="$oc_ldflags -Wl,-E" @@ -21,5 +21,5 @@ index aba3569f7c..6c50ba6c71 100644 supports_shared_libraries=true], [mkdll='shared-libs-not-available']) -- -2.41.0 +2.43.0 diff --git a/0001-Fix-variance-composition-12623.patch b/0001-Fix-variance-composition-12623.patch deleted file mode 100644 index 34db2ab..0000000 --- a/0001-Fix-variance-composition-12623.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 4c03e721b4c53240a9091790acb401b27e72dce0 Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Wed, 4 Oct 2023 10:05:44 +0200 -Subject: [PATCH 1/5] Fix variance composition (#12623) - -Possible positive occurrence under possible negative occurrence were -forgotten, making the typechecker accepts the absurd statement - - type -'a n - type +'a p - type +'a ko = 'a p n - -(cherry picked from commit 1a9c45317b2c6c9ca9b4cb95fe4891f9f1a2820e) ---- - Changes | 8 +++ - boot/ocamlc | Bin 3051798 -> 3051796 bytes - boot/ocamllex | Bin 391863 -> 391861 bytes - testsuite/tests/typing-misc/variance.ml | 87 ++++++++++++++++++++++++ - typing/types.ml | 2 +- - 5 files changed, 96 insertions(+), 1 deletion(-) - -diff --git a/Changes b/Changes -index 20b7b8ee22..dccdc9baba 100644 ---- a/Changes -+++ b/Changes -@@ -1,3 +1,11 @@ -+OCaml 5.1.1 -+----------- -+ -+### Bug fixes: -+ -+- #12623, fix the computation of variance composition -+ (Florian Angeletti, report by Vesa Karvonen, review by Gabriel Scherer) -+ - OCaml 5.1.0 (14 September 2023) - ------------------------------- - -diff --git a/boot/ocamlc b/boot/ocamlc -index f3b2cba8df84a5f1326c7fe7bdf12b85159f65b3..4db4d848dbc3c2411a9e6160e9d932dd7ba35a34 100755 -GIT binary patch -delta 244 -zcmZ9=y)pw)7zW@yD_A75h=~7x4sq6QNTHKLLz5Y;l1i^m@y)Byq%e*dP4>M3jS*A| -zH=r=XOm0DACarO5#nU`Dd{Ng71+*IApk>g1RMp&zydf97QqRy1Wtle;50Y`&VqB`Jh%WZf=l2sxB{+% -zYvB4LHS4)A&pSWz{Q8@xo}b$HKl;!&)oPSPN%{2bA~uz{vSZ>slkC18)N0Mv{`SAV -Z)LrdtIGaw{*=p;q`M6Wx_O}_8{s6iiTe|=N - -delta 266 -zcmbQTXcyx&AZ}=3Y+-6)ZeeL*ZDDI+Z{cX+Y~gC*ZsBR+ZQ*O--y(2h;q(<<0zA`W -z77B1oUvN>3W%_}I0zB=17775dAP@@yu`m#e0I?_#ivh7X5K92DBoIphu{03N0I@6( -z%K@=G5Gw$&A`mM9u`&>=0I@0%s{yh4_CE_XmId(MW?;znW?%|9%D}jD=l1oVG`yJf -z%}n(S^$fIAQp*fYb&U*+jCBnxbq!1pxH>vaSm0oQF5a&8RRf4MfmjQOwSib?yV_UX -OtFsy3PyaJPPXYiZJ96a! - -diff --git a/boot/ocamllex b/boot/ocamllex -index cfdfbe8b4541516ef49c895ea691ea534706de67..b2b5404e69f35a1eb7d0a74fe687a4f4508a7149 100755 -GIT binary patch -delta 98 -zcmdn~RebAL@rD-07N!>F7M3lnT~@qO3=Hgl7#JKo7#Or4Zl7+&>cymMYN}_bXQ-W$ -qT4tbYWME{hYhbBsXmY^S(Q(282Yoc*?EF7M3lnT~@p@3=Hgl7#JKo85p!5ZJ%z%>cymQW~yhXXP}*u -rT4rdfYh++#tZQJYYhZf7)zM+X0tW+h@$G!JtbKbK4W`fi#VP>+{6`&d - -diff --git a/testsuite/tests/typing-misc/variance.ml b/testsuite/tests/typing-misc/variance.ml -index d0f754f716..419e348f48 100644 ---- a/testsuite/tests/typing-misc/variance.ml -+++ b/testsuite/tests/typing-misc/variance.ml -@@ -36,3 +36,90 @@ type !'a t = (module s with type t = 'a);; - module type s = sig type t end - type 'a t = (module s with type t = 'a) - |}] -+ -+(* Composition *) -+type -'a n -+type +'a p -+type !'a i -+ -+type +'a error_np = 'a n p;; -+[%%expect{| -+type -'a n -+type +'a p -+type !'a i -+Line 5, characters 0-26: -+5 | type +'a error_np = 'a n p;; -+ ^^^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be covariant, -+ but it is contravariant. -+|}] -+ -+ -+type +'a error_pn = 'a p n;; -+[%%expect{| -+Line 1, characters 0-26: -+1 | type +'a error_pn = 'a p n;; -+ ^^^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be covariant, -+ but it is contravariant. -+|}] -+ -+type -'a error_pp = 'a p p;; -+[%%expect{| -+Line 1, characters 0-26: -+1 | type -'a error_pp = 'a p p;; -+ ^^^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be contravariant, -+ but it is covariant. -+|}] -+ -+type -'a error_nn = 'a n n;; -+[%%expect{| -+Line 1, characters 0-26: -+1 | type -'a error_nn = 'a n n;; -+ ^^^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be contravariant, -+ but it is covariant. -+|}] -+ -+type !'a inj_in = 'a i n -+[%%expect{| -+Line 1, characters 0-24: -+1 | type !'a inj_in = 'a i n -+ ^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be injective invariant, -+ but it is invariant. -+|}] -+ -+type !'a inj_in = 'a n i -+[%%expect{| -+Line 1, characters 0-24: -+1 | type !'a inj_in = 'a n i -+ ^^^^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be injective invariant, -+ but it is invariant. -+|}] -+ -+module Make_covariant(M: sig type 'a t end): sig -+ type 'a i = 'a -+ type +'a t = 'a i M.t -+end = struct -+ type 'a i = 'a -+ type +'a t = 'a i M.t -+end -+ -+module Positive_ref = Make_covariant(struct type 'a t = 'a ref end) -+[%%expect {| -+Line 6, characters 2-23: -+6 | type +'a t = 'a i M.t -+ ^^^^^^^^^^^^^^^^^^^^^ -+Error: In this definition, expected parameter variances are not satisfied. -+ The 1st type parameter was expected to be covariant, -+ but it is invariant. -+|}] -diff --git a/typing/types.ml b/typing/types.ml -index 45a4f896d6..c1dbdb6895 100644 ---- a/typing/types.ml -+++ b/typing/types.ml -@@ -186,7 +186,7 @@ module Variance = struct - let mp = - mem May_pos v1 && mem May_pos v2 || mem May_neg v1 && mem May_neg v2 - and mn = -- mem May_pos v1 && mem May_neg v2 || mem May_pos v1 && mem May_neg v2 -+ mem May_pos v1 && mem May_neg v2 || mem May_neg v1 && mem May_pos v2 - and mw = mem May_weak v1 && v2 <> null || v1 <> null && mem May_weak v2 - and inj = mem Inj v1 && mem Inj v2 - and pos = mem Pos v1 && mem Pos v2 || mem Neg v1 && mem Neg v2 --- -2.41.0 - diff --git a/0003-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch similarity index 80% rename from 0003-configure-Allow-user-defined-C-compiler-flags.patch rename to 0002-configure-Allow-user-defined-C-compiler-flags.patch index 8c64262..d2d6a4b 100644 --- a/0003-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,17 +1,17 @@ -From e8170e71efb93f10c27935acc95093eb3f53ab6c Mon Sep 17 00:00:00 2001 +From f2b875e8201efed22267136096b1e5df97f99f84 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 3/5] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 6c50ba6c71..db6ea8a8d1 100644 +index 892a2a894f..e8f6cbc863 100644 --- a/configure.ac +++ b/configure.ac -@@ -759,6 +759,10 @@ AS_CASE([$host], +@@ -760,6 +760,10 @@ AS_CASE([$host], internal_cflags="$cc_warnings"], [common_cflags="-O"])]) @@ -22,7 +22,7 @@ index 6c50ba6c71..db6ea8a8d1 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. AS_CASE([$host], [i686-*-mingw32*], -@@ -2325,7 +2329,7 @@ AC_CONFIG_COMMANDS_PRE([ +@@ -2327,7 +2331,7 @@ AC_CONFIG_COMMANDS_PRE([ [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) mkdll_ldflags="" AS_IF([test -n "${LDFLAGS}"], @@ -31,7 +31,7 @@ index 6c50ba6c71..db6ea8a8d1 100644 mkdll_ldflags="${mkdll_ldflags} ${mkexe_ldflags_prefix}${flag}" done mkdll_ldflags_exp="$mkdll_ldflags"]) -@@ -2351,7 +2355,7 @@ ${mkdll_ldflags}" +@@ -2353,7 +2357,7 @@ ${mkdll_ldflags}" ],[ mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' mkdll_ldflags_exp="${oc_dll_ldflags}" @@ -41,5 +41,5 @@ index 6c50ba6c71..db6ea8a8d1 100644 mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)" mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}" -- -2.41.0 +2.43.0 diff --git a/0005-Update-framepointers-tests-to-avoid-false-positive-w.patch b/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch similarity index 99% rename from 0005-Update-framepointers-tests-to-avoid-false-positive-w.patch rename to 0003-Update-framepointers-tests-to-avoid-false-positive-w.patch index a160acb..80e51e0 100644 --- a/0005-Update-framepointers-tests-to-avoid-false-positive-w.patch +++ b/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch @@ -1,7 +1,7 @@ -From e1ee698f482664237bfb693966987cd167c22b68 Mon Sep 17 00:00:00 2001 +From ba44a9c29771aacf44222a2ff63e7bd6034dd92c Mon Sep 17 00:00:00 2001 From: Fabrice Buoro Date: Fri, 10 Mar 2023 09:36:22 -0700 -Subject: [PATCH 5/5] Update framepointers tests to avoid false positive with +Subject: [PATCH 3/3] Update framepointers tests to avoid false positive with inlined C functions --- @@ -692,5 +692,5 @@ index e96b5ea13a..0000000000 -${program} 2>&1 \ - | ${test_source_directory}/filter-locations.sh ${program} >${output} -- -2.41.0 +2.43.0 diff --git a/0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch b/0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch deleted file mode 100644 index 2a90a81..0000000 --- a/0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 8d0e4af8141f6ba925c1de426a9600a96816c86b Mon Sep 17 00:00:00 2001 -From: Miod Vallat -Date: Mon, 4 Sep 2023 13:50:30 -0600 -Subject: [PATCH 4/5] Fix x86_64 delivery of effect-related exceptions - ---- - runtime/amd64.S | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/runtime/amd64.S b/runtime/amd64.S -index 8dc9f81ec6..72d96f502d 100644 ---- a/runtime/amd64.S -+++ b/runtime/amd64.S -@@ -902,6 +902,7 @@ LBL(112): - movq Caml_state(current_stack), %rsi - SWITCH_OCAML_STACKS - /* No parent stack. Raise Effect.Unhandled. */ -+ ENTER_FUNCTION - movq %rax, C_ARG_1 - LEA_VAR(caml_raise_unhandled_effect, %rax) - jmp LBL(caml_c_call) -@@ -946,7 +947,8 @@ CFI_STARTPROC - UPDATE_BASE_POINTER(%rcx) - SWITCH_OCAML_STACKS - jmp *(%rbx) --2: LEA_VAR(caml_raise_continuation_already_resumed, %rax) -+2: ENTER_FUNCTION -+ LEA_VAR(caml_raise_continuation_already_resumed, %rax) - jmp LBL(caml_c_call) - CFI_ENDPROC - ENDFUNCTION(G(caml_resume)) --- -2.41.0 - diff --git a/ocaml.spec b/ocaml.spec index 7984dc4..92dcff1 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -42,8 +42,8 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.1.0 -Release: 5%{?dist} +Version: 5.1.1 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -64,22 +64,18 @@ Source2: ocaml_files.py # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-40-5.1.0 +# Current branch: fedora-40-5.1.1 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should # be incorporated into the git repo at a later time. -# Patches added after 5.1.0 was released. -Patch: 0001-Fix-variance-composition-12623.patch - # Fedora-specific patches -Patch: 0002-Don-t-add-rpaths-to-libraries.patch -Patch: 0003-configure-Allow-user-defined-C-compiler-flags.patch -# https://github.com/ocaml/ocaml/pull/12530 -Patch: 0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch +Patch: 0001-Don-t-add-rpaths-to-libraries.patch +Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch + # https://github.com/ocaml/ocaml/pull/11594 -Patch: 0005-Update-framepointers-tests-to-avoid-false-positive-w.patch +Patch: 0003-Update-framepointers-tests-to-avoid-false-positive-w.patch BuildRequires: make BuildRequires: git @@ -470,6 +466,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Mon Dec 11 2023 Richard W.M. Jones - 5.1.1-1 +- New upstream version 5.1.1 (RHBZ#2239227) + * Tue Nov 14 2023 Yaakov Selkowitz - 5.1.0-5 - Drop unused BR parallel diff --git a/sources b/sources index 1da2f82..f4deb78 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.1.0.tar.gz) = 814ea71de656eadc59a658ad3b6c4d786815c348ab883b1cdb22d5d0f99d11768f5646f03725f6b44c3b8f4ffeb71e89dadaea157711a7afbe86f23846fc5b52 +SHA512 (ocaml-5.1.1.tar.gz) = e4aa78afc9a59f604881f14093f4298ebcb005daeb8132a076fe6d24fdf8b59132cbfa2cfe677f1db1891351d3d637c621f24077e531cac6753c264fc7f5fbea From 4f34985ad8b10ed92e98b7115d7fedff1948bee9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 18 Dec 2023 11:07:28 +0000 Subject: [PATCH 31/54] Add s390x code generation fix https://github.com/ocaml/ocaml/issues/12829 --- 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...ters-tests-to-avoid-false-positive-w.patch | 2 +- ...-stack-reallocation-code-in-PIC-mode.patch | 26 +++++++++++++++++++ ocaml.spec | 10 ++++++- 5 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 92f75dd..b0cb61b 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 799bf9088c131fc71626a48e9987e4d44a2f0194 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/3] Don't add rpaths to libraries. +Subject: [PATCH 1/4] Don't add rpaths to libraries. --- configure.ac | 2 -- diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index d2d6a4b..d3d927d 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From f2b875e8201efed22267136096b1e5df97f99f84 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- diff --git a/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch b/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch index 80e51e0..4ee59a8 100644 --- a/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch +++ b/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch @@ -1,7 +1,7 @@ From ba44a9c29771aacf44222a2ff63e7bd6034dd92c Mon Sep 17 00:00:00 2001 From: Fabrice Buoro Date: Fri, 10 Mar 2023 09:36:22 -0700 -Subject: [PATCH 3/3] Update framepointers tests to avoid false positive with +Subject: [PATCH 3/4] Update framepointers tests to avoid false positive with inlined C functions --- diff --git a/0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch b/0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch new file mode 100644 index 0000000..16c63f9 --- /dev/null +++ b/0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch @@ -0,0 +1,26 @@ +From 81d3fb3e20afede32298e4d3e78bcebf6a22858a Mon Sep 17 00:00:00 2001 +From: Vincent Laviron +Date: Fri, 15 Dec 2023 10:00:52 +0100 +Subject: [PATCH 4/4] Fix s390x stack reallocation code in PIC mode + +(cherry picked from commit c40a955c029a203d0d7f05718e297e66987ec87f) +--- + asmcomp/s390x/emit.mlp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/asmcomp/s390x/emit.mlp b/asmcomp/s390x/emit.mlp +index 35ade079f6..0212cf3b00 100644 +--- a/asmcomp/s390x/emit.mlp ++++ b/asmcomp/s390x/emit.mlp +@@ -751,7 +751,7 @@ let fundecl fundecl = + ` lay %r15, -8(%r15)\n`; + ` stg %r14, 0(%r15)\n`; + ` lgfi %r12, {emit_int s}\n`; +- ` brasl %r14, {emit_symbol "caml_call_realloc_stack"}\n`; ++ emit_call "caml_call_realloc_stack"; + ` lg %r14, 0(%r15)\n`; + ` la %r15, 8(%r15)\n`; + ` brcl 15, {emit_label ret}\n` +-- +2.43.0 + diff --git a/ocaml.spec b/ocaml.spec index 92dcff1..4de70ea 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -77,6 +77,10 @@ Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch # https://github.com/ocaml/ocaml/pull/11594 Patch: 0003-Update-framepointers-tests-to-avoid-false-positive-w.patch +# https://github.com/ocaml/ocaml/issues/12829 +# https://github.com/ocaml/ocaml/pull/12831 +Patch: 0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch + BuildRequires: make BuildRequires: git BuildRequires: gcc @@ -466,6 +470,10 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Mon Dec 18 2023 Richard W.M. Jones - 5.1.1-2 +- Add s390x code generation fix + https://github.com/ocaml/ocaml/issues/12829 + * Mon Dec 11 2023 Richard W.M. Jones - 5.1.1-1 - New upstream version 5.1.1 (RHBZ#2239227) From 2883f28bbd9754bd0762c0c9e52cefd7d3883ffa Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 10:09:11 +0000 Subject: [PATCH 32/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 4de70ea..b410c4c 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -470,6 +470,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 5.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Dec 18 2023 Richard W.M. Jones - 5.1.1-2 - Add s390x code generation fix https://github.com/ocaml/ocaml/issues/12829 From a3771460e1e6d494c130fcddd9f0d92b9b3225e4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 09:45:15 +0000 Subject: [PATCH 33/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index b410c4c..d8d069b 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -43,7 +43,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.1.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -470,6 +470,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 5.1.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 5.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From f299c84c6ddf24babb331a6128d5993c2e99c1b5 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 23 May 2024 09:00:25 -0600 Subject: [PATCH 34/54] Version 5.2.0 - Drop upstreamed frame pointer and s390x patches --- 0001-Don-t-add-rpaths-to-libraries.patch | 6 +- ...-Allow-user-defined-C-compiler-flags.patch | 12 +- ...ters-tests-to-avoid-false-positive-w.patch | 696 ------------------ ...-stack-reallocation-code-in-PIC-mode.patch | 26 - ocaml.spec | 27 +- sources | 2 +- 6 files changed, 21 insertions(+), 748 deletions(-) delete mode 100644 0003-Update-framepointers-tests-to-avoid-false-positive-w.patch delete mode 100644 0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index b0cb61b..04773ec 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 799bf9088c131fc71626a48e9987e4d44a2f0194 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/4] Don't add rpaths to libraries. +Subject: [PATCH 1/2] Don't add rpaths to libraries. --- configure.ac | 2 -- @@ -11,8 +11,8 @@ diff --git a/configure.ac b/configure.ac index b81da53c42..892a2a894f 100644 --- a/configure.ac +++ b/configure.ac -@@ -1107,8 +1107,6 @@ AS_IF([test x"$enable_shared" != "xno"], - [[*-*-openbsd7.[3-9]|*-*-openbsd[89].*]], +@@ -1221,8 +1221,6 @@ AS_IF([test x"$enable_shared" != "xno"], + [[*-*-openbsd7.[3-9]|*-*-openbsd[89].*]], [mkdll_flags="${mkdll_flags} -Wl,--no-execute-only"]) oc_ldflags="$oc_ldflags -Wl,-E" - rpath="-Wl,-rpath," diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index d3d927d..569b4a1 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From f2b875e8201efed22267136096b1e5df97f99f84 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/4] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- @@ -11,9 +11,9 @@ diff --git a/configure.ac b/configure.ac index 892a2a894f..e8f6cbc863 100644 --- a/configure.ac +++ b/configure.ac -@@ -760,6 +760,10 @@ AS_CASE([$host], - internal_cflags="$cc_warnings"], - [common_cflags="-O"])]) +@@ -869,6 +869,10 @@ AS_CASE([$ocaml_cc_vendor], + internal_cflags="$cc_warnings"], + [common_cflags="-O"]) +# Allow CFLAGS and LDFLAGS to be added. +common_cflags="$common_cflags $CFLAGS" @@ -22,7 +22,7 @@ index 892a2a894f..e8f6cbc863 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. AS_CASE([$host], [i686-*-mingw32*], -@@ -2327,7 +2331,7 @@ AC_CONFIG_COMMANDS_PRE([ +@@ -2648,7 +2652,7 @@ AC_CONFIG_COMMANDS_PRE([ [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) mkdll_ldflags="" AS_IF([test -n "${LDFLAGS}"], @@ -31,7 +31,7 @@ index 892a2a894f..e8f6cbc863 100644 mkdll_ldflags="${mkdll_ldflags} ${mkexe_ldflags_prefix}${flag}" done mkdll_ldflags_exp="$mkdll_ldflags"]) -@@ -2353,7 +2357,7 @@ ${mkdll_ldflags}" +@@ -2674,7 +2678,7 @@ ${mkdll_ldflags}" ],[ mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' mkdll_ldflags_exp="${oc_dll_ldflags}" diff --git a/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch b/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch deleted file mode 100644 index 4ee59a8..0000000 --- a/0003-Update-framepointers-tests-to-avoid-false-positive-w.patch +++ /dev/null @@ -1,696 +0,0 @@ -From ba44a9c29771aacf44222a2ff63e7bd6034dd92c Mon Sep 17 00:00:00 2001 -From: Fabrice Buoro -Date: Fri, 10 Mar 2023 09:36:22 -0700 -Subject: [PATCH 3/4] Update framepointers tests to avoid false positive with - inlined C functions - ---- - testsuite/tests/frame-pointers/c_call.ml | 14 +- - .../tests/frame-pointers/c_call.reference | 9 - - testsuite/tests/frame-pointers/c_call.run | 4 - - testsuite/tests/frame-pointers/c_call_.c | 14 +- - testsuite/tests/frame-pointers/effects.ml | 12 +- - .../tests/frame-pointers/effects.reference | 15 -- - testsuite/tests/frame-pointers/effects.run | 4 - - .../tests/frame-pointers/exception_handler.ml | 4 +- - .../exception_handler.reference | 12 -- - .../frame-pointers/exception_handler.run | 4 - - .../tests/frame-pointers/filter-locations.sh | 23 --- - testsuite/tests/frame-pointers/fp_backtrace.c | 186 +++++++++++------- - testsuite/tests/frame-pointers/reperform.ml | 4 +- - .../tests/frame-pointers/reperform.reference | 3 - - testsuite/tests/frame-pointers/reperform.run | 4 - - .../tests/frame-pointers/stack_realloc.ml | 4 +- - .../frame-pointers/stack_realloc.reference | 3 - - .../tests/frame-pointers/stack_realloc.run | 4 - - .../tests/frame-pointers/stack_realloc2.ml | 4 +- - .../frame-pointers/stack_realloc2.reference | 3 - - .../tests/frame-pointers/stack_realloc2.run | 4 - - 21 files changed, 144 insertions(+), 190 deletions(-) - delete mode 100644 testsuite/tests/frame-pointers/c_call.run - delete mode 100644 testsuite/tests/frame-pointers/effects.run - delete mode 100644 testsuite/tests/frame-pointers/exception_handler.run - delete mode 100755 testsuite/tests/frame-pointers/filter-locations.sh - delete mode 100644 testsuite/tests/frame-pointers/reperform.run - delete mode 100644 testsuite/tests/frame-pointers/stack_realloc.run - delete mode 100644 testsuite/tests/frame-pointers/stack_realloc2.run - -diff --git a/testsuite/tests/frame-pointers/c_call.ml b/testsuite/tests/frame-pointers/c_call.ml -index c2493b3a99..9b98e86520 100644 ---- a/testsuite/tests/frame-pointers/c_call.ml -+++ b/testsuite/tests/frame-pointers/c_call.ml -@@ -7,20 +7,20 @@ all_modules = "${readonly_files} c_call.ml" - - *) - --external fp_backtrace : unit -> unit = "fp_backtrace" --external fp_backtrace_no_alloc : unit -> unit = "fp_backtrace" [@@noalloc] --external fp_backtrace_many_args : int -> int -> int -> int -> int -> int -> int -- -> int -> int -> int -> int -> unit = -+external fp_backtrace : string -> unit = "fp_backtrace" -+external fp_backtrace_no_alloc : string -> unit = "fp_backtrace" [@@noalloc] -+external fp_backtrace_many_args : string -> int -> int -> int -> int -> int -+ -> int -> int -> int -> int -> int -> int -> unit = - "fp_backtrace_many_args_argv" "fp_backtrace_many_args" - - let[@inline never] f () = - (* Check backtrace through caml_c_call_stack_args *) -- fp_backtrace_many_args 1 2 3 4 5 6 7 8 9 10 11; -+ fp_backtrace_many_args Sys.argv.(0) 1 2 3 4 5 6 7 8 9 10 11; - (* Check backtrace through caml_c_call. - * Also check that caml_c_call_stack_args correctly restores rbp register *) -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - (* Check caml_c_call correctly restores rbp register *) -- fp_backtrace_no_alloc (); -+ fp_backtrace_no_alloc Sys.argv.(0); - 42 - - let () = ignore (f ()) -diff --git a/testsuite/tests/frame-pointers/c_call.reference b/testsuite/tests/frame-pointers/c_call.reference -index 92fb40a238..23095e7431 100644 ---- a/testsuite/tests/frame-pointers/c_call.reference -+++ b/testsuite/tests/frame-pointers/c_call.reference -@@ -3,19 +3,10 @@ caml_c_call_stack_args - camlC_call.f - camlC_call.entry - caml_program --caml_start_program --caml_main/caml_startup --main - caml_c_call - camlC_call.f - camlC_call.entry - caml_program --caml_start_program --caml_main/caml_startup --main - camlC_call.f - camlC_call.entry - caml_program --caml_start_program --caml_main/caml_startup --main -diff --git a/testsuite/tests/frame-pointers/c_call.run b/testsuite/tests/frame-pointers/c_call.run -deleted file mode 100644 -index e96b5ea13a..0000000000 ---- a/testsuite/tests/frame-pointers/c_call.run -+++ /dev/null -@@ -1,4 +0,0 @@ --#!/bin/sh -- --${program} 2>&1 \ -- | ${test_source_directory}/filter-locations.sh ${program} >${output} -diff --git a/testsuite/tests/frame-pointers/c_call_.c b/testsuite/tests/frame-pointers/c_call_.c -index 634c4dd937..a75100b213 100644 ---- a/testsuite/tests/frame-pointers/c_call_.c -+++ b/testsuite/tests/frame-pointers/c_call_.c -@@ -16,10 +16,10 @@ - #include - #include "caml/mlvalues.h" - --void fp_backtrace(void); -+void fp_backtrace(value); - --value fp_backtrace_many_args(value a, value b, value c, value d, value e, -- value f, value g, value h, value i, value j, value k) -+value fp_backtrace_many_args(value argv0, value a, value b, value c, -+ value d, value e, value f, value g, value h, value i, value j, value k) - { - assert(Int_val(a) == 1); - assert(Int_val(b) == 2); -@@ -33,15 +33,15 @@ value fp_backtrace_many_args(value a, value b, value c, value d, value e, - assert(Int_val(j) == 10); - assert(Int_val(k) == 11); - -- fp_backtrace(); -+ fp_backtrace(argv0); - - return Val_unit; - } - --value fp_bactrace_many_args_argv(value *argv, int argc) -+value fp_bactrace_many_args_argv(value argv0, value *argv, int argc) - { - assert(argc == 11); - -- return fp_backtrace_many_args(argv[0], argv[1], argv[2], argv[3], argv[4], -- argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]); -+ return fp_backtrace_many_args(argv0, argv[0], argv[1], argv[2], argv[3], -+ argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]); - } -diff --git a/testsuite/tests/frame-pointers/effects.ml b/testsuite/tests/frame-pointers/effects.ml -index e14633a374..4d14190320 100644 ---- a/testsuite/tests/frame-pointers/effects.ml -+++ b/testsuite/tests/frame-pointers/effects.ml -@@ -11,26 +11,26 @@ open Printf - open Effect - open Effect.Deep - --external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] -+external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] - - type _ t += E : int -> int t - - let[@inline never] f () = - printf "# computation f\n%!"; -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - printf "# perform effect (E 0)\n%!"; - let v = perform (E 0) in - printf "# perform returns %d\n%!" v; -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - v + 1 - - let h (type a) (eff : a t) : ((a, 'b) continuation -> 'b) option = - let[@inline never] h_effect_e v k = - printf "# caught effect (E %d). continuing...\n%!" v; -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - let v = continue k (v + 1) in - printf "# continue returns %d\n%!" v; -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - v + 1 - in - match eff with -@@ -41,7 +41,7 @@ let h (type a) (eff : a t) : ((a, 'b) continuation -> 'b) option = - let v = - let[@inline never] v_retc v = - printf "# done %d\n%!" v; -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - v + 1 - in - match_with f () -diff --git a/testsuite/tests/frame-pointers/effects.reference b/testsuite/tests/frame-pointers/effects.reference -index c8bd0a391a..8ae3fc26df 100644 ---- a/testsuite/tests/frame-pointers/effects.reference -+++ b/testsuite/tests/frame-pointers/effects.reference -@@ -3,39 +3,24 @@ camlEffects.f - caml_runstack - camlEffects.entry - caml_program --caml_start_program --caml_main/caml_startup --main - # perform effect (E 0) - # caught effect (E 0). continuing... - camlEffects.h_effect_e - camlEffects.entry - caml_program --caml_start_program --caml_main/caml_startup --main - # perform returns 1 - camlEffects.f - caml_runstack - camlEffects.h_effect_e - camlEffects.entry - caml_program --caml_start_program --caml_main/caml_startup --main - # done 2 - camlEffects.v_retc - camlEffects.h_effect_e - camlEffects.entry - caml_program --caml_start_program --caml_main/caml_startup --main - # continue returns 3 - camlEffects.h_effect_e - camlEffects.entry - caml_program --caml_start_program --caml_main/caml_startup --main - # result=4 -diff --git a/testsuite/tests/frame-pointers/effects.run b/testsuite/tests/frame-pointers/effects.run -deleted file mode 100644 -index e96b5ea13a..0000000000 ---- a/testsuite/tests/frame-pointers/effects.run -+++ /dev/null -@@ -1,4 +0,0 @@ --#!/bin/sh -- --${program} 2>&1 \ -- | ${test_source_directory}/filter-locations.sh ${program} >${output} -diff --git a/testsuite/tests/frame-pointers/exception_handler.ml b/testsuite/tests/frame-pointers/exception_handler.ml -index 575f7329bf..95a4f0d75c 100644 ---- a/testsuite/tests/frame-pointers/exception_handler.ml -+++ b/testsuite/tests/frame-pointers/exception_handler.ml -@@ -8,7 +8,7 @@ all_modules = "${readonly_files} exception_handler.ml" - *) - - (* https://github.com/ocaml/ocaml/pull/11031 *) --external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] -+external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] - - exception Exn1 - exception Exn2 -@@ -38,7 +38,7 @@ let[@inline never] handler () = - let _ = Sys.opaque_identity x0 in - let _ = Sys.opaque_identity x1 in - let _ = Sys.opaque_identity x2 in -- fp_backtrace () -+ fp_backtrace Sys.argv.(0) - - let[@inline never] nested i = - begin -diff --git a/testsuite/tests/frame-pointers/exception_handler.reference b/testsuite/tests/frame-pointers/exception_handler.reference -index 513ca488b9..e012fb6d4f 100644 ---- a/testsuite/tests/frame-pointers/exception_handler.reference -+++ b/testsuite/tests/frame-pointers/exception_handler.reference -@@ -2,27 +2,15 @@ camlException_handler.handler - camlException_handler.bare - camlException_handler.entry - caml_program --caml_start_program --caml_main/caml_startup --main - camlException_handler.handler - camlException_handler.bare - camlException_handler.entry - caml_program --caml_start_program --caml_main/caml_startup --main - camlException_handler.handler - camlException_handler.nested - camlException_handler.entry - caml_program --caml_start_program --caml_main/caml_startup --main - camlException_handler.handler - camlException_handler.nested - camlException_handler.entry - caml_program --caml_start_program --caml_main/caml_startup --main -diff --git a/testsuite/tests/frame-pointers/exception_handler.run b/testsuite/tests/frame-pointers/exception_handler.run -deleted file mode 100644 -index e96b5ea13a..0000000000 ---- a/testsuite/tests/frame-pointers/exception_handler.run -+++ /dev/null -@@ -1,4 +0,0 @@ --#!/bin/sh -- --${program} 2>&1 \ -- | ${test_source_directory}/filter-locations.sh ${program} >${output} -diff --git a/testsuite/tests/frame-pointers/filter-locations.sh b/testsuite/tests/frame-pointers/filter-locations.sh -deleted file mode 100755 -index 31c7fc3189..0000000000 ---- a/testsuite/tests/frame-pointers/filter-locations.sh -+++ /dev/null -@@ -1,23 +0,0 @@ --#!/bin/sh -- --set -eu -- --program="${1}" --# https://stackoverflow.com/questions/29613304/is-it-possible-to-escape-regex-metacharacters-reliably-with-sed/29626460#29626460 --program_escaped=$(echo ${program} | sed 's/[^^\\]/[&]/g; s/\^/\\^/g; s/\\/\\\\/g') --regex_backtrace='^.*(\(.*\)+0x[[:xdigit:]]*)[0x[[:xdigit:]]*]$' --regex_trim_fun='^\(caml.*\)_[[:digit:]]*$' -- --# - Ignore backtrace not coming from the program binary --# - Discard the number suffix from OCaml function name --# - Remove strange '[0x.....]' entries inserted by some implementation --# of backtrace_symbols_fd --# - Keep the other lines --sed -e \ -- "/${regex_backtrace}/ { -- /^${program_escaped}/ ! d -- s/${regex_backtrace}/\1/ -- s/${regex_trim_fun}/\1/ -- s;caml_\(main\|startup\);caml_main/caml_startup; -- }" \ -- -e '/^\[0x/d' -diff --git a/testsuite/tests/frame-pointers/fp_backtrace.c b/testsuite/tests/frame-pointers/fp_backtrace.c -index a521218a38..cef7ccd9f2 100644 ---- a/testsuite/tests/frame-pointers/fp_backtrace.c -+++ b/testsuite/tests/frame-pointers/fp_backtrace.c -@@ -1,10 +1,17 @@ - #include --#include --#include --#include -+#include -+#include - #include -+#include -+#include - --#define ARRSIZE(a) (sizeof(a) / sizeof(*(a))) -+#include "caml/mlvalues.h" -+ -+#define ARR_SIZE(a) (sizeof(a) / sizeof(*(a))) -+ -+#define RE_FUNC_NAME "^.*\\((.+)\\+0x[[:xdigit:]]+\\) \\[0x[[:xdigit:]]+\\]$" -+#define RE_TRIM_FUNC "(caml.*)_[[:digit:]]+" -+#define CAML_ENTRY "caml_program" - - typedef struct frame_info - { -@@ -12,99 +19,138 @@ typedef struct frame_info - void* retaddr; /* rip */ - } frame_info; - --jmp_buf resume_buf; - -+/* -+ * A backtrace symbol looks like: -+ * ./path/to/binary(camlModule_fn_123+0xAABBCC) [0xAABBCCDDEE] -+ */ -+static const char* backtrace_symbol(const struct frame_info* fi) -+{ -+ char** symbols = backtrace_symbols(&fi->retaddr, 1); -+ if (!symbols) { -+ perror("backtrace_symbols"); -+ return NULL; -+ } - --static void signal_handler(int signum) -+ const char* symbol = strdup(symbols[0]); -+ free(symbols); -+ return symbol; -+} -+ -+static bool is_from_executable(const char* symbol, const char* execname) - { -- /* Should be safe to be called from a signal handler. -- * See 21.2.1 "Performing a nonlocal goto from a signal handler" from -- * The Linux Programming Interface, Michael Kerrisk */ -- siglongjmp(resume_buf, 1); -+ return strncmp(symbol, execname, strlen(execname)) == 0; - } - --static int install_signal_handlers(const int signals[], struct sigaction -- handlers[], int count) -+static regmatch_t func_name_from_symbol(const char* symbol) - { -- for (int i = 0; i < count; i++) { -- struct sigaction action = { 0 }; -- action.sa_handler = signal_handler; -- sigemptyset(&action.sa_mask); -- action.sa_flags = 0; -- -- if (sigaction(signals[i], &action, &handlers[i]) != 0) { -- perror("sigaction"); -- return -1; -- } -+ regex_t regex; -+ regmatch_t match[2] = { {-1, -1}, {-1, -1}}; -+ char errbuf[128]; -+ int err; -+ -+ err = regcomp(®ex, RE_FUNC_NAME, REG_EXTENDED); -+ if (err) { -+ regerror(err, ®ex, errbuf, ARR_SIZE(errbuf)); -+ fprintf(stderr, "regcomp: %s\n", errbuf); -+ return match[0]; - } -- return 0; -+ -+ err = regexec(®ex, symbol, ARR_SIZE(match), match, 0); -+ if (err == REG_NOMATCH) -+ return match[0]; -+ -+ return match[1]; - } - --static int restore_signal_handlers(const int signals[], struct sigaction -- handlers[], int count) -+static bool is_caml_entry(const char* symbol, const regmatch_t* funcname) - { -- for (int i = 0; i < count; i++) { -- if (sigaction(signals[i], &handlers[i], NULL) != 0) { -- perror("sigaction"); -- return -1; -- } -- } -- return 0; -+ //regoff_t len = funcname->rm_eo - funcname->rm_so; -+ //return strnstr(symbol + funcname->rm_so, CAML_ENTRY, len) == 0; -+ return strstr(symbol + funcname->rm_so, CAML_ENTRY) != NULL; - } - --static int safe_read(const struct frame_info* fi, struct frame_info** prev, -- void** retaddr) -+static regmatch_t trim_func_name(const char* symbol, const regmatch_t* funcname) - { -- /* Signals to ignore while attempting to read frame_info members */ -- const int signals[] = { SIGSEGV, SIGBUS }; -- /* Store original signal handers */ -- struct sigaction handlers[ARRSIZE(signals)] = { 0 }; -- int ret = 0; -- -- if (install_signal_handlers(signals, handlers, ARRSIZE(signals)) != 0) -- return -1; -- -- if (!sigsetjmp(resume_buf, 1)) { -- *prev = fi->prev; -- *retaddr = fi->retaddr; -- } else { -- ret = -1; -+ regex_t regex; -+ regmatch_t match[2] = { {-1, -1}, {-1, -1}}; -+ char errbuf[128]; -+ int err; -+ -+ err = regcomp(®ex, RE_TRIM_FUNC, REG_EXTENDED); -+ if (err) { -+ regerror(err, ®ex, errbuf, ARR_SIZE(errbuf)); -+ fprintf(stderr, "regcomp: %s\n", errbuf); -+ return match[0]; - } - -- if (restore_signal_handlers(signals, handlers, ARRSIZE(signals)) != 0) -- return -1; -+ match[0] = *funcname; -+ err = regexec(®ex, symbol, ARR_SIZE(match), match, REG_STARTEND); -+ if (err == REG_NOMATCH) { -+ /* match[0] has already been overwritten to hold the function full name for -+ regexec */ -+ return match[1]; -+ } - -- return ret; -+ return match[1]; - } - --static void print_location(void* addr) -+static void print_symbol(const char* symbol, const regmatch_t* match) - { -- if (!addr) -- return; -+ regoff_t off = match->rm_so; -+ regoff_t len = match->rm_eo - match->rm_so; - -- /* This requires the binary to be linked with '-rdynamic' */ -- backtrace_symbols_fd(&addr, 1, STDOUT_FILENO); -+ fprintf(stdout, "%.*s\n", len, symbol + off); -+ fflush(stdout); - } - --void fp_backtrace(void) -+void fp_backtrace(value argv0) - { -- struct frame_info *fi; -- struct frame_info* next; -- void* retaddr; -- -- fi = __builtin_frame_address(0); -- retaddr = __builtin_extract_return_addr(__builtin_return_address(0)); -- -- for (; fi; fi = next) { -- if (safe_read(fi, &next, &retaddr) != 0) -- return; -+ const char* execname = String_val(argv0); -+ struct frame_info* next = NULL; -+ const char* symbol = NULL; - -- print_location(retaddr); -+ for (struct frame_info* fi = __builtin_frame_address(0); fi; fi = next) { -+ next = fi->prev; - - /* Detect the simplest kind of infinite loop */ - if (fi == next) { -- printf("fp_backtrace: loop detected\n"); -- return; -+ fprintf(stderr, "fp_backtrace: loop detected\n"); -+ break; - } -+ -+ symbol = backtrace_symbol(fi); -+ if (!symbol) -+ continue; -+ -+ /* Skip entries not from the test */ -+ if (!is_from_executable(symbol, execname)) -+ goto skip; -+ -+ /* Exctract the full function name */ -+ regmatch_t funcname = func_name_from_symbol(symbol); -+ if (funcname.rm_so == -1) -+ goto skip; -+ -+ /* Trim numeric suffix from caml functions */ -+ regmatch_t functrimmed = trim_func_name(symbol, &funcname); -+ -+ /* Use the trimmed caml name if available, otherwise use the full function -+ name */ -+ const regmatch_t* match = (functrimmed.rm_so != -1) ? -+ &functrimmed : &funcname; -+ -+ print_symbol(symbol, match); -+ -+ /* Stop the backtrace at caml_program */ -+ if (is_caml_entry(symbol, &funcname)) -+ break; -+ -+skip: -+ free((void*)symbol); -+ symbol = NULL; - } -+ -+ if (symbol) -+ free((void*)symbol); - } -diff --git a/testsuite/tests/frame-pointers/reperform.ml b/testsuite/tests/frame-pointers/reperform.ml -index 1af8452e5f..da251c98a7 100644 ---- a/testsuite/tests/frame-pointers/reperform.ml -+++ b/testsuite/tests/frame-pointers/reperform.ml -@@ -11,7 +11,7 @@ all_modules = "${readonly_files} reperform.ml" - open Effect - open Effect.Deep - --external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] -+external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] - - type _ Effect.t += E : unit t - | F : unit t -@@ -22,7 +22,7 @@ let rec foo n = - if n = 5 then begin - perform E; - print_endline "# resumed..."; -- fp_backtrace () -+ fp_backtrace Sys.argv.(0) - end; - foo (n + 1) + n - end -diff --git a/testsuite/tests/frame-pointers/reperform.reference b/testsuite/tests/frame-pointers/reperform.reference -index 9ac6681d4b..e215f77169 100644 ---- a/testsuite/tests/frame-pointers/reperform.reference -+++ b/testsuite/tests/frame-pointers/reperform.reference -@@ -15,6 +15,3 @@ camlReperform.bar - caml_runstack - camlReperform.entry - caml_program --caml_start_program --caml_main/caml_startup --main -diff --git a/testsuite/tests/frame-pointers/reperform.run b/testsuite/tests/frame-pointers/reperform.run -deleted file mode 100644 -index e96b5ea13a..0000000000 ---- a/testsuite/tests/frame-pointers/reperform.run -+++ /dev/null -@@ -1,4 +0,0 @@ --#!/bin/sh -- --${program} 2>&1 \ -- | ${test_source_directory}/filter-locations.sh ${program} >${output} -diff --git a/testsuite/tests/frame-pointers/stack_realloc.ml b/testsuite/tests/frame-pointers/stack_realloc.ml -index 79e70c2add..f24e4795d5 100644 ---- a/testsuite/tests/frame-pointers/stack_realloc.ml -+++ b/testsuite/tests/frame-pointers/stack_realloc.ml -@@ -13,7 +13,7 @@ open Effect.Deep - - type _ t += E : int -> int t - --external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] -+external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] - external c_fun : unit -> int = "c_fun" - - let[@inline never][@local never] f x = x -@@ -42,7 +42,7 @@ let[@inline never] consume_stack () = - - let[@inline never] callback () = - consume_stack (); -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - 0 - - let _ = Callback.register "callback" callback -diff --git a/testsuite/tests/frame-pointers/stack_realloc.reference b/testsuite/tests/frame-pointers/stack_realloc.reference -index 016a03550a..e61d4104e0 100644 ---- a/testsuite/tests/frame-pointers/stack_realloc.reference -+++ b/testsuite/tests/frame-pointers/stack_realloc.reference -@@ -7,6 +7,3 @@ camlStack_realloc.f_comp - caml_runstack - camlStack_realloc.entry - caml_program --caml_start_program --caml_main/caml_startup --main -diff --git a/testsuite/tests/frame-pointers/stack_realloc.run b/testsuite/tests/frame-pointers/stack_realloc.run -deleted file mode 100644 -index e96b5ea13a..0000000000 ---- a/testsuite/tests/frame-pointers/stack_realloc.run -+++ /dev/null -@@ -1,4 +0,0 @@ --#!/bin/sh -- --${program} 2>&1 \ -- | ${test_source_directory}/filter-locations.sh ${program} >${output} -diff --git a/testsuite/tests/frame-pointers/stack_realloc2.ml b/testsuite/tests/frame-pointers/stack_realloc2.ml -index a3d21bf2bf..218dd6a1c3 100644 ---- a/testsuite/tests/frame-pointers/stack_realloc2.ml -+++ b/testsuite/tests/frame-pointers/stack_realloc2.ml -@@ -13,7 +13,7 @@ open Effect.Deep - - type _ t += E : int -> int t - --external fp_backtrace : unit -> unit = "fp_backtrace" [@@noalloc] -+external fp_backtrace : string -> unit = "fp_backtrace" [@@noalloc] - external c_fun : unit -> int = "c_fun" - - let[@inline never][@local never] f x = x -@@ -41,7 +41,7 @@ let[@inline never] consume_stack () = - ignore (gobbler count) - - let[@inline never] callback () = -- fp_backtrace (); -+ fp_backtrace Sys.argv.(0); - 0 - - let _ = Callback.register "callback" callback -diff --git a/testsuite/tests/frame-pointers/stack_realloc2.reference b/testsuite/tests/frame-pointers/stack_realloc2.reference -index ae492abd88..0051f3bad0 100644 ---- a/testsuite/tests/frame-pointers/stack_realloc2.reference -+++ b/testsuite/tests/frame-pointers/stack_realloc2.reference -@@ -7,6 +7,3 @@ camlStack_realloc2.f_comp - caml_runstack - camlStack_realloc2.entry - caml_program --caml_start_program --caml_main/caml_startup --main -diff --git a/testsuite/tests/frame-pointers/stack_realloc2.run b/testsuite/tests/frame-pointers/stack_realloc2.run -deleted file mode 100644 -index e96b5ea13a..0000000000 ---- a/testsuite/tests/frame-pointers/stack_realloc2.run -+++ /dev/null -@@ -1,4 +0,0 @@ --#!/bin/sh -- --${program} 2>&1 \ -- | ${test_source_directory}/filter-locations.sh ${program} >${output} --- -2.43.0 - diff --git a/0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch b/0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch deleted file mode 100644 index 16c63f9..0000000 --- a/0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 81d3fb3e20afede32298e4d3e78bcebf6a22858a Mon Sep 17 00:00:00 2001 -From: Vincent Laviron -Date: Fri, 15 Dec 2023 10:00:52 +0100 -Subject: [PATCH 4/4] Fix s390x stack reallocation code in PIC mode - -(cherry picked from commit c40a955c029a203d0d7f05718e297e66987ec87f) ---- - asmcomp/s390x/emit.mlp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/asmcomp/s390x/emit.mlp b/asmcomp/s390x/emit.mlp -index 35ade079f6..0212cf3b00 100644 ---- a/asmcomp/s390x/emit.mlp -+++ b/asmcomp/s390x/emit.mlp -@@ -751,7 +751,7 @@ let fundecl fundecl = - ` lay %r15, -8(%r15)\n`; - ` stg %r14, 0(%r15)\n`; - ` lgfi %r12, {emit_int s}\n`; -- ` brasl %r14, {emit_symbol "caml_call_realloc_stack"}\n`; -+ emit_call "caml_call_realloc_stack"; - ` lg %r14, 0(%r15)\n`; - ` la %r15, 8(%r15)\n`; - ` brcl 15, {emit_label ret}\n` --- -2.43.0 - diff --git a/ocaml.spec b/ocaml.spec index d8d069b..64db332 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -42,16 +42,17 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.1.1 -Release: 4%{?dist} +Version: 5.2.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception URL: https://www.ocaml.org +VCS: https://github.com/ocaml/ocaml -Source0: https://github.com/ocaml/ocaml/archive/%{version}/%{name}-%{version}.tar.gz +Source0: %{vcs}/archive/%{version}%{rcver}/%{name}-%{version}%{rcver}.tar.gz Source1: macros.ocaml-rpm Source2: ocaml_files.py @@ -74,13 +75,6 @@ Source2: ocaml_files.py Patch: 0001-Don-t-add-rpaths-to-libraries.patch Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch -# https://github.com/ocaml/ocaml/pull/11594 -Patch: 0003-Update-framepointers-tests-to-avoid-false-positive-w.patch - -# https://github.com/ocaml/ocaml/issues/12829 -# https://github.com/ocaml/ocaml/pull/12831 -Patch: 0004-Fix-s390x-stack-reallocation-code-in-PIC-mode.patch - BuildRequires: make BuildRequires: git BuildRequires: gcc @@ -111,8 +105,8 @@ Requires: ocaml-runtime%{?_isa} = %{version}-%{release} # Force ocaml-srpm-macros to be at the latest version, both for builds # and installs, since OCaml 5.1 has a different set of native code # generators than previous versions. -BuildRequires: ocaml-srpm-macros >= 9 -Requires: ocaml-srpm-macros >= 9 +BuildRequires: ocaml-srpm-macros >= 10 +Requires: ocaml-srpm-macros >= 10 # Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c Provides: bundled(md5-plumb) @@ -368,8 +362,6 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %{_bindir}/ocamloptp %endif -%{_libdir}/ocaml/camlheader -%{_libdir}/ocaml/camlheader_ur %{_libdir}/ocaml/expunge %{_libdir}/ocaml/ld.conf %{_libdir}/ocaml/Makefile.config @@ -410,8 +402,6 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %{_libdir}/ocaml/*.cmo %{_libdir}/ocaml/*.cmi %{_libdir}/ocaml/*.cma -%{_libdir}/ocaml/camlheaderd -%{_libdir}/ocaml/camlheaderi %{_libdir}/ocaml/stublibs %dir %{_libdir}/ocaml/dynlink %{_libdir}/ocaml/dynlink/META @@ -424,6 +414,7 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %{_libdir}/ocaml/runtime_events/META %{_libdir}/ocaml/runtime_events/*.cmi %{_libdir}/ocaml/runtime_events/*.cma +%{_libdir}/ocaml/runtime-launch-info %{_libdir}/ocaml/stdlib %dir %{_libdir}/ocaml/str %{_libdir}/ocaml/str/META @@ -470,6 +461,10 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu May 23 2024 Jerry James - 5.2.0-1 +- Version 5.2.0 +- Drop upstreamed frame pointer and s390x patches + * Thu Jan 25 2024 Fedora Release Engineering - 5.1.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index f4deb78..c8a1b16 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.1.1.tar.gz) = e4aa78afc9a59f604881f14093f4298ebcb005daeb8132a076fe6d24fdf8b59132cbfa2cfe677f1db1891351d3d637c621f24077e531cac6753c264fc7f5fbea +SHA512 (ocaml-5.2.0.tar.gz) = 78115690186c13c1f2480e4812a9fe34cce2c28bf8a89d5c9810bca0391f930cecd9cee2b53daca8a32da1815628b33be68f3948f1ad03fa50b72b14e3ea84f2 From 7f5edb92c01292a25db532cf468fbc8894fdcd9e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 29 May 2024 10:48:49 +0100 Subject: [PATCH 35/54] New upstream version 5.2.0 (RHBZ#2269805) --- ...onisation-and-consistency-with-trunk.patch | 90 +++ 0002-Changes-copy-editing.patch | 515 ++++++++++++++++++ ...> 0003-Don-t-add-rpaths-to-libraries.patch | 8 +- ...-Allow-user-defined-C-compiler-flags.patch | 8 +- ...transitive-closure-in-invariant_para.patch | 114 ++++ ocaml.spec | 29 +- 6 files changed, 747 insertions(+), 17 deletions(-) create mode 100644 0001-Changes-synchronisation-and-consistency-with-trunk.patch create mode 100644 0002-Changes-copy-editing.patch rename 0001-Don-t-add-rpaths-to-libraries.patch => 0003-Don-t-add-rpaths-to-libraries.patch (79%) rename 0002-configure-Allow-user-defined-C-compiler-flags.patch => 0004-configure-Allow-user-defined-C-compiler-flags.patch (88%) create mode 100644 0005-flambda-Improve-transitive-closure-in-invariant_para.patch diff --git a/0001-Changes-synchronisation-and-consistency-with-trunk.patch b/0001-Changes-synchronisation-and-consistency-with-trunk.patch new file mode 100644 index 0000000..5f865d0 --- /dev/null +++ b/0001-Changes-synchronisation-and-consistency-with-trunk.patch @@ -0,0 +1,90 @@ +From 5538fa66e94fad3d2b4f110d23bef3b4d2d6342c Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Mon, 13 May 2024 11:39:37 +0200 +Subject: [PATCH 1/5] Changes: synchronisation and consistency with trunk + +--- + Changes | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/Changes b/Changes +index 208d5e8697..1af198ba77 100644 +--- a/Changes ++++ b/Changes +@@ -140,9 +140,6 @@ OCaml 5.2.0 + (Guillaume Munch-Maccagnoni, bug reports and suggestion by Mark + Shinwell, review by Nick Barnes and Stephen Dolan) + +-- #12876: Port ThreadSanitizer support to Linux on POWER +- (Miod Vallat, review by Tim McGilchrist) +- + - #12408: `Domain.spawn` no longer leaks its functional argument for + the whole duration of the children domain lifetime. + (Guillaume Munch-Maccagnoni, review by Gabriel Scherer) +@@ -156,8 +153,10 @@ OCaml 5.2.0 + review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc + Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer) + +-- #11911, #12381: Restore statmemprof functionality in part +- (API changes in Gc.Memprof). (Nick Barnes) ++- #11911, #12381: Restore statmemprof functionality in part, with ++ some API changes in Gc.Memprof. ++ (Nick Barnes, review by Jacques-Henri Jourdan ++ and Guillaume Munch-Maccagnoni). + + - #12430: Simplify dynamic bytecode loading in Meta.reify_bytecode + (Stephen Dolan, review by Sébastien Hinderer, Vincent Laviron and Xavier +@@ -216,9 +215,10 @@ OCaml 5.2.0 + Ojeda Bar) + + - #11911, #12382, #12383: Restore statmemprof functionality in part +- (backtrace buffers, per-thread and per-domain data structures). +- (Nick Barnes, review by Gabriel Scherer, Fabrice Buoro, Sadiq +- Jaffer, and Guillaume Munch-Maccagnoni). ++ (backtrace buffers, per-thread and per-domain data structures, ++ GC/allocation interface). (Nick Barnes, review by Gabriel Scherer, ++ Fabrice Buoro, Sadiq Jaffer, Guillaume Munch-Maccagnoni, and ++ Jacques-Henri Jourdan). + + - #12735: Store both ends of the stack chain in continuations + (Leo White, review by Miod Vallat and KC Sivaramakrishnan) +@@ -248,6 +248,9 @@ OCaml 5.2.0 + Hari Hara Naveen S, reviewed by Fabrice Buoro, Gabriel Scherer and + Miod Vallat) + ++- #12876: Port ThreadSanitizer support to Linux on POWER ++ (Miod Vallat, review by Tim McGilchrist) ++ + - #12886: Reinitialize IO mutexes after fork + (Max Slater, review by Guillaume Munch-Maccagnoni and Xavier Leroy) + +@@ -990,7 +993,7 @@ OCaml 5.1.0 (14 September 2023) + `Seq.find_mapi`, `Seq.find_index`, `Array.find_mapi`, `Array.find_index`, + `Float.Array.find_opt`, `Float.Array.find_index`, `Float.Array.find_map`, + `Float.Array.find_mapi`. +- (Sima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär) ++ (Tima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär) + + - #11410: Add Set.to_list, Map.to_list, Map.of_list, + `Map.add_to_list: key -> 'a -> 'a list t -> 'a list t`. +@@ -1771,7 +1774,7 @@ Some of those changes will benefit all OCaml packages. + + - #11846: Mark rbx as destroyed at C call for Win64 (mingw-w64 and Cygwin64). + Reserve the shadow store for the ABI in the c_stack_link struct instead of +- explictly when calling C functions. This simultaneously reduces the number of ++ explicitly when calling C functions. This simultaneously reduces the number of + stack pointer manipulations and also fixes a bug when calling noalloc + functions where the shadow store was not being reserved. + (David Allsopp, report by Vesa Karvonen, review by Xavier Leroy and +@@ -2791,7 +2794,7 @@ OCaml 4.14.0 (28 March 2022) + - #8516: Change representation of class signatures + (Leo White, review by Thomas Refis) + +-- #9444: -dtypedtree, print more explictly extra nodes in pattern ast. ++- #9444: -dtypedtree, print more explicitly extra nodes in pattern ast. + (Frédéric Bour, review by Gabriel Scherer) + + - #10337: Normalize type_expr nodes on access +-- +2.44.0 + diff --git a/0002-Changes-copy-editing.patch b/0002-Changes-copy-editing.patch new file mode 100644 index 0000000..05f48ac --- /dev/null +++ b/0002-Changes-copy-editing.patch @@ -0,0 +1,515 @@ +From 7a20c9322f827923baa6a9907998f670463ce447 Mon Sep 17 00:00:00 2001 +From: Florian Angeletti +Date: Mon, 13 May 2024 14:28:08 +0200 +Subject: [PATCH 2/5] Changes copy-editing + +--- + Changes | 398 ++++++++++++++++++++++++++++---------------------------- + 1 file changed, 201 insertions(+), 197 deletions(-) + +diff --git a/Changes b/Changes +index 1af198ba77..75842fc216 100644 +--- a/Changes ++++ b/Changes +@@ -1,5 +1,5 @@ +-OCaml 5.2.0 +------------- ++OCaml 5.2.0 (13 May 2024) ++------------------------- + + (Changes that can break existing programs are marked with a "*") + +@@ -12,60 +12,6 @@ OCaml 5.2.0 + - #12667: extend the latter to POWER 64 bits, big-endian, ELFv2 ABI + (A. Wilcox, review by Xavier Leroy) + +-### Language features: +- +-- #12295, #12568: Give `while true' a polymorphic type, similarly to +- `assert false' +- (Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer, +- suggestion by Rodolphe Lepigre and John Whitington) +- +-- #12315: Use type annotations from arguments in let rec +- (Stephen Dolan, review by Gabriel Scherer) +- +-- #11252, RFC 27: Support raw identifier syntax \#foo +- (Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole) +- +-- #12044: Add local module open syntax for types. +- ``` +- module A = struct +- type t = int +- type r = unit +- type s = string +- end +- +- type example = A.(t * r * s) +- ``` +- (Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär +- and Florian Angeletti) +- +-- #12456: Document the incompatibility between effects on the one +- hand, and `caml_callback` and asynchronous callbacks (signal +- handlers, finalisers, memprof callbacks...) on the other hand. +- (Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan) +- +-- #12375: allow use of [@untagged] for all immediate types like char, bool, +- and variant with only constant constructors. +- (Christophe Raffalli, review by Gabriel Scherer) +- +-* #12502: the compiler now normalizes the newline sequence \r\n to +- a single \n character during lexing, to guarantee that the semantics +- of newlines in string literals is not modified by Windows tools +- transforming \n into \r\n in source files. +- Warning 29 [eol-in-string] is not emitted anymore, as the normalization +- gives a more robust semantics to newlines in string literals. +- (Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David +- Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg) +- +-- #13130: minor fixes to pprintast for raw identifiers and local module open +- syntax for types. +- (Chet Murthy, review by Gabriel Scherer) +- +-### Type system: +- +-- #12313, #11799: Do not re-build as-pattern type when a ground type annotation +- is given. This allows to work around problems with GADTs in as-patterns. +- (Jacques Garrigue, report by Leo White, review by Gabriel Scherer) +- + ### Runtime system: + + - #12193: Re-introduce GC compaction for shared pools +@@ -76,6 +22,12 @@ OCaml 5.2.0 + David Allsopp, Miod Vallat, Artem Pianykh, Stephen Dolan, Mark Shinwell + and KC Sivaramakrishnan) + ++- #12114: Add ThreadSanitizer support ++ (Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo, ++ review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc ++ Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer) ++ ++ + - #12850: Update Gc.quick_stat data at the end of major cycles and compaction + This PR adds an additional caml_collect_gc_stats_sample_stw to the major heap + cycling stw. This means that Gc.quick_stat now actually reflects the state of +@@ -148,11 +100,6 @@ OCaml 5.2.0 + arise at specific locations during domain creation and shutdown. + (Guillaume Munch-Maccagnoni, review by Gabriel Scherer) + +-- #12114: Add ThreadSanitizer support +- (Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo, +- review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc +- Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer) +- + - #11911, #12381: Restore statmemprof functionality in part, with + some API changes in Gc.Memprof. + (Nick Barnes, review by Jacques-Henri Jourdan +@@ -264,34 +211,48 @@ OCaml 5.2.0 + (Olivier Nicole, suggested by Stephen Dolan, review by Gabriel Scherer, + Miod Vallat and Damien Doligez) + +-### Code generation and optimizations: ++### Language features: + +-- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8. +- This reduces stack usage. It's only C stacks that require 16-alignment. +- (Xavier Leroy, review by Gabriel Scherer and Stephen Dolan) ++- #12295, #12568: Give `while true' a polymorphic type, similarly to ++ `assert false' ++ (Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer, ++ suggestion by Rodolphe Lepigre and John Whitington) + +-- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays) +- were not correctly rounded sometimes. +- (Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist) ++- #12044: Add local module open syntax for types. ++ ``` ++ module A = struct ++ type t = int ++ type r = unit ++ type s = string ++ end + +-- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation. +- Non-function recursive bindings are now forbidden from Lambda onwards, +- and compiled using a new Value_rec_compiler module. +- (Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer, +- Stefan Muenzel and Nathanaëlle Courant) ++ type example = A.(t * r * s) ++ ``` ++ (Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär ++ and Florian Angeletti) + +-- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers +- (Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron) ++- #11252, RFC 27: Support raw identifier syntax \#foo ++ (Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole) + +-- #12825: disable common subexpression elimination for atomic loads... again. +- (Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy +- and Vincent Laviron, report by Vesa Karvonen) ++ ++- #12315: Use type annotations from arguments in let rec ++ (Stephen Dolan, review by Gabriel Scherer) ++ ++- #12375: allow use of [@untagged] for all immediate types like char, bool, ++ and variant with only constant constructors. ++ (Christophe Raffalli, review by Gabriel Scherer) ++ ++* #12502: the compiler now normalizes the newline sequence \r\n to ++ a single \n character during lexing, to guarantee that the semantics ++ of newlines in string literals is not modified by Windows tools ++ transforming \n into \r\n in source files. ++ Warning 29 [eol-in-string] is not emitted anymore, as the normalization ++ gives a more robust semantics to newlines in string literals. ++ (Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David ++ Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg) + + ### Standard library: + +-- #12716: Add `Format.pp_print_nothing` function. +- (Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär) +- + - #11563: Add the Dynarray module to the stdlib. Dynamic arrays are + arrays whose length can be changed by adding or removing elements at + the end, similar to 'vectors' in C++ or Rust. +@@ -299,6 +260,10 @@ OCaml 5.2.0 + Daniel Bünzli, Guillaume Munch-Maccagnoni, Clément Allain, + Damien Doligez, Wiktor Kuchta and Pieter Goetschalckx) + ++ ++- #12716: Add `Format.pp_print_nothing` function. ++ (Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär) ++ + * #6732, #12423: Make Buffer.add_substitute surjective and fix its + documentation. + (Damien Doligez, review by Antonin Décimo) +@@ -380,6 +345,35 @@ OCaml 5.2.0 + C API. + (David Allsopp, review by Nicolás Ojeda Bär and Xavier Leroy) + ++### Type system: ++ ++- #12313, #11799: Do not re-build as-pattern type when a ground type annotation ++ is given. This allows to work around problems with GADTs in as-patterns. ++ (Jacques Garrigue, report by Leo White, review by Gabriel Scherer) ++ ++### Code generation and optimizations: ++ ++- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8. ++ This reduces stack usage. It's only C stacks that require 16-alignment. ++ (Xavier Leroy, review by Gabriel Scherer and Stephen Dolan) ++ ++- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays) ++ were not correctly rounded sometimes. ++ (Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist) ++ ++- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation. ++ Non-function recursive bindings are now forbidden from Lambda onwards, ++ and compiled using a new Value_rec_compiler module. ++ (Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer, ++ Stefan Muenzel and Nathanaëlle Courant) ++ ++- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers ++ (Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron) ++ ++- #12825: disable common subexpression elimination for atomic loads... again. ++ (Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy ++ and Vincent Laviron, report by Vesa Karvonen) ++ + ### Other libraries: + + - #12213: Dynlink library, improve legibility of error messages +@@ -390,98 +384,14 @@ OCaml 5.2.0 + instead of `value`. + (Xavier Leroy, review by David Allsopp) + +-### Tools: +- +-- #12340: testsuite: collect known issues with current -short-paths +- implementation for existential types +- (Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis) +- +-- #12147: ocamllex: Allow carriage returns at the end of line directives. +- (SeungCheol Jung, review by Nicolás Ojeda Bär) +- +-- #12260: Fix invalid_argument on some external or module aliases in ocamlnat +- (Fabian Hemmer, review by Vincent Laviron) +- +-- #12185: New script language for ocamltest. +- (Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer, +- review by Sébastien Hinderer and Gabriel Scherer) +- +-- #12371: ocamltest: fix recursive expansion of variables. +- (Antonin Décimo, Damien Doligez, review by Sébastien Hinderer, +- Damien Doligez, Gabriel Scherer, and Xavier Leroy) +- +-* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no +- input files are specified to build an executable. +- (Antonin Décimo, review by Sébastien Hinderer) +- +-- #12576: ocamldep: various refactors. +- (Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès) +- +-- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators. +- (Sébaistien Hinderer, review by Gabriel Scherer and Florian Angeletti) +- +-- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching +- for init.ml and use this to extend init.ml support to the toplevel when +- running on Windows. +- (David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and +- Antonin Décimo) +- +-- #12688: Setting the env variable `NO_COLOR` with an empty value no longer +- has effects. Previously, setting `NO_COLOR` with any value, including +- the empty value, would disable colors (unless `OCAML_COLOR` is also set). +- After this change, the user must set `NO_COLOR` with an non-empty value +- to disable colors. This reflects a specification clarification/change +- from the upstream website at https://no-color.org. +- (Favonia, review by Gabriel Scherer) +- +-- #12744: ocamltest: run tests in recursive subdirs more eagerly +- (Nick Roberts, review by Nicolás Ojeda Bär) +- +-- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect +- lexers; use unsigned numbers in the table encoding when possible. +- (Vincent Laviron, report by Edwin Török, review by Xavier Leroy) +- +-### Manual and documentation: +- +-- #12338: clarification of the documentation of process related function in +- the unix module regarding the first element of args and shell's pid. +- (Christophe Raffalli, review by Florian Angeletti) +- +-- #12473: Document in runtime/memory.c our current understanding of +- accesses to the OCaml heap from the C runtime code -- the problem +- of hybrid programs mixing two memory models. +- (Gabriel Scherer and Guillaume Munch-Maccagnoni, review by Olivier +- Nicole and Xavier Leroy) +- +-- #12694: Document in runtime/tsan.c the TSan instrumentation choices and the +- consequences with regard to the memory model. +- (Olivier Nicole, review by Miod Vallat, Gabriel Scherer, Guillaume +- Munch-Maccagnoni and Fabrice Buoro) +- +-- #12802: Add manual chapter about ThreadSanitizer support +- (Olivier Nicole, review by Miod Vallat, Sebastien Hinderer, Fabrice Buoro, +- Gabriel Scherer and KC Sivaramakrishnan) +- +-- #12819: Clarify which runtime interactions are allowed in custom ops +- (Basile Clément, review by Guillaume Munch-Maccagnoni and Xavier Leroy) +- +-- #12840: manual: update runtime tracing chapter for custom events (ex #12335) +- (Lucas Pluvinage, Sadiq Jaffer and Olivier Nicole, review by Gabriel Scherer, +- David Allsopp, Tim McGilchrist and Thomas Leonard) +- +-- #13066, update OCAMLRUNPARAM documentation for the stack size parameter l +- (Florian Angeletti, review by Nicolás Ojeda Bär, Tim McGilchrist, and +- Miod Vallat) +- +-- #13078: update Format tutorial on structural boxes to mention alignment +- questions. +- (Edwin Török, review by Florian Angeletti) +- +-- #13092: document the existence of the `[@@poll error]` built-in attribute +- (Florian Angeletti, review by Gabriel Scherer) +- + ### Compiler user-interface and warnings: + ++- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies ++ without including them in the initial environment. ++ (Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White ++ and Stefan Muenzel, RFC by François Bobot) ++ ++ + * #10613, #12405: Simplify the values used for the system variable (`system:` in + `ocamlopt -config` or the `Config.system` constant). In particular, s390x and + ppc64 now report "linux" instead of "elf"; all variants of 32-bit ARM on Linux +@@ -493,11 +403,6 @@ OCaml 5.2.0 + (David Allsopp, request by Kate Deplaix, review by Sébastien Hinderer and + Xavier Leroy) + +-- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies +- without including them in the initial environment. +- (Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White +- and Stefan Muenzel, RFC by François Bobot) +- + - #12247: configure: --disable-ocamldebug can now be used instead + of --disable-debugger (which remains available for compatibility) + (Gabriel Scherer, review by Damien Doligez and Sébastien Hinderer) +@@ -546,9 +451,125 @@ OCaml 5.2.0 + + * #12942: Fix an line ordering in some module inclusion error messages + (Nick Roberts, review by Florian Angeletti, report by Carl Eastlund) ++### Manual and documentation: ++ ++- #12338: clarification of the documentation of process related function in ++ the unix module regarding the first element of args and shell's pid. ++ (Christophe Raffalli, review by Florian Angeletti) ++ ++- #12473: Document in runtime/memory.c our current understanding of ++ accesses to the OCaml heap from the C runtime code -- the problem ++ of hybrid programs mixing two memory models. ++ (Gabriel Scherer and Guillaume Munch-Maccagnoni, review by Olivier ++ Nicole and Xavier Leroy) ++ ++- #12456: Document the incompatibility between effects on the one ++ hand, and `caml_callback` and asynchronous callbacks (signal ++ handlers, finalisers, memprof callbacks...) on the other hand. ++ (Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan) ++ ++- #12694: Document in runtime/tsan.c the TSan instrumentation choices and the ++ consequences with regard to the memory model. ++ (Olivier Nicole, review by Miod Vallat, Gabriel Scherer, Guillaume ++ Munch-Maccagnoni and Fabrice Buoro) ++ ++- #12802: Add manual chapter about ThreadSanitizer support ++ (Olivier Nicole, review by Miod Vallat, Sebastien Hinderer, Fabrice Buoro, ++ Gabriel Scherer and KC Sivaramakrishnan) ++ ++- #12819: Clarify which runtime interactions are allowed in custom ops ++ (Basile Clément, review by Guillaume Munch-Maccagnoni and Xavier Leroy) ++ ++- #12840: manual: update runtime tracing chapter for custom events (ex #12335) ++ (Lucas Pluvinage, Sadiq Jaffer and Olivier Nicole, review by Gabriel Scherer, ++ David Allsopp, Tim McGilchrist and Thomas Leonard) ++ ++- #13066, update OCAMLRUNPARAM documentation for the stack size parameter l ++ (Florian Angeletti, review by Nicolás Ojeda Bär, Tim McGilchrist, and ++ Miod Vallat) ++ ++- #13078: update Format tutorial on structural boxes to mention alignment ++ questions. ++ (Edwin Török, review by Florian Angeletti) ++ ++- #13092: document the existence of the `[@@poll error]` built-in attribute ++ (Florian Angeletti, review by Gabriel Scherer) ++ ++### Tools: ++ ++- #12340: testsuite: collect known issues with current -short-paths ++ implementation for existential types ++ (Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis) ++ ++- #12147: ocamllex: Allow carriage returns at the end of line directives. ++ (SeungCheol Jung, review by Nicolás Ojeda Bär) ++ ++- #12260: Fix invalid_argument on some external or module aliases in ocamlnat ++ (Fabian Hemmer, review by Vincent Laviron) ++ ++- #12185: New script language for ocamltest. ++ (Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer, ++ review by Sébastien Hinderer and Gabriel Scherer) ++ ++- #12371: ocamltest: fix recursive expansion of variables. ++ (Antonin Décimo, Damien Doligez, review by Sébastien Hinderer, ++ Damien Doligez, Gabriel Scherer, and Xavier Leroy) ++ ++* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no ++ input files are specified to build an executable. ++ (Antonin Décimo, review by Sébastien Hinderer) ++ ++- #12576: ocamldep: various refactors. ++ (Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès) ++ ++- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators. ++ (Sébaistien Hinderer, review by Gabriel Scherer and Florian Angeletti) ++ ++- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching ++ for init.ml and use this to extend init.ml support to the toplevel when ++ running on Windows. ++ (David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and ++ Antonin Décimo) ++ ++- #12688: Setting the env variable `NO_COLOR` with an empty value no longer ++ has effects. Previously, setting `NO_COLOR` with any value, including ++ the empty value, would disable colors (unless `OCAML_COLOR` is also set). ++ After this change, the user must set `NO_COLOR` with an non-empty value ++ to disable colors. This reflects a specification clarification/change ++ from the upstream website at https://no-color.org. ++ (Favonia, review by Gabriel Scherer) ++ ++- #12744: ocamltest: run tests in recursive subdirs more eagerly ++ (Nick Roberts, review by Nicolás Ojeda Bär) ++ ++- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect ++ lexers; use unsigned numbers in the table encoding when possible. ++ (Vincent Laviron, report by Edwin Török, review by Xavier Leroy) + + ### Internal/compiler-libs changes: + ++- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by ++ generating index tables of all identifier occurrences. This extra data in .cmt ++ files is only added when the new flag -bin-annot-occurrences is passed. ++ (Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas ++ Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis) ++ ++- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity ++ This changes function arity to be based solely on the source program's ++ parsetree. Previously, the heuristic for arity had more subtle heuristics ++ that involved type information about patterns. Function arity is important ++ because it determines when a pattern match's effects run and is an input ++ into the fast path for function application. ++ ++ This change affects tooling: it changes the function constructs in parsetree ++ and typedtree. ++ ++ See https://github.com/ocaml/RFCs/pull/32 for the original RFC. ++ ++ (Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer; ++ RFC by Stephen Dolan) ++ ++ + - #12639: parsing: Attach a location to the RHS of Ptyp_alias + and improve the 'alias type mismatch' error message. + (Jules Aguillon, review by Florian Angeletti) +@@ -583,21 +604,6 @@ OCaml 5.2.0 + in Typecore in favor of local mutable state. + (Nick Roberts, review by Takafumi Saikawa) + +-- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity +- This changes function arity to be based solely on the source program's +- parsetree. Previously, the heuristic for arity had more subtle heuristics +- that involved type information about patterns. Function arity is important +- because it determines when a pattern match's effects run and is an input +- into the fast path for function application. +- +- This change affects tooling: it changes the function constructs in parsetree +- and typedtree. +- +- See https://github.com/ocaml/RFCs/pull/32 for the original RFC. +- +- (Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer; +- RFC by Stephen Dolan) +- + - #12542: Minor bugfix to #12236: restore dropped call to `instance` + (Nick Roberts, review by Jacques Garrigue) + +@@ -650,12 +656,6 @@ OCaml 5.2.0 + - #12764: Move all installable headers in `caml/` sub-directories. + (Antonin Décimo, review by Gabriel Scherer and David Allsopp) + +-- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by +- generating index tables of all identifier occurrences. This extra data in .cmt +- files is only added when the new flag -bin-annot-occurrences is passed. +- (Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas +- Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis) +- + - #12914: Slightly change the s390x assembly dialect in order to build with + Clang's integrated assembler. + (Miod Vallat, review by Gabriel Scherer) +@@ -888,6 +888,10 @@ OCaml 5.2.0 + - #13094: Fix undefined behavior of left-shifting a negative number. + (Antonin Décimo, review by Miod Vallat and Nicolás Ojeda Bär) + ++- #13130: minor fixes to pprintast for raw identifiers and local module open ++ syntax for types. ++ (Chet Murthy, review by Gabriel Scherer) ++ + OCaml 5.1.1 (8 December 2023) + ---------------------------- + +-- +2.44.0 + diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0003-Don-t-add-rpaths-to-libraries.patch similarity index 79% rename from 0001-Don-t-add-rpaths-to-libraries.patch rename to 0003-Don-t-add-rpaths-to-libraries.patch index 04773ec..c3c1373 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0003-Don-t-add-rpaths-to-libraries.patch @@ -1,14 +1,14 @@ -From 799bf9088c131fc71626a48e9987e4d44a2f0194 Mon Sep 17 00:00:00 2001 +From 507a1382cb82160c2a6cfc0ea5bcb3e33ece7307 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/2] Don't add rpaths to libraries. +Subject: [PATCH 3/5] Don't add rpaths to libraries. --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac -index b81da53c42..892a2a894f 100644 +index 0c9d63859a..48aa9f0a29 100644 --- a/configure.ac +++ b/configure.ac @@ -1221,8 +1221,6 @@ AS_IF([test x"$enable_shared" != "xno"], @@ -21,5 +21,5 @@ index b81da53c42..892a2a894f 100644 supports_shared_libraries=true], [mkdll='shared-libs-not-available']) -- -2.43.0 +2.44.0 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0004-configure-Allow-user-defined-C-compiler-flags.patch similarity index 88% rename from 0002-configure-Allow-user-defined-C-compiler-flags.patch rename to 0004-configure-Allow-user-defined-C-compiler-flags.patch index 569b4a1..7c447ff 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0004-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,14 +1,14 @@ -From f2b875e8201efed22267136096b1e5df97f99f84 Mon Sep 17 00:00:00 2001 +From edd903fc73b98eb784b307a47110985967cb1d09 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. +Subject: [PATCH 4/5] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 892a2a894f..e8f6cbc863 100644 +index 48aa9f0a29..fc29c88f50 100644 --- a/configure.ac +++ b/configure.ac @@ -869,6 +869,10 @@ AS_CASE([$ocaml_cc_vendor], @@ -41,5 +41,5 @@ index 892a2a894f..e8f6cbc863 100644 mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)" mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}" -- -2.43.0 +2.44.0 diff --git a/0005-flambda-Improve-transitive-closure-in-invariant_para.patch b/0005-flambda-Improve-transitive-closure-in-invariant_para.patch new file mode 100644 index 0000000..808a96c --- /dev/null +++ b/0005-flambda-Improve-transitive-closure-in-invariant_para.patch @@ -0,0 +1,114 @@ +From acdc441ff1acb5390467e649bc9a9bfddd7df774 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Thu, 9 May 2024 10:03:23 +0200 +Subject: [PATCH 5/5] flambda: Improve transitive closure in + invariant_params_in_recursion (#13150) + +The old implementation did not really exploit the sparseness of the +graph because it used newly discovered edges in later iterations. +The new implementation processes each original relation only once +per starting node, and does not re-process newly discovered relations. + +(cherry picked from commit 787b4fbb5aaf3728de54ca240ba9ca0bf56ace60) +--- + Changes | 5 ++ + middle_end/flambda/invariant_params.ml | 66 ++++++++++---------------- + 2 files changed, 31 insertions(+), 40 deletions(-) + +diff --git a/Changes b/Changes +index 75842fc216..d26512067d 100644 +--- a/Changes ++++ b/Changes +@@ -1,6 +1,11 @@ + OCaml 5.2.0 (13 May 2024) + ------------------------- + ++- #13150: improve a transitive-closure computation algorithm in the flambda ++ middle-end to avoid a compilation time blowup on Menhir-generated code ++ (Florian Weimer, review by Gabriel Scherer and Pierre Chambart, ++ report by Richard Jones) ++ + (Changes that can break existing programs are marked with a "*") + + ### Restored and new backends: +diff --git a/middle_end/flambda/invariant_params.ml b/middle_end/flambda/invariant_params.ml +index 414d39310a..dba63970fd 100644 +--- a/middle_end/flambda/invariant_params.ml ++++ b/middle_end/flambda/invariant_params.ml +@@ -65,47 +65,33 @@ let implies relation from to_ = + relation + + let transitive_closure state = +- let union s1 s2 = +- match s1, s2 with +- | Top, _ | _, Top -> Top +- | Implication s1, Implication s2 -> +- Implication (Variable.Pair.Set.union s1 s2) ++ (* Depth-first search for all implications for one argument. ++ Arguments are moved from candidate to frontier, assuming ++ they are newly added to the result. *) ++ let rec loop candidate frontier result = ++ match (candidate, frontier) with ++ | ([], []) -> Implication result ++ | ([], frontier::fs) -> ++ (* Obtain fresh candidate for the frontier argument. *) ++ (match Variable.Pair.Map.find frontier state with ++ | exception Not_found -> loop [] fs result ++ | Top -> Top ++ | Implication candidate -> ++ loop (Variable.Pair.Set.elements candidate) fs result) ++ | (candidate::cs, frontier) -> ++ let result' = Variable.Pair.Set.add candidate result in ++ if result' != result then ++ (* Result change means candidate becomes part of frontier. *) ++ loop cs (candidate :: frontier) result' ++ else ++ loop cs frontier result + in +- let equal s1 s2 = +- match s1, s2 with +- | Top, Implication _ | Implication _, Top -> false +- | Top, Top -> true +- | Implication s1, Implication s2 -> Variable.Pair.Set.equal s1 s2 +- in +- let update arg state = +- let original_set = +- try Variable.Pair.Map.find arg state with +- | Not_found -> Implication Variable.Pair.Set.empty +- in +- match original_set with +- | Top -> state +- | Implication arguments -> +- let set = +- Variable.Pair.Set.fold +- (fun orig acc-> +- let set = +- try Variable.Pair.Map.find orig state with +- | Not_found -> Implication Variable.Pair.Set.empty in +- union set acc) +- arguments original_set +- in +- Variable.Pair.Map.add arg set state +- in +- let once state = +- Variable.Pair.Map.fold (fun arg _ state -> update arg state) state state +- in +- let rec fp state = +- let state' = once state in +- if Variable.Pair.Map.equal equal state state' +- then state +- else fp state' +- in +- fp state ++ Variable.Pair.Map.map ++ (fun set -> ++ match set with ++ | Top -> Top ++ | Implication set -> loop [] (Variable.Pair.Set.elements set) set) ++ state + + (* CR-soon pchambart: to move to Flambda_utils and document + mshinwell: I think this calculation is basically the same as +-- +2.44.0 + diff --git a/ocaml.spec b/ocaml.spec index 64db332..991fcc3 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,10 +1,11 @@ # Don't add -Wl,-dT, %undefine _package_note_flags -# OCaml 5.1 broke building with LTO. A file prims.c is generated with primitive -# function declarations, all with "void" for their parameter list. This does -# not match the real definitions, leading to lots of -Wlto-type-mismatch -# warnings. These change the output of the tests, leading to many failed tests. +# OCaml 5.1 broke building with LTO. A file prims.c is generated with +# primitive function declarations, all with "void" for their parameter +# list. This does not match the real definitions, leading to lots of +# -Wlto-type-mismatch warnings. These change the output of the tests, +# leading to many failed tests. This is still a problem in 5.2. %global _lto_cflags %{nil} # OCaml has a bytecode backend that works on anything with a C @@ -65,15 +66,25 @@ Source2: ocaml_files.py # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-40-5.1.1 +# Current branch: fedora-41-5.2.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should # be incorporated into the git repo at a later time. +# Upstream after 5.2.0: +Patch: 0001-Changes-synchronisation-and-consistency-with-trunk.patch +Patch: 0002-Changes-copy-editing.patch + # Fedora-specific patches -Patch: 0001-Don-t-add-rpaths-to-libraries.patch -Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch +Patch: 0003-Don-t-add-rpaths-to-libraries.patch +Patch: 0004-configure-Allow-user-defined-C-compiler-flags.patch + +# Improve performance of flambda optimizer in some cases. Required to +# compiler blow-up in coccinelle package. Upstream, but not included +# in 5.2 branch. +# https://github.com/ocaml/ocaml/pull/13150 +Patch: 0005-flambda-Improve-transitive-closure-in-invariant_para.patch BuildRequires: make BuildRequires: git @@ -103,7 +114,7 @@ Requires: libzstd-devel%{?_isa} Requires: ocaml-runtime%{?_isa} = %{version}-%{release} # Force ocaml-srpm-macros to be at the latest version, both for builds -# and installs, since OCaml 5.1 has a different set of native code +# and installs, since OCaml 5.2 has a different set of native code # generators than previous versions. BuildRequires: ocaml-srpm-macros >= 10 Requires: ocaml-srpm-macros >= 10 @@ -462,7 +473,7 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog * Thu May 23 2024 Jerry James - 5.2.0-1 -- Version 5.2.0 +- New upstream version 5.2.0 (RHBZ#2269805) - Drop upstreamed frame pointer and s390x patches * Thu Jan 25 2024 Fedora Release Engineering - 5.1.1-4 From 13ff7d02443abd752b791a74c5089bf94685afff Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 19 Jun 2024 08:01:03 +0100 Subject: [PATCH 36/54] Add fix for ppc64le code generation issue found after 5.2.0 was released --- ...onisation-and-consistency-with-trunk.patch | 2 +- 0002-Changes-copy-editing.patch | 2 +- 0003-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...transitive-closure-in-invariant_para.patch | 2 +- ...tion-pointer-register-in-caml_c_call.patch | 165 ++++++++++++++++ ...urate-instruction-sizes-for-branch-r.patch | 178 ++++++++++++++++++ ocaml.spec | 13 +- 8 files changed, 360 insertions(+), 6 deletions(-) create mode 100644 0006-Reload-exception-pointer-register-in-caml_c_call.patch create mode 100644 0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch diff --git a/0001-Changes-synchronisation-and-consistency-with-trunk.patch b/0001-Changes-synchronisation-and-consistency-with-trunk.patch index 5f865d0..a1f33b7 100644 --- a/0001-Changes-synchronisation-and-consistency-with-trunk.patch +++ b/0001-Changes-synchronisation-and-consistency-with-trunk.patch @@ -1,7 +1,7 @@ From 5538fa66e94fad3d2b4f110d23bef3b4d2d6342c Mon Sep 17 00:00:00 2001 From: Florian Angeletti Date: Mon, 13 May 2024 11:39:37 +0200 -Subject: [PATCH 1/5] Changes: synchronisation and consistency with trunk +Subject: [PATCH 1/7] Changes: synchronisation and consistency with trunk --- Changes | 25 ++++++++++++++----------- diff --git a/0002-Changes-copy-editing.patch b/0002-Changes-copy-editing.patch index 05f48ac..7633e01 100644 --- a/0002-Changes-copy-editing.patch +++ b/0002-Changes-copy-editing.patch @@ -1,7 +1,7 @@ From 7a20c9322f827923baa6a9907998f670463ce447 Mon Sep 17 00:00:00 2001 From: Florian Angeletti Date: Mon, 13 May 2024 14:28:08 +0200 -Subject: [PATCH 2/5] Changes copy-editing +Subject: [PATCH 2/7] Changes copy-editing --- Changes | 398 ++++++++++++++++++++++++++++---------------------------- diff --git a/0003-Don-t-add-rpaths-to-libraries.patch b/0003-Don-t-add-rpaths-to-libraries.patch index c3c1373..3b3e9f9 100644 --- a/0003-Don-t-add-rpaths-to-libraries.patch +++ b/0003-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 507a1382cb82160c2a6cfc0ea5bcb3e33ece7307 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 3/5] Don't add rpaths to libraries. +Subject: [PATCH 3/7] Don't add rpaths to libraries. --- configure.ac | 2 -- diff --git a/0004-configure-Allow-user-defined-C-compiler-flags.patch b/0004-configure-Allow-user-defined-C-compiler-flags.patch index 7c447ff..3c14867 100644 --- a/0004-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0004-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From edd903fc73b98eb784b307a47110985967cb1d09 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 4/5] configure: Allow user defined C compiler flags. +Subject: [PATCH 4/7] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- diff --git a/0005-flambda-Improve-transitive-closure-in-invariant_para.patch b/0005-flambda-Improve-transitive-closure-in-invariant_para.patch index 808a96c..b0b347c 100644 --- a/0005-flambda-Improve-transitive-closure-in-invariant_para.patch +++ b/0005-flambda-Improve-transitive-closure-in-invariant_para.patch @@ -1,7 +1,7 @@ From acdc441ff1acb5390467e649bc9a9bfddd7df774 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 9 May 2024 10:03:23 +0200 -Subject: [PATCH 5/5] flambda: Improve transitive closure in +Subject: [PATCH 5/7] flambda: Improve transitive closure in invariant_params_in_recursion (#13150) The old implementation did not really exploit the sparseness of the diff --git a/0006-Reload-exception-pointer-register-in-caml_c_call.patch b/0006-Reload-exception-pointer-register-in-caml_c_call.patch new file mode 100644 index 0000000..4c20a85 --- /dev/null +++ b/0006-Reload-exception-pointer-register-in-caml_c_call.patch @@ -0,0 +1,165 @@ +From 8637cac022907501c3c0d941e07e436b70c9d4ac Mon Sep 17 00:00:00 2001 +From: Miod Vallat <118974489+dustanddreams@users.noreply.github.com> +Date: Thu, 30 May 2024 09:57:41 +0000 +Subject: [PATCH 6/7] Reload exception pointer register in caml_c_call* + +The invoked code may end up causing caml_try_realloc_stack() to be invoked, +which in turn may replace the stack TRAP_PTR points to, leading to +either crashes with the debug runtime (thanks to the old stack contents +being overwritten) or all kinds of memory or control flow corruption otherwise. + +Added test for stack reallocation in callback followed by exception raising. + +(cherry picked from commit 6964d3a90f84402ed6066fb1821679435e063067) +(cherry picked from commit 1e8a91d305f1fa4668444fb1cce97952dbc39810) +--- + Changes | 9 +++++++++ + runtime/arm64.S | 6 ++++-- + runtime/power.S | 6 ++++-- + runtime/riscv.S | 6 ++++-- + runtime/s390x.S | 5 +++-- + testsuite/tests/callback/test1.ml | 5 +++++ + 6 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/Changes b/Changes +index d26512067d..53bb5369b9 100644 +--- a/Changes ++++ b/Changes +@@ -1,3 +1,12 @@ ++OCaml 5.2 maintenance version ++----------------------------- ++ ++- #13207: Be sure to reload the register caching the exception handler in ++ caml_c_call and caml_c_call_stack_args, as its value may have been changed ++ if the OCaml stack is expanded during a callback. ++ (Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and ++ Xavier Leroy) ++ + OCaml 5.2.0 (13 May 2024) + ------------------------- + +diff --git a/runtime/arm64.S b/runtime/arm64.S +index e71f25ebba..6c6495a0a8 100644 +--- a/runtime/arm64.S ++++ b/runtime/arm64.S +@@ -569,8 +569,9 @@ FUNCTION(caml_c_call) + str TRAP_PTR, Caml_state(exn_handler) + /* Call the function */ + blr ADDITIONAL_ARG +- /* Reload alloc ptr */ ++ /* Reload new allocation pointer & exn handler */ + ldr ALLOC_PTR, Caml_state(young_ptr) ++ ldr TRAP_PTR, Caml_state(exn_handler) + /* Load ocaml stack */ + SWITCH_C_TO_OCAML + #if defined(WITH_THREAD_SANITIZER) +@@ -625,8 +626,9 @@ FUNCTION(caml_c_call_stack_args) + blr ADDITIONAL_ARG + /* Restore stack */ + mov sp, x19 +- /* Reload alloc ptr */ ++ /* Reload new allocation pointer & exn handler */ + ldr ALLOC_PTR, Caml_state(young_ptr) ++ ldr TRAP_PTR, Caml_state(exn_handler) + /* Switch from C to OCaml */ + SWITCH_C_TO_OCAML + /* Return */ +diff --git a/runtime/power.S b/runtime/power.S +index bfb37fa989..257678100e 100644 +--- a/runtime/power.S ++++ b/runtime/power.S +@@ -445,8 +445,9 @@ FUNCTION caml_c_call + mr 2, C_CALL_TOC /* restore current TOC */ + /* Restore return address (in register C_CALL_RET_ADDR, preserved by C) */ + mtlr C_CALL_RET_ADDR +- /* Reload allocation pointer*/ ++ /* Reload new allocation pointer and exception pointer */ + ld ALLOC_PTR, Caml_state(young_ptr) ++ ld TRAP_PTR, Caml_state(exn_handler) + #if defined(WITH_THREAD_SANITIZER) + TSAN_SETUP_C_CALL 16 + /* Save return value registers. Since the called function could be anything, +@@ -497,8 +498,9 @@ FUNCTION caml_c_call_stack_args + add SP, SP, STACK_ARG_BYTES + /* Restore return address (in register C_CALL_RET_ADDR, preserved by C) */ + mtlr C_CALL_RET_ADDR +- /* Reload allocation pointer*/ ++ /* Reload new allocation pointer and exception pointer */ + ld ALLOC_PTR, Caml_state(young_ptr) ++ ld TRAP_PTR, Caml_state(exn_handler) + /* Switch from C to OCaml */ + SWITCH_C_TO_OCAML + /* Return to caller */ +diff --git a/runtime/riscv.S b/runtime/riscv.S +index a2eca7a315..8934db0bb3 100644 +--- a/runtime/riscv.S ++++ b/runtime/riscv.S +@@ -516,8 +516,9 @@ L(caml_c_call): + sd TRAP_PTR, Caml_state(exn_handler) + /* Call the function */ + jalr ADDITIONAL_ARG +- /* Reload alloc ptr */ ++ /* Reload new allocation pointer & exn handler */ + ld ALLOC_PTR, Caml_state(young_ptr) ++ ld TRAP_PTR, Caml_state(exn_handler) + /* Load ocaml stack */ + SWITCH_C_TO_OCAML + #if defined(WITH_THREAD_SANITIZER) +@@ -575,8 +576,9 @@ FUNCTION(caml_c_call_stack_args) + jalr ADDITIONAL_ARG + /* Restore stack */ + mv sp, s2 +- /* Reload alloc ptr */ ++ /* Reload new allocation pointer & exn handler */ + ld ALLOC_PTR, Caml_state(young_ptr) ++ ld TRAP_PTR, Caml_state(exn_handler) + /* Switch from C to OCaml */ + SWITCH_C_TO_OCAML + /* Return */ +diff --git a/runtime/s390x.S b/runtime/s390x.S +index b59822ce57..113831a376 100644 +--- a/runtime/s390x.S ++++ b/runtime/s390x.S +@@ -515,7 +515,7 @@ LBL(caml_c_call): + #endif + basr %r14, ADDITIONAL_ARG + CLEANUP_AFTER_C_CALL +- /* Reload alloc ptr */ ++ /* Reload new allocation pointer & exn handler */ + lg ALLOC_PTR, Caml_state(young_ptr) + lg TRAP_PTR, Caml_state(exn_handler) + /* Load ocaml stack and restore global variables */ +@@ -584,8 +584,9 @@ LBL(106): + CLEANUP_AFTER_C_CALL + /* Restore stack */ + lgr %r15, %r12 +- /* Reload alloc ptr */ ++ /* Reload new allocation pointer & exn handler */ + lg ALLOC_PTR, Caml_state(young_ptr) ++ lg TRAP_PTR, Caml_state(exn_handler) + /* Switch from C to OCaml */ + SWITCH_C_TO_OCAML + /* Return */ +diff --git a/testsuite/tests/callback/test1.ml b/testsuite/tests/callback/test1.ml +index c39be0c586..f6ad4356cf 100644 +--- a/testsuite/tests/callback/test1.ml ++++ b/testsuite/tests/callback/test1.ml +@@ -11,6 +11,9 @@ external mycallback3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd + external mycallback4 : + ('a -> 'b -> 'c -> 'd -> 'e) -> 'a -> 'b -> 'c -> 'd -> 'e = "mycallback4" + ++let rec growstack n = ++ if n <= 0 then 0 else 1 + growstack (n - 1) ++ + let rec tak (x, y, z as _tuple) = + if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y)) + else z +@@ -46,3 +49,5 @@ let _ = + print_int(trapexit ()); print_newline(); + print_string(tripwire mypushroot); print_newline(); + print_string(tripwire mycamlparam); print_newline(); ++ begin try ignore (mycallback1 growstack 1_000); raise Exit ++ with Exit -> () end +-- +2.44.0 + diff --git a/0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch b/0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch new file mode 100644 index 0000000..e9dd879 --- /dev/null +++ b/0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch @@ -0,0 +1,178 @@ +From 4eb80b13779125fcd76a445ab0004ca064fab634 Mon Sep 17 00:00:00 2001 +From: Miod Vallat +Date: Fri, 7 Jun 2024 06:19:45 +0000 +Subject: [PATCH 7/7] Compute more accurate instruction sizes for branch + relaxation. + +(cherry picked from commit 114ddae2d4c85391a4f939dc6623424ae35a07aa) +--- + Changes | 4 ++ + asmcomp/power/emit.mlp | 87 ++++++++++++++++++++++++------------------ + 2 files changed, 53 insertions(+), 38 deletions(-) + +diff --git a/Changes b/Changes +index 53bb5369b9..1a81509247 100644 +--- a/Changes ++++ b/Changes +@@ -7,6 +7,10 @@ OCaml 5.2 maintenance version + (Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and + Xavier Leroy) + ++- #13221: Compute more accurate instruction sizes for branch relocation on ++ POWER. ++ (Miod Vallat, review by Gabriel Scherer) ++ + OCaml 5.2.0 (13 May 2024) + ------------------------- + +diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp +index 47f5419a92..fdf22996fa 100644 +--- a/asmcomp/power/emit.mlp ++++ b/asmcomp/power/emit.mlp +@@ -177,6 +177,28 @@ let emit_tocload emit_dest dest entry = + + (* Output a load or store operation *) + ++let load_mnemonic = function ++ | Byte_unsigned -> "lbz" ++ | Byte_signed -> "lbz" ++ | Sixteen_unsigned -> "lhz" ++ | Sixteen_signed -> "lha" ++ | Thirtytwo_unsigned -> "lwz" ++ | Thirtytwo_signed -> "lwa" ++ | Word_int | Word_val -> "ld" ++ | Single -> "lfs" ++ | Double -> "lfd" ++ ++let store_mnemonic = function ++ | Byte_unsigned | Byte_signed -> "stb" ++ | Sixteen_unsigned | Sixteen_signed -> "sth" ++ | Thirtytwo_unsigned | Thirtytwo_signed -> "stw" ++ | Word_int | Word_val -> "std" ++ | Single -> "stfs" ++ | Double -> "stfd" ++ ++let store_needs_lwsync chunk assignment = ++ assignment && (chunk = Word_int || chunk = Word_val) ++ + let valid_offset instr ofs = + ofs land 3 = 0 || (instr <> "ld" && instr <> "std" && instr <> "lwa") + +@@ -383,11 +405,17 @@ module BR = Branch_relaxation.Make (struct + + let tocload_size = 2 + +- let load_store_size = function ++ let load_store_size instr = function + | Ibased(_s, d) -> +- let (_lo, hi) = low_high_s d in +- tocload_size + (if hi = 0 then 1 else 2) +- | Iindexed ofs -> if is_immediate ofs then 1 else 3 ++ let (lo, hi) = low_high_s d in ++ tocload_size + ++ (if hi <> 0 then 1 else 0) + ++ (if valid_offset instr lo then 1 else 2) ++ | Iindexed ofs -> ++ if is_immediate ofs && valid_offset instr ofs then 1 else begin ++ let (lo, _hi) = low_high_u ofs in ++ if lo <> 0 then 3 else 2 ++ end + | Iindexed2 -> 1 + + let instr_size f = function +@@ -415,16 +443,16 @@ module BR = Branch_relaxation.Make (struct + else if alloc then tocload_size + 2 + else 5 + | Lop(Istackoffset _) -> 1 +- | Lop(Iload {memory_chunk; addressing_mode; _ }) -> +- if memory_chunk = Byte_signed +- then load_store_size addressing_mode + 1 +- else load_store_size addressing_mode ++ | Lop(Iload {memory_chunk; addressing_mode; is_atomic }) -> ++ let loadinstr = load_mnemonic memory_chunk in ++ (if is_atomic then 4 else 0) + ++ (if memory_chunk = Byte_signed then 1 else 0) + ++ load_store_size loadinstr addressing_mode + | Lop(Istore(chunk, addr, assignment)) -> +- (match chunk with +- | Single -> 1 +- | Word_int | Word_val when assignment -> 1 +- | _ -> 0) +- + load_store_size addr ++ let storeinstr = store_mnemonic chunk in ++ (if chunk = Single then 1 else 0) + ++ (if store_needs_lwsync chunk assignment then 1 else 0) + ++ load_store_size storeinstr addr + | Lop(Ialloc _) -> 5 + | Lop(Ispecific(Ialloc_far _)) -> 6 + | Lop(Ipoll { return_label = Some(_) }) -> 5 +@@ -442,12 +470,12 @@ module BR = Branch_relaxation.Make (struct + | Lop(Ispecific(Icheckbound_imm_far _)) -> 3 + | Lop(Iintop_imm _) -> 1 + | Lop(Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf) -> 1 +- | Lop(Ifloatofint) -> 9 +- | Lop(Iintoffloat) -> 4 ++ | Lop(Ifloatofint) -> 3 ++ | Lop(Iintoffloat) -> 3 + | Lop(Iopaque) -> 0 + | Lop(Ispecific _) -> 1 +- | Lop (Idls_get) -> 1 +- | Lop (Ireturn_addr) -> 1 ++ | Lop(Idls_get) -> 1 ++ | Lop(Ireturn_addr) -> 1 + | Lreloadretaddr -> 2 + | Lreturn -> 2 + | Llabel _ -> 0 +@@ -457,7 +485,7 @@ module BR = Branch_relaxation.Make (struct + 1 + (if lbl0 = None then 0 else 1) + + (if lbl1 = None then 0 else 1) + + (if lbl2 = None then 0 else 1) +- | Lswitch _ -> 5 + tocload_size ++ | Lswitch _ -> 7 + tocload_size + | Lentertrap -> 1 + | Ladjust_trap_depth _ -> 0 + | Lpushtrap _ -> 4 + tocload_size +@@ -705,17 +733,7 @@ let emit_instr env i = + ` addi 1, 1, {emit_int (-n)}\n`; + adjust_stack_offset env n + | Lop(Iload { memory_chunk; addressing_mode; is_atomic }) -> +- let loadinstr = +- match memory_chunk with +- | Byte_unsigned -> "lbz" +- | Byte_signed -> "lbz" +- | Sixteen_unsigned -> "lhz" +- | Sixteen_signed -> "lha" +- | Thirtytwo_unsigned -> "lwz" +- | Thirtytwo_signed -> "lwa" +- | Word_int | Word_val -> "ld" +- | Single -> "lfs" +- | Double -> "lfd" in ++ let loadinstr = load_mnemonic memory_chunk in + if is_atomic then + ` sync\n`; + emit_load_store loadinstr addressing_mode i.arg 0 i.res.(0); +@@ -731,19 +749,12 @@ let emit_instr env i = + ` frsp {emit_reg tmp}, {emit_reg i.arg.(0)}\n`; + emit_load_store "stfs" addr i.arg 1 tmp + | Lop(Istore(chunk, addr, assignment)) -> +- let storeinstr = +- match chunk with +- | Byte_unsigned | Byte_signed -> "stb" +- | Sixteen_unsigned | Sixteen_signed -> "sth" +- | Thirtytwo_unsigned | Thirtytwo_signed -> "stw" +- | Word_int | Word_val -> "std" +- | Single -> assert false +- | Double -> "stfd" in ++ let storeinstr = store_mnemonic chunk in + (* Non-initializing stores need a memory barrier to follow the + Multicore OCaml memory model. Stores of size other than + Word_int and Word_val do not follow the memory model and therefore + do not need a barrier *) +- if assignment && (chunk = Word_int || chunk = Word_val) then ++ if store_needs_lwsync chunk assignment then + ` lwsync\n`; + emit_load_store storeinstr addr i.arg 1 i.arg.(0) + | Lop(Ialloc { bytes; dbginfo }) -> +-- +2.44.0 + diff --git a/ocaml.spec b/ocaml.spec index 991fcc3..a94c4fb 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -44,7 +44,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -86,6 +86,14 @@ Patch: 0004-configure-Allow-user-defined-C-compiler-flags.patch # https://github.com/ocaml/ocaml/pull/13150 Patch: 0005-flambda-Improve-transitive-closure-in-invariant_para.patch +# Upstream after 5.2.0: +Patch: 0006-Reload-exception-pointer-register-in-caml_c_call.patch + +# Fix for ppc64le code generation issue found after 5.2.0 was released. +# https://github.com/ocaml/ocaml/issues/13220 +# https://github.com/ocaml/ocaml/commit/114ddae2d4c85391a4f939dc6623424ae35a07aa +Patch: 0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch + BuildRequires: make BuildRequires: git BuildRequires: gcc @@ -472,6 +480,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Wed Jun 19 2024 Richard W.M. Jones - 5.2.0-2 +- Add fix for ppc64le code generation issue found after 5.2.0 was released + * Thu May 23 2024 Jerry James - 5.2.0-1 - New upstream version 5.2.0 (RHBZ#2269805) - Drop upstreamed frame pointer and s390x patches From 561453cd2d96d239213926816ae8c1786e3931e9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 19 Jun 2024 08:25:18 +0100 Subject: [PATCH 37/54] Add RHEL 10 gating tests --- gating.yaml | 6 ++++++ tests/basic-test.sh | 10 ++++++++++ tests/tests.yml | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100755 gating.yaml create mode 100755 tests/basic-test.sh create mode 100755 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100755 index 0000000..2c7ed80 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/basic-test.sh b/tests/basic-test.sh new file mode 100755 index 0000000..514bea0 --- /dev/null +++ b/tests/basic-test.sh @@ -0,0 +1,10 @@ +#!/bin/bash - +set -e +set -x + +# Compile a trivial program and run it. +echo 'print_endline "hello, world"' > hello.ml +ocamlc.opt hello.ml -o hello +./hello +ocamlopt.opt hello.ml -o hello +./hello diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100755 index 0000000..b9ec89a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,11 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - ocaml + tests: + - simple: + dir: . + run: ./basic-test.sh From 0e1aab5f28895e613b3764513d98a41c317b75c3 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 17 Jul 2024 11:25:19 -0600 Subject: [PATCH 38/54] Fix the VCS field --- ocaml.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index a94c4fb..28b57d1 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -25,6 +25,8 @@ %global natdynlink 0 %endif +%global giturl https://github.com/ocaml/ocaml + # i686 support was dropped in OCaml 5 / Fedora 39. ExcludeArch: %{ix86} @@ -51,9 +53,9 @@ Summary: OCaml compiler and programming environment License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception URL: https://www.ocaml.org -VCS: https://github.com/ocaml/ocaml +VCS: git:%{giturl}.git -Source0: %{vcs}/archive/%{version}%{rcver}/%{name}-%{version}%{rcver}.tar.gz +Source0: %{giturl}/archive/%{version}%{rcver}/%{name}-%{version}%{rcver}.tar.gz Source1: macros.ocaml-rpm Source2: ocaml_files.py From a7c6be2f53b7e29619faa2a481bb3b3905293276 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 19:59:15 +0000 Subject: [PATCH 39/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 28b57d1..c4b4035 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -46,7 +46,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.2.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -482,6 +482,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 5.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jun 19 2024 Richard W.M. Jones - 5.2.0-2 - Add fix for ppc64le code generation issue found after 5.2.0 was released From 5018fa7019c262dbfb0402f9cc0f1e19b33d16d3 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 9 Jan 2025 08:24:42 -0700 Subject: [PATCH 40/54] New upstream version 5.3.0 - Drop upstreamed patches - BR git-core instead of git --- ...onisation-and-consistency-with-trunk.patch | 90 --- ...> 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- 0002-Changes-copy-editing.patch | 515 ------------------ ...-Allow-user-defined-C-compiler-flags.patch | 16 +- ...transitive-closure-in-invariant_para.patch | 114 ---- ...tion-pointer-register-in-caml_c_call.patch | 165 ------ ...urate-instruction-sizes-for-branch-r.patch | 178 ------ ocaml.spec | 38 +- sources | 2 +- 9 files changed, 17 insertions(+), 1103 deletions(-) delete mode 100644 0001-Changes-synchronisation-and-consistency-with-trunk.patch rename 0003-Don-t-add-rpaths-to-libraries.patch => 0001-Don-t-add-rpaths-to-libraries.patch (93%) delete mode 100644 0002-Changes-copy-editing.patch rename 0004-configure-Allow-user-defined-C-compiler-flags.patch => 0002-configure-Allow-user-defined-C-compiler-flags.patch (64%) delete mode 100644 0005-flambda-Improve-transitive-closure-in-invariant_para.patch delete mode 100644 0006-Reload-exception-pointer-register-in-caml_c_call.patch delete mode 100644 0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch diff --git a/0001-Changes-synchronisation-and-consistency-with-trunk.patch b/0001-Changes-synchronisation-and-consistency-with-trunk.patch deleted file mode 100644 index a1f33b7..0000000 --- a/0001-Changes-synchronisation-and-consistency-with-trunk.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 5538fa66e94fad3d2b4f110d23bef3b4d2d6342c Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Mon, 13 May 2024 11:39:37 +0200 -Subject: [PATCH 1/7] Changes: synchronisation and consistency with trunk - ---- - Changes | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) - -diff --git a/Changes b/Changes -index 208d5e8697..1af198ba77 100644 ---- a/Changes -+++ b/Changes -@@ -140,9 +140,6 @@ OCaml 5.2.0 - (Guillaume Munch-Maccagnoni, bug reports and suggestion by Mark - Shinwell, review by Nick Barnes and Stephen Dolan) - --- #12876: Port ThreadSanitizer support to Linux on POWER -- (Miod Vallat, review by Tim McGilchrist) -- - - #12408: `Domain.spawn` no longer leaks its functional argument for - the whole duration of the children domain lifetime. - (Guillaume Munch-Maccagnoni, review by Gabriel Scherer) -@@ -156,8 +153,10 @@ OCaml 5.2.0 - review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc - Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer) - --- #11911, #12381: Restore statmemprof functionality in part -- (API changes in Gc.Memprof). (Nick Barnes) -+- #11911, #12381: Restore statmemprof functionality in part, with -+ some API changes in Gc.Memprof. -+ (Nick Barnes, review by Jacques-Henri Jourdan -+ and Guillaume Munch-Maccagnoni). - - - #12430: Simplify dynamic bytecode loading in Meta.reify_bytecode - (Stephen Dolan, review by Sébastien Hinderer, Vincent Laviron and Xavier -@@ -216,9 +215,10 @@ OCaml 5.2.0 - Ojeda Bar) - - - #11911, #12382, #12383: Restore statmemprof functionality in part -- (backtrace buffers, per-thread and per-domain data structures). -- (Nick Barnes, review by Gabriel Scherer, Fabrice Buoro, Sadiq -- Jaffer, and Guillaume Munch-Maccagnoni). -+ (backtrace buffers, per-thread and per-domain data structures, -+ GC/allocation interface). (Nick Barnes, review by Gabriel Scherer, -+ Fabrice Buoro, Sadiq Jaffer, Guillaume Munch-Maccagnoni, and -+ Jacques-Henri Jourdan). - - - #12735: Store both ends of the stack chain in continuations - (Leo White, review by Miod Vallat and KC Sivaramakrishnan) -@@ -248,6 +248,9 @@ OCaml 5.2.0 - Hari Hara Naveen S, reviewed by Fabrice Buoro, Gabriel Scherer and - Miod Vallat) - -+- #12876: Port ThreadSanitizer support to Linux on POWER -+ (Miod Vallat, review by Tim McGilchrist) -+ - - #12886: Reinitialize IO mutexes after fork - (Max Slater, review by Guillaume Munch-Maccagnoni and Xavier Leroy) - -@@ -990,7 +993,7 @@ OCaml 5.1.0 (14 September 2023) - `Seq.find_mapi`, `Seq.find_index`, `Array.find_mapi`, `Array.find_index`, - `Float.Array.find_opt`, `Float.Array.find_index`, `Float.Array.find_map`, - `Float.Array.find_mapi`. -- (Sima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär) -+ (Tima Kinsart, review by Daniel Bünzli and Nicolás Ojeda Bär) - - - #11410: Add Set.to_list, Map.to_list, Map.of_list, - `Map.add_to_list: key -> 'a -> 'a list t -> 'a list t`. -@@ -1771,7 +1774,7 @@ Some of those changes will benefit all OCaml packages. - - - #11846: Mark rbx as destroyed at C call for Win64 (mingw-w64 and Cygwin64). - Reserve the shadow store for the ABI in the c_stack_link struct instead of -- explictly when calling C functions. This simultaneously reduces the number of -+ explicitly when calling C functions. This simultaneously reduces the number of - stack pointer manipulations and also fixes a bug when calling noalloc - functions where the shadow store was not being reserved. - (David Allsopp, report by Vesa Karvonen, review by Xavier Leroy and -@@ -2791,7 +2794,7 @@ OCaml 4.14.0 (28 March 2022) - - #8516: Change representation of class signatures - (Leo White, review by Thomas Refis) - --- #9444: -dtypedtree, print more explictly extra nodes in pattern ast. -+- #9444: -dtypedtree, print more explicitly extra nodes in pattern ast. - (Frédéric Bour, review by Gabriel Scherer) - - - #10337: Normalize type_expr nodes on access --- -2.44.0 - diff --git a/0003-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch similarity index 93% rename from 0003-Don-t-add-rpaths-to-libraries.patch rename to 0001-Don-t-add-rpaths-to-libraries.patch index 3b3e9f9..b5735bd 100644 --- a/0003-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 507a1382cb82160c2a6cfc0ea5bcb3e33ece7307 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 3/7] Don't add rpaths to libraries. +Subject: [PATCH 1/2] Don't add rpaths to libraries. --- configure.ac | 2 -- diff --git a/0002-Changes-copy-editing.patch b/0002-Changes-copy-editing.patch deleted file mode 100644 index 7633e01..0000000 --- a/0002-Changes-copy-editing.patch +++ /dev/null @@ -1,515 +0,0 @@ -From 7a20c9322f827923baa6a9907998f670463ce447 Mon Sep 17 00:00:00 2001 -From: Florian Angeletti -Date: Mon, 13 May 2024 14:28:08 +0200 -Subject: [PATCH 2/7] Changes copy-editing - ---- - Changes | 398 ++++++++++++++++++++++++++++---------------------------- - 1 file changed, 201 insertions(+), 197 deletions(-) - -diff --git a/Changes b/Changes -index 1af198ba77..75842fc216 100644 ---- a/Changes -+++ b/Changes -@@ -1,5 +1,5 @@ --OCaml 5.2.0 -------------- -+OCaml 5.2.0 (13 May 2024) -+------------------------- - - (Changes that can break existing programs are marked with a "*") - -@@ -12,60 +12,6 @@ OCaml 5.2.0 - - #12667: extend the latter to POWER 64 bits, big-endian, ELFv2 ABI - (A. Wilcox, review by Xavier Leroy) - --### Language features: -- --- #12295, #12568: Give `while true' a polymorphic type, similarly to -- `assert false' -- (Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer, -- suggestion by Rodolphe Lepigre and John Whitington) -- --- #12315: Use type annotations from arguments in let rec -- (Stephen Dolan, review by Gabriel Scherer) -- --- #11252, RFC 27: Support raw identifier syntax \#foo -- (Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole) -- --- #12044: Add local module open syntax for types. -- ``` -- module A = struct -- type t = int -- type r = unit -- type s = string -- end -- -- type example = A.(t * r * s) -- ``` -- (Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär -- and Florian Angeletti) -- --- #12456: Document the incompatibility between effects on the one -- hand, and `caml_callback` and asynchronous callbacks (signal -- handlers, finalisers, memprof callbacks...) on the other hand. -- (Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan) -- --- #12375: allow use of [@untagged] for all immediate types like char, bool, -- and variant with only constant constructors. -- (Christophe Raffalli, review by Gabriel Scherer) -- --* #12502: the compiler now normalizes the newline sequence \r\n to -- a single \n character during lexing, to guarantee that the semantics -- of newlines in string literals is not modified by Windows tools -- transforming \n into \r\n in source files. -- Warning 29 [eol-in-string] is not emitted anymore, as the normalization -- gives a more robust semantics to newlines in string literals. -- (Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David -- Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg) -- --- #13130: minor fixes to pprintast for raw identifiers and local module open -- syntax for types. -- (Chet Murthy, review by Gabriel Scherer) -- --### Type system: -- --- #12313, #11799: Do not re-build as-pattern type when a ground type annotation -- is given. This allows to work around problems with GADTs in as-patterns. -- (Jacques Garrigue, report by Leo White, review by Gabriel Scherer) -- - ### Runtime system: - - - #12193: Re-introduce GC compaction for shared pools -@@ -76,6 +22,12 @@ OCaml 5.2.0 - David Allsopp, Miod Vallat, Artem Pianykh, Stephen Dolan, Mark Shinwell - and KC Sivaramakrishnan) - -+- #12114: Add ThreadSanitizer support -+ (Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo, -+ review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc -+ Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer) -+ -+ - - #12850: Update Gc.quick_stat data at the end of major cycles and compaction - This PR adds an additional caml_collect_gc_stats_sample_stw to the major heap - cycling stw. This means that Gc.quick_stat now actually reflects the state of -@@ -148,11 +100,6 @@ OCaml 5.2.0 - arise at specific locations during domain creation and shutdown. - (Guillaume Munch-Maccagnoni, review by Gabriel Scherer) - --- #12114: Add ThreadSanitizer support -- (Fabrice Buoro and Olivier Nicole, based on an initial work by Anmol Sahoo, -- review by Damien Doligez, Sébastien Hinderer, Jacques-Henri Jourdan, Luc -- Maranget, Guillaume Munch-Maccagnoni, Gabriel Scherer) -- - - #11911, #12381: Restore statmemprof functionality in part, with - some API changes in Gc.Memprof. - (Nick Barnes, review by Jacques-Henri Jourdan -@@ -264,34 +211,48 @@ OCaml 5.2.0 - (Olivier Nicole, suggested by Stephen Dolan, review by Gabriel Scherer, - Miod Vallat and Damien Doligez) - --### Code generation and optimizations: -+### Language features: - --- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8. -- This reduces stack usage. It's only C stacks that require 16-alignment. -- (Xavier Leroy, review by Gabriel Scherer and Stephen Dolan) -+- #12295, #12568: Give `while true' a polymorphic type, similarly to -+ `assert false' -+ (Jeremy Yallop, review by Nicolás Ojeda Bär and Gabriel Scherer, -+ suggestion by Rodolphe Lepigre and John Whitington) - --- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays) -- were not correctly rounded sometimes. -- (Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist) -+- #12044: Add local module open syntax for types. -+ ``` -+ module A = struct -+ type t = int -+ type r = unit -+ type s = string -+ end - --- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation. -- Non-function recursive bindings are now forbidden from Lambda onwards, -- and compiled using a new Value_rec_compiler module. -- (Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer, -- Stefan Muenzel and Nathanaëlle Courant) -+ type example = A.(t * r * s) -+ ``` -+ (Alistair O'Brien, review by Gabriel Scherer, Nicolás Ojeda Bär -+ and Florian Angeletti) - --- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers -- (Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron) -+- #11252, RFC 27: Support raw identifier syntax \#foo -+ (Stephen Dolan, review by David Allsopp, Gabriel Scherer and Olivier Nicole) - --- #12825: disable common subexpression elimination for atomic loads... again. -- (Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy -- and Vincent Laviron, report by Vesa Karvonen) -+ -+- #12315: Use type annotations from arguments in let rec -+ (Stephen Dolan, review by Gabriel Scherer) -+ -+- #12375: allow use of [@untagged] for all immediate types like char, bool, -+ and variant with only constant constructors. -+ (Christophe Raffalli, review by Gabriel Scherer) -+ -+* #12502: the compiler now normalizes the newline sequence \r\n to -+ a single \n character during lexing, to guarantee that the semantics -+ of newlines in string literals is not modified by Windows tools -+ transforming \n into \r\n in source files. -+ Warning 29 [eol-in-string] is not emitted anymore, as the normalization -+ gives a more robust semantics to newlines in string literals. -+ (Gabriel Scherer and Damien Doligez, review by Daniel Bünzli, David -+ Allsopp, Andreas Rossberg, Xavier Leroy, report by Andreas Rossberg) - - ### Standard library: - --- #12716: Add `Format.pp_print_nothing` function. -- (Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär) -- - - #11563: Add the Dynarray module to the stdlib. Dynamic arrays are - arrays whose length can be changed by adding or removing elements at - the end, similar to 'vectors' in C++ or Rust. -@@ -299,6 +260,10 @@ OCaml 5.2.0 - Daniel Bünzli, Guillaume Munch-Maccagnoni, Clément Allain, - Damien Doligez, Wiktor Kuchta and Pieter Goetschalckx) - -+ -+- #12716: Add `Format.pp_print_nothing` function. -+ (Léo Andrès, review by Gabriel Scherer and Nicolás Ojeda Bär) -+ - * #6732, #12423: Make Buffer.add_substitute surjective and fix its - documentation. - (Damien Doligez, review by Antonin Décimo) -@@ -380,6 +345,35 @@ OCaml 5.2.0 - C API. - (David Allsopp, review by Nicolás Ojeda Bär and Xavier Leroy) - -+### Type system: -+ -+- #12313, #11799: Do not re-build as-pattern type when a ground type annotation -+ is given. This allows to work around problems with GADTs in as-patterns. -+ (Jacques Garrigue, report by Leo White, review by Gabriel Scherer) -+ -+### Code generation and optimizations: -+ -+- #11239: on x86-64 and RISC-V, reduce alignment of OCaml stacks from 16 to 8. -+ This reduces stack usage. It's only C stacks that require 16-alignment. -+ (Xavier Leroy, review by Gabriel Scherer and Stephen Dolan) -+ -+- #12311: on POWER, 32-bit FP numbers stored in memory (e.g. in bigarrays) -+ were not correctly rounded sometimes. -+ (Xavier Leroy, review by Anil Madhavapeddy and Tim McGilchrist) -+ -+- #12551, #12608, #12782, #12596: Overhaul of recursive value compilation. -+ Non-function recursive bindings are now forbidden from Lambda onwards, -+ and compiled using a new Value_rec_compiler module. -+ (Vincent Laviron and Lunia Ayanides, review by Gabriel Scherer, -+ Stefan Muenzel and Nathanaëlle Courant) -+ -+- #1809, #12181: rewrite `compare x y op 0` to `x op y` when values are integers -+ (Xavier Clerc, Stefan Muenzel, review by Gabriel Scherer and Vincent Laviron) -+ -+- #12825: disable common subexpression elimination for atomic loads... again. -+ (Gabriel Scherer, review by KC Sivaramakrishnan, Xavier Leroy -+ and Vincent Laviron, report by Vesa Karvonen) -+ - ### Other libraries: - - - #12213: Dynlink library, improve legibility of error messages -@@ -390,98 +384,14 @@ OCaml 5.2.0 - instead of `value`. - (Xavier Leroy, review by David Allsopp) - --### Tools: -- --- #12340: testsuite: collect known issues with current -short-paths -- implementation for existential types -- (Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis) -- --- #12147: ocamllex: Allow carriage returns at the end of line directives. -- (SeungCheol Jung, review by Nicolás Ojeda Bär) -- --- #12260: Fix invalid_argument on some external or module aliases in ocamlnat -- (Fabian Hemmer, review by Vincent Laviron) -- --- #12185: New script language for ocamltest. -- (Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer, -- review by Sébastien Hinderer and Gabriel Scherer) -- --- #12371: ocamltest: fix recursive expansion of variables. -- (Antonin Décimo, Damien Doligez, review by Sébastien Hinderer, -- Damien Doligez, Gabriel Scherer, and Xavier Leroy) -- --* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no -- input files are specified to build an executable. -- (Antonin Décimo, review by Sébastien Hinderer) -- --- #12576: ocamldep: various refactors. -- (Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès) -- --- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators. -- (Sébaistien Hinderer, review by Gabriel Scherer and Florian Angeletti) -- --- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching -- for init.ml and use this to extend init.ml support to the toplevel when -- running on Windows. -- (David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and -- Antonin Décimo) -- --- #12688: Setting the env variable `NO_COLOR` with an empty value no longer -- has effects. Previously, setting `NO_COLOR` with any value, including -- the empty value, would disable colors (unless `OCAML_COLOR` is also set). -- After this change, the user must set `NO_COLOR` with an non-empty value -- to disable colors. This reflects a specification clarification/change -- from the upstream website at https://no-color.org. -- (Favonia, review by Gabriel Scherer) -- --- #12744: ocamltest: run tests in recursive subdirs more eagerly -- (Nick Roberts, review by Nicolás Ojeda Bär) -- --- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect -- lexers; use unsigned numbers in the table encoding when possible. -- (Vincent Laviron, report by Edwin Török, review by Xavier Leroy) -- --### Manual and documentation: -- --- #12338: clarification of the documentation of process related function in -- the unix module regarding the first element of args and shell's pid. -- (Christophe Raffalli, review by Florian Angeletti) -- --- #12473: Document in runtime/memory.c our current understanding of -- accesses to the OCaml heap from the C runtime code -- the problem -- of hybrid programs mixing two memory models. -- (Gabriel Scherer and Guillaume Munch-Maccagnoni, review by Olivier -- Nicole and Xavier Leroy) -- --- #12694: Document in runtime/tsan.c the TSan instrumentation choices and the -- consequences with regard to the memory model. -- (Olivier Nicole, review by Miod Vallat, Gabriel Scherer, Guillaume -- Munch-Maccagnoni and Fabrice Buoro) -- --- #12802: Add manual chapter about ThreadSanitizer support -- (Olivier Nicole, review by Miod Vallat, Sebastien Hinderer, Fabrice Buoro, -- Gabriel Scherer and KC Sivaramakrishnan) -- --- #12819: Clarify which runtime interactions are allowed in custom ops -- (Basile Clément, review by Guillaume Munch-Maccagnoni and Xavier Leroy) -- --- #12840: manual: update runtime tracing chapter for custom events (ex #12335) -- (Lucas Pluvinage, Sadiq Jaffer and Olivier Nicole, review by Gabriel Scherer, -- David Allsopp, Tim McGilchrist and Thomas Leonard) -- --- #13066, update OCAMLRUNPARAM documentation for the stack size parameter l -- (Florian Angeletti, review by Nicolás Ojeda Bär, Tim McGilchrist, and -- Miod Vallat) -- --- #13078: update Format tutorial on structural boxes to mention alignment -- questions. -- (Edwin Török, review by Florian Angeletti) -- --- #13092: document the existence of the `[@@poll error]` built-in attribute -- (Florian Angeletti, review by Gabriel Scherer) -- - ### Compiler user-interface and warnings: - -+- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies -+ without including them in the initial environment. -+ (Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White -+ and Stefan Muenzel, RFC by François Bobot) -+ -+ - * #10613, #12405: Simplify the values used for the system variable (`system:` in - `ocamlopt -config` or the `Config.system` constant). In particular, s390x and - ppc64 now report "linux" instead of "elf"; all variants of 32-bit ARM on Linux -@@ -493,11 +403,6 @@ OCaml 5.2.0 - (David Allsopp, request by Kate Deplaix, review by Sébastien Hinderer and - Xavier Leroy) - --- #11989, #12246, RFC 31: New flag, -H, to allow for transitive dependencies -- without including them in the initial environment. -- (Chris Casinghino, François Bobot, and Gabriel Scherer, review by Leo White -- and Stefan Muenzel, RFC by François Bobot) -- - - #12247: configure: --disable-ocamldebug can now be used instead - of --disable-debugger (which remains available for compatibility) - (Gabriel Scherer, review by Damien Doligez and Sébastien Hinderer) -@@ -546,9 +451,125 @@ OCaml 5.2.0 - - * #12942: Fix an line ordering in some module inclusion error messages - (Nick Roberts, review by Florian Angeletti, report by Carl Eastlund) -+### Manual and documentation: -+ -+- #12338: clarification of the documentation of process related function in -+ the unix module regarding the first element of args and shell's pid. -+ (Christophe Raffalli, review by Florian Angeletti) -+ -+- #12473: Document in runtime/memory.c our current understanding of -+ accesses to the OCaml heap from the C runtime code -- the problem -+ of hybrid programs mixing two memory models. -+ (Gabriel Scherer and Guillaume Munch-Maccagnoni, review by Olivier -+ Nicole and Xavier Leroy) -+ -+- #12456: Document the incompatibility between effects on the one -+ hand, and `caml_callback` and asynchronous callbacks (signal -+ handlers, finalisers, memprof callbacks...) on the other hand. -+ (Guillaume Munch-Maccagnoni, review by KC Sivaramakrishnan) -+ -+- #12694: Document in runtime/tsan.c the TSan instrumentation choices and the -+ consequences with regard to the memory model. -+ (Olivier Nicole, review by Miod Vallat, Gabriel Scherer, Guillaume -+ Munch-Maccagnoni and Fabrice Buoro) -+ -+- #12802: Add manual chapter about ThreadSanitizer support -+ (Olivier Nicole, review by Miod Vallat, Sebastien Hinderer, Fabrice Buoro, -+ Gabriel Scherer and KC Sivaramakrishnan) -+ -+- #12819: Clarify which runtime interactions are allowed in custom ops -+ (Basile Clément, review by Guillaume Munch-Maccagnoni and Xavier Leroy) -+ -+- #12840: manual: update runtime tracing chapter for custom events (ex #12335) -+ (Lucas Pluvinage, Sadiq Jaffer and Olivier Nicole, review by Gabriel Scherer, -+ David Allsopp, Tim McGilchrist and Thomas Leonard) -+ -+- #13066, update OCAMLRUNPARAM documentation for the stack size parameter l -+ (Florian Angeletti, review by Nicolás Ojeda Bär, Tim McGilchrist, and -+ Miod Vallat) -+ -+- #13078: update Format tutorial on structural boxes to mention alignment -+ questions. -+ (Edwin Török, review by Florian Angeletti) -+ -+- #13092: document the existence of the `[@@poll error]` built-in attribute -+ (Florian Angeletti, review by Gabriel Scherer) -+ -+### Tools: -+ -+- #12340: testsuite: collect known issues with current -short-paths -+ implementation for existential types -+ (Florian Angeletti, Samuel Hym, review by Florian Angeletti and Thomas Refis) -+ -+- #12147: ocamllex: Allow carriage returns at the end of line directives. -+ (SeungCheol Jung, review by Nicolás Ojeda Bär) -+ -+- #12260: Fix invalid_argument on some external or module aliases in ocamlnat -+ (Fabian Hemmer, review by Vincent Laviron) -+ -+- #12185: New script language for ocamltest. -+ (Damien Doligez with Florian Angeletti, Sébastien Hinderer, Gabriel Scherer, -+ review by Sébastien Hinderer and Gabriel Scherer) -+ -+- #12371: ocamltest: fix recursive expansion of variables. -+ (Antonin Décimo, Damien Doligez, review by Sébastien Hinderer, -+ Damien Doligez, Gabriel Scherer, and Xavier Leroy) -+ -+* #12497, #12613: Make ocamlc/ocamlopt fail with an error when no -+ input files are specified to build an executable. -+ (Antonin Décimo, review by Sébastien Hinderer) -+ -+- #12576: ocamldep: various refactors. -+ (Antonin Décimo, review by Florian Angeletti, Gabriel Scherer, and Léo Andrès) -+ -+- #12615: ocamldoc: get rid of the odoc_literate and odoc_todo generators. -+ (Sébaistien Hinderer, review by Gabriel Scherer and Florian Angeletti) -+ -+- #12624: Use $XDG_CONFIG_DIRS in addition to $XDG_CONFIG_HOME when searching -+ for init.ml and use this to extend init.ml support to the toplevel when -+ running on Windows. -+ (David Allsopp, report by Jonah Beckford, review by Nicolás Ojeda Bär and -+ Antonin Décimo) -+ -+- #12688: Setting the env variable `NO_COLOR` with an empty value no longer -+ has effects. Previously, setting `NO_COLOR` with any value, including -+ the empty value, would disable colors (unless `OCAML_COLOR` is also set). -+ After this change, the user must set `NO_COLOR` with an non-empty value -+ to disable colors. This reflects a specification clarification/change -+ from the upstream website at https://no-color.org. -+ (Favonia, review by Gabriel Scherer) -+ -+- #12744: ocamltest: run tests in recursive subdirs more eagerly -+ (Nick Roberts, review by Nicolás Ojeda Bär) -+ -+- #12901, 12908: ocamllex: add overflow checks to prevent generating incorrect -+ lexers; use unsigned numbers in the table encoding when possible. -+ (Vincent Laviron, report by Edwin Török, review by Xavier Leroy) - - ### Internal/compiler-libs changes: - -+- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by -+ generating index tables of all identifier occurrences. This extra data in .cmt -+ files is only added when the new flag -bin-annot-occurrences is passed. -+ (Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas -+ Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis) -+ -+- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity -+ This changes function arity to be based solely on the source program's -+ parsetree. Previously, the heuristic for arity had more subtle heuristics -+ that involved type information about patterns. Function arity is important -+ because it determines when a pattern match's effects run and is an input -+ into the fast path for function application. -+ -+ This change affects tooling: it changes the function constructs in parsetree -+ and typedtree. -+ -+ See https://github.com/ocaml/RFCs/pull/32 for the original RFC. -+ -+ (Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer; -+ RFC by Stephen Dolan) -+ -+ - - #12639: parsing: Attach a location to the RHS of Ptyp_alias - and improve the 'alias type mismatch' error message. - (Jules Aguillon, review by Florian Angeletti) -@@ -583,21 +604,6 @@ OCaml 5.2.0 - in Typecore in favor of local mutable state. - (Nick Roberts, review by Takafumi Saikawa) - --- #12236, #12386, #12391, #12496, #12673: Use syntax as sole determiner of arity -- This changes function arity to be based solely on the source program's -- parsetree. Previously, the heuristic for arity had more subtle heuristics -- that involved type information about patterns. Function arity is important -- because it determines when a pattern match's effects run and is an input -- into the fast path for function application. -- -- This change affects tooling: it changes the function constructs in parsetree -- and typedtree. -- -- See https://github.com/ocaml/RFCs/pull/32 for the original RFC. -- -- (Nick Roberts; review by Richard Eisenberg, Leo White, and Gabriel Scherer; -- RFC by Stephen Dolan) -- - - #12542: Minor bugfix to #12236: restore dropped call to `instance` - (Nick Roberts, review by Jacques Garrigue) - -@@ -650,12 +656,6 @@ OCaml 5.2.0 - - #12764: Move all installable headers in `caml/` sub-directories. - (Antonin Décimo, review by Gabriel Scherer and David Allsopp) - --- #12508 : Add compiler-side support for project-wide occurrences in Merlin, by -- generating index tables of all identifier occurrences. This extra data in .cmt -- files is only added when the new flag -bin-annot-occurrences is passed. -- (Ulysse Gérard, Nathanaëlle Courant, suggestions by Gabriel Scherer and Thomas -- Refis, review by Florian Angeletti, Gabriel Scherer and Thomas Refis) -- - - #12914: Slightly change the s390x assembly dialect in order to build with - Clang's integrated assembler. - (Miod Vallat, review by Gabriel Scherer) -@@ -888,6 +888,10 @@ OCaml 5.2.0 - - #13094: Fix undefined behavior of left-shifting a negative number. - (Antonin Décimo, review by Miod Vallat and Nicolás Ojeda Bär) - -+- #13130: minor fixes to pprintast for raw identifiers and local module open -+ syntax for types. -+ (Chet Murthy, review by Gabriel Scherer) -+ - OCaml 5.1.1 (8 December 2023) - ---------------------------- - --- -2.44.0 - diff --git a/0004-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch similarity index 64% rename from 0004-configure-Allow-user-defined-C-compiler-flags.patch rename to 0002-configure-Allow-user-defined-C-compiler-flags.patch index 3c14867..9894bc3 100644 --- a/0004-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From edd903fc73b98eb784b307a47110985967cb1d09 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 4/7] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. --- configure.ac | 8 ++++++-- @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index 48aa9f0a29..fc29c88f50 100644 --- a/configure.ac +++ b/configure.ac -@@ -869,6 +869,10 @@ AS_CASE([$ocaml_cc_vendor], +@@ -925,6 +925,10 @@ AS_CASE([$ocaml_cc_vendor], internal_cflags="$cc_warnings"], [common_cflags="-O"]) @@ -22,7 +22,7 @@ index 48aa9f0a29..fc29c88f50 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. AS_CASE([$host], [i686-*-mingw32*], -@@ -2648,7 +2652,7 @@ AC_CONFIG_COMMANDS_PRE([ +@@ -2708,7 +2712,7 @@ AC_CONFIG_COMMANDS_PRE([ [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) mkdll_ldflags="" AS_IF([test -n "${LDFLAGS}"], @@ -31,15 +31,5 @@ index 48aa9f0a29..fc29c88f50 100644 mkdll_ldflags="${mkdll_ldflags} ${mkexe_ldflags_prefix}${flag}" done mkdll_ldflags_exp="$mkdll_ldflags"]) -@@ -2674,7 +2678,7 @@ ${mkdll_ldflags}" - ],[ - mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' - mkdll_ldflags_exp="${oc_dll_ldflags}" -- AS_IF([test -n ${LDFLAGS}], -+ AS_IF([test -n "${LDFLAGS}"], - [mkdll_ldflags_exp="$mkdll_ldflags_exp $LDFLAGS"]) - mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)" - mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}" -- 2.44.0 - diff --git a/0005-flambda-Improve-transitive-closure-in-invariant_para.patch b/0005-flambda-Improve-transitive-closure-in-invariant_para.patch deleted file mode 100644 index b0b347c..0000000 --- a/0005-flambda-Improve-transitive-closure-in-invariant_para.patch +++ /dev/null @@ -1,114 +0,0 @@ -From acdc441ff1acb5390467e649bc9a9bfddd7df774 Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Thu, 9 May 2024 10:03:23 +0200 -Subject: [PATCH 5/7] flambda: Improve transitive closure in - invariant_params_in_recursion (#13150) - -The old implementation did not really exploit the sparseness of the -graph because it used newly discovered edges in later iterations. -The new implementation processes each original relation only once -per starting node, and does not re-process newly discovered relations. - -(cherry picked from commit 787b4fbb5aaf3728de54ca240ba9ca0bf56ace60) ---- - Changes | 5 ++ - middle_end/flambda/invariant_params.ml | 66 ++++++++++---------------- - 2 files changed, 31 insertions(+), 40 deletions(-) - -diff --git a/Changes b/Changes -index 75842fc216..d26512067d 100644 ---- a/Changes -+++ b/Changes -@@ -1,6 +1,11 @@ - OCaml 5.2.0 (13 May 2024) - ------------------------- - -+- #13150: improve a transitive-closure computation algorithm in the flambda -+ middle-end to avoid a compilation time blowup on Menhir-generated code -+ (Florian Weimer, review by Gabriel Scherer and Pierre Chambart, -+ report by Richard Jones) -+ - (Changes that can break existing programs are marked with a "*") - - ### Restored and new backends: -diff --git a/middle_end/flambda/invariant_params.ml b/middle_end/flambda/invariant_params.ml -index 414d39310a..dba63970fd 100644 ---- a/middle_end/flambda/invariant_params.ml -+++ b/middle_end/flambda/invariant_params.ml -@@ -65,47 +65,33 @@ let implies relation from to_ = - relation - - let transitive_closure state = -- let union s1 s2 = -- match s1, s2 with -- | Top, _ | _, Top -> Top -- | Implication s1, Implication s2 -> -- Implication (Variable.Pair.Set.union s1 s2) -+ (* Depth-first search for all implications for one argument. -+ Arguments are moved from candidate to frontier, assuming -+ they are newly added to the result. *) -+ let rec loop candidate frontier result = -+ match (candidate, frontier) with -+ | ([], []) -> Implication result -+ | ([], frontier::fs) -> -+ (* Obtain fresh candidate for the frontier argument. *) -+ (match Variable.Pair.Map.find frontier state with -+ | exception Not_found -> loop [] fs result -+ | Top -> Top -+ | Implication candidate -> -+ loop (Variable.Pair.Set.elements candidate) fs result) -+ | (candidate::cs, frontier) -> -+ let result' = Variable.Pair.Set.add candidate result in -+ if result' != result then -+ (* Result change means candidate becomes part of frontier. *) -+ loop cs (candidate :: frontier) result' -+ else -+ loop cs frontier result - in -- let equal s1 s2 = -- match s1, s2 with -- | Top, Implication _ | Implication _, Top -> false -- | Top, Top -> true -- | Implication s1, Implication s2 -> Variable.Pair.Set.equal s1 s2 -- in -- let update arg state = -- let original_set = -- try Variable.Pair.Map.find arg state with -- | Not_found -> Implication Variable.Pair.Set.empty -- in -- match original_set with -- | Top -> state -- | Implication arguments -> -- let set = -- Variable.Pair.Set.fold -- (fun orig acc-> -- let set = -- try Variable.Pair.Map.find orig state with -- | Not_found -> Implication Variable.Pair.Set.empty in -- union set acc) -- arguments original_set -- in -- Variable.Pair.Map.add arg set state -- in -- let once state = -- Variable.Pair.Map.fold (fun arg _ state -> update arg state) state state -- in -- let rec fp state = -- let state' = once state in -- if Variable.Pair.Map.equal equal state state' -- then state -- else fp state' -- in -- fp state -+ Variable.Pair.Map.map -+ (fun set -> -+ match set with -+ | Top -> Top -+ | Implication set -> loop [] (Variable.Pair.Set.elements set) set) -+ state - - (* CR-soon pchambart: to move to Flambda_utils and document - mshinwell: I think this calculation is basically the same as --- -2.44.0 - diff --git a/0006-Reload-exception-pointer-register-in-caml_c_call.patch b/0006-Reload-exception-pointer-register-in-caml_c_call.patch deleted file mode 100644 index 4c20a85..0000000 --- a/0006-Reload-exception-pointer-register-in-caml_c_call.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 8637cac022907501c3c0d941e07e436b70c9d4ac Mon Sep 17 00:00:00 2001 -From: Miod Vallat <118974489+dustanddreams@users.noreply.github.com> -Date: Thu, 30 May 2024 09:57:41 +0000 -Subject: [PATCH 6/7] Reload exception pointer register in caml_c_call* - -The invoked code may end up causing caml_try_realloc_stack() to be invoked, -which in turn may replace the stack TRAP_PTR points to, leading to -either crashes with the debug runtime (thanks to the old stack contents -being overwritten) or all kinds of memory or control flow corruption otherwise. - -Added test for stack reallocation in callback followed by exception raising. - -(cherry picked from commit 6964d3a90f84402ed6066fb1821679435e063067) -(cherry picked from commit 1e8a91d305f1fa4668444fb1cce97952dbc39810) ---- - Changes | 9 +++++++++ - runtime/arm64.S | 6 ++++-- - runtime/power.S | 6 ++++-- - runtime/riscv.S | 6 ++++-- - runtime/s390x.S | 5 +++-- - testsuite/tests/callback/test1.ml | 5 +++++ - 6 files changed, 29 insertions(+), 8 deletions(-) - -diff --git a/Changes b/Changes -index d26512067d..53bb5369b9 100644 ---- a/Changes -+++ b/Changes -@@ -1,3 +1,12 @@ -+OCaml 5.2 maintenance version -+----------------------------- -+ -+- #13207: Be sure to reload the register caching the exception handler in -+ caml_c_call and caml_c_call_stack_args, as its value may have been changed -+ if the OCaml stack is expanded during a callback. -+ (Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and -+ Xavier Leroy) -+ - OCaml 5.2.0 (13 May 2024) - ------------------------- - -diff --git a/runtime/arm64.S b/runtime/arm64.S -index e71f25ebba..6c6495a0a8 100644 ---- a/runtime/arm64.S -+++ b/runtime/arm64.S -@@ -569,8 +569,9 @@ FUNCTION(caml_c_call) - str TRAP_PTR, Caml_state(exn_handler) - /* Call the function */ - blr ADDITIONAL_ARG -- /* Reload alloc ptr */ -+ /* Reload new allocation pointer & exn handler */ - ldr ALLOC_PTR, Caml_state(young_ptr) -+ ldr TRAP_PTR, Caml_state(exn_handler) - /* Load ocaml stack */ - SWITCH_C_TO_OCAML - #if defined(WITH_THREAD_SANITIZER) -@@ -625,8 +626,9 @@ FUNCTION(caml_c_call_stack_args) - blr ADDITIONAL_ARG - /* Restore stack */ - mov sp, x19 -- /* Reload alloc ptr */ -+ /* Reload new allocation pointer & exn handler */ - ldr ALLOC_PTR, Caml_state(young_ptr) -+ ldr TRAP_PTR, Caml_state(exn_handler) - /* Switch from C to OCaml */ - SWITCH_C_TO_OCAML - /* Return */ -diff --git a/runtime/power.S b/runtime/power.S -index bfb37fa989..257678100e 100644 ---- a/runtime/power.S -+++ b/runtime/power.S -@@ -445,8 +445,9 @@ FUNCTION caml_c_call - mr 2, C_CALL_TOC /* restore current TOC */ - /* Restore return address (in register C_CALL_RET_ADDR, preserved by C) */ - mtlr C_CALL_RET_ADDR -- /* Reload allocation pointer*/ -+ /* Reload new allocation pointer and exception pointer */ - ld ALLOC_PTR, Caml_state(young_ptr) -+ ld TRAP_PTR, Caml_state(exn_handler) - #if defined(WITH_THREAD_SANITIZER) - TSAN_SETUP_C_CALL 16 - /* Save return value registers. Since the called function could be anything, -@@ -497,8 +498,9 @@ FUNCTION caml_c_call_stack_args - add SP, SP, STACK_ARG_BYTES - /* Restore return address (in register C_CALL_RET_ADDR, preserved by C) */ - mtlr C_CALL_RET_ADDR -- /* Reload allocation pointer*/ -+ /* Reload new allocation pointer and exception pointer */ - ld ALLOC_PTR, Caml_state(young_ptr) -+ ld TRAP_PTR, Caml_state(exn_handler) - /* Switch from C to OCaml */ - SWITCH_C_TO_OCAML - /* Return to caller */ -diff --git a/runtime/riscv.S b/runtime/riscv.S -index a2eca7a315..8934db0bb3 100644 ---- a/runtime/riscv.S -+++ b/runtime/riscv.S -@@ -516,8 +516,9 @@ L(caml_c_call): - sd TRAP_PTR, Caml_state(exn_handler) - /* Call the function */ - jalr ADDITIONAL_ARG -- /* Reload alloc ptr */ -+ /* Reload new allocation pointer & exn handler */ - ld ALLOC_PTR, Caml_state(young_ptr) -+ ld TRAP_PTR, Caml_state(exn_handler) - /* Load ocaml stack */ - SWITCH_C_TO_OCAML - #if defined(WITH_THREAD_SANITIZER) -@@ -575,8 +576,9 @@ FUNCTION(caml_c_call_stack_args) - jalr ADDITIONAL_ARG - /* Restore stack */ - mv sp, s2 -- /* Reload alloc ptr */ -+ /* Reload new allocation pointer & exn handler */ - ld ALLOC_PTR, Caml_state(young_ptr) -+ ld TRAP_PTR, Caml_state(exn_handler) - /* Switch from C to OCaml */ - SWITCH_C_TO_OCAML - /* Return */ -diff --git a/runtime/s390x.S b/runtime/s390x.S -index b59822ce57..113831a376 100644 ---- a/runtime/s390x.S -+++ b/runtime/s390x.S -@@ -515,7 +515,7 @@ LBL(caml_c_call): - #endif - basr %r14, ADDITIONAL_ARG - CLEANUP_AFTER_C_CALL -- /* Reload alloc ptr */ -+ /* Reload new allocation pointer & exn handler */ - lg ALLOC_PTR, Caml_state(young_ptr) - lg TRAP_PTR, Caml_state(exn_handler) - /* Load ocaml stack and restore global variables */ -@@ -584,8 +584,9 @@ LBL(106): - CLEANUP_AFTER_C_CALL - /* Restore stack */ - lgr %r15, %r12 -- /* Reload alloc ptr */ -+ /* Reload new allocation pointer & exn handler */ - lg ALLOC_PTR, Caml_state(young_ptr) -+ lg TRAP_PTR, Caml_state(exn_handler) - /* Switch from C to OCaml */ - SWITCH_C_TO_OCAML - /* Return */ -diff --git a/testsuite/tests/callback/test1.ml b/testsuite/tests/callback/test1.ml -index c39be0c586..f6ad4356cf 100644 ---- a/testsuite/tests/callback/test1.ml -+++ b/testsuite/tests/callback/test1.ml -@@ -11,6 +11,9 @@ external mycallback3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd - external mycallback4 : - ('a -> 'b -> 'c -> 'd -> 'e) -> 'a -> 'b -> 'c -> 'd -> 'e = "mycallback4" - -+let rec growstack n = -+ if n <= 0 then 0 else 1 + growstack (n - 1) -+ - let rec tak (x, y, z as _tuple) = - if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y)) - else z -@@ -46,3 +49,5 @@ let _ = - print_int(trapexit ()); print_newline(); - print_string(tripwire mypushroot); print_newline(); - print_string(tripwire mycamlparam); print_newline(); -+ begin try ignore (mycallback1 growstack 1_000); raise Exit -+ with Exit -> () end --- -2.44.0 - diff --git a/0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch b/0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch deleted file mode 100644 index e9dd879..0000000 --- a/0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 4eb80b13779125fcd76a445ab0004ca064fab634 Mon Sep 17 00:00:00 2001 -From: Miod Vallat -Date: Fri, 7 Jun 2024 06:19:45 +0000 -Subject: [PATCH 7/7] Compute more accurate instruction sizes for branch - relaxation. - -(cherry picked from commit 114ddae2d4c85391a4f939dc6623424ae35a07aa) ---- - Changes | 4 ++ - asmcomp/power/emit.mlp | 87 ++++++++++++++++++++++++------------------ - 2 files changed, 53 insertions(+), 38 deletions(-) - -diff --git a/Changes b/Changes -index 53bb5369b9..1a81509247 100644 ---- a/Changes -+++ b/Changes -@@ -7,6 +7,10 @@ OCaml 5.2 maintenance version - (Miod Vallat, report by Vesa Karvonen, review by Gabriel Scherer and - Xavier Leroy) - -+- #13221: Compute more accurate instruction sizes for branch relocation on -+ POWER. -+ (Miod Vallat, review by Gabriel Scherer) -+ - OCaml 5.2.0 (13 May 2024) - ------------------------- - -diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp -index 47f5419a92..fdf22996fa 100644 ---- a/asmcomp/power/emit.mlp -+++ b/asmcomp/power/emit.mlp -@@ -177,6 +177,28 @@ let emit_tocload emit_dest dest entry = - - (* Output a load or store operation *) - -+let load_mnemonic = function -+ | Byte_unsigned -> "lbz" -+ | Byte_signed -> "lbz" -+ | Sixteen_unsigned -> "lhz" -+ | Sixteen_signed -> "lha" -+ | Thirtytwo_unsigned -> "lwz" -+ | Thirtytwo_signed -> "lwa" -+ | Word_int | Word_val -> "ld" -+ | Single -> "lfs" -+ | Double -> "lfd" -+ -+let store_mnemonic = function -+ | Byte_unsigned | Byte_signed -> "stb" -+ | Sixteen_unsigned | Sixteen_signed -> "sth" -+ | Thirtytwo_unsigned | Thirtytwo_signed -> "stw" -+ | Word_int | Word_val -> "std" -+ | Single -> "stfs" -+ | Double -> "stfd" -+ -+let store_needs_lwsync chunk assignment = -+ assignment && (chunk = Word_int || chunk = Word_val) -+ - let valid_offset instr ofs = - ofs land 3 = 0 || (instr <> "ld" && instr <> "std" && instr <> "lwa") - -@@ -383,11 +405,17 @@ module BR = Branch_relaxation.Make (struct - - let tocload_size = 2 - -- let load_store_size = function -+ let load_store_size instr = function - | Ibased(_s, d) -> -- let (_lo, hi) = low_high_s d in -- tocload_size + (if hi = 0 then 1 else 2) -- | Iindexed ofs -> if is_immediate ofs then 1 else 3 -+ let (lo, hi) = low_high_s d in -+ tocload_size + -+ (if hi <> 0 then 1 else 0) + -+ (if valid_offset instr lo then 1 else 2) -+ | Iindexed ofs -> -+ if is_immediate ofs && valid_offset instr ofs then 1 else begin -+ let (lo, _hi) = low_high_u ofs in -+ if lo <> 0 then 3 else 2 -+ end - | Iindexed2 -> 1 - - let instr_size f = function -@@ -415,16 +443,16 @@ module BR = Branch_relaxation.Make (struct - else if alloc then tocload_size + 2 - else 5 - | Lop(Istackoffset _) -> 1 -- | Lop(Iload {memory_chunk; addressing_mode; _ }) -> -- if memory_chunk = Byte_signed -- then load_store_size addressing_mode + 1 -- else load_store_size addressing_mode -+ | Lop(Iload {memory_chunk; addressing_mode; is_atomic }) -> -+ let loadinstr = load_mnemonic memory_chunk in -+ (if is_atomic then 4 else 0) + -+ (if memory_chunk = Byte_signed then 1 else 0) + -+ load_store_size loadinstr addressing_mode - | Lop(Istore(chunk, addr, assignment)) -> -- (match chunk with -- | Single -> 1 -- | Word_int | Word_val when assignment -> 1 -- | _ -> 0) -- + load_store_size addr -+ let storeinstr = store_mnemonic chunk in -+ (if chunk = Single then 1 else 0) + -+ (if store_needs_lwsync chunk assignment then 1 else 0) + -+ load_store_size storeinstr addr - | Lop(Ialloc _) -> 5 - | Lop(Ispecific(Ialloc_far _)) -> 6 - | Lop(Ipoll { return_label = Some(_) }) -> 5 -@@ -442,12 +470,12 @@ module BR = Branch_relaxation.Make (struct - | Lop(Ispecific(Icheckbound_imm_far _)) -> 3 - | Lop(Iintop_imm _) -> 1 - | Lop(Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf) -> 1 -- | Lop(Ifloatofint) -> 9 -- | Lop(Iintoffloat) -> 4 -+ | Lop(Ifloatofint) -> 3 -+ | Lop(Iintoffloat) -> 3 - | Lop(Iopaque) -> 0 - | Lop(Ispecific _) -> 1 -- | Lop (Idls_get) -> 1 -- | Lop (Ireturn_addr) -> 1 -+ | Lop(Idls_get) -> 1 -+ | Lop(Ireturn_addr) -> 1 - | Lreloadretaddr -> 2 - | Lreturn -> 2 - | Llabel _ -> 0 -@@ -457,7 +485,7 @@ module BR = Branch_relaxation.Make (struct - 1 + (if lbl0 = None then 0 else 1) - + (if lbl1 = None then 0 else 1) - + (if lbl2 = None then 0 else 1) -- | Lswitch _ -> 5 + tocload_size -+ | Lswitch _ -> 7 + tocload_size - | Lentertrap -> 1 - | Ladjust_trap_depth _ -> 0 - | Lpushtrap _ -> 4 + tocload_size -@@ -705,17 +733,7 @@ let emit_instr env i = - ` addi 1, 1, {emit_int (-n)}\n`; - adjust_stack_offset env n - | Lop(Iload { memory_chunk; addressing_mode; is_atomic }) -> -- let loadinstr = -- match memory_chunk with -- | Byte_unsigned -> "lbz" -- | Byte_signed -> "lbz" -- | Sixteen_unsigned -> "lhz" -- | Sixteen_signed -> "lha" -- | Thirtytwo_unsigned -> "lwz" -- | Thirtytwo_signed -> "lwa" -- | Word_int | Word_val -> "ld" -- | Single -> "lfs" -- | Double -> "lfd" in -+ let loadinstr = load_mnemonic memory_chunk in - if is_atomic then - ` sync\n`; - emit_load_store loadinstr addressing_mode i.arg 0 i.res.(0); -@@ -731,19 +749,12 @@ let emit_instr env i = - ` frsp {emit_reg tmp}, {emit_reg i.arg.(0)}\n`; - emit_load_store "stfs" addr i.arg 1 tmp - | Lop(Istore(chunk, addr, assignment)) -> -- let storeinstr = -- match chunk with -- | Byte_unsigned | Byte_signed -> "stb" -- | Sixteen_unsigned | Sixteen_signed -> "sth" -- | Thirtytwo_unsigned | Thirtytwo_signed -> "stw" -- | Word_int | Word_val -> "std" -- | Single -> assert false -- | Double -> "stfd" in -+ let storeinstr = store_mnemonic chunk in - (* Non-initializing stores need a memory barrier to follow the - Multicore OCaml memory model. Stores of size other than - Word_int and Word_val do not follow the memory model and therefore - do not need a barrier *) -- if assignment && (chunk = Word_int || chunk = Word_val) then -+ if store_needs_lwsync chunk assignment then - ` lwsync\n`; - emit_load_store storeinstr addr i.arg 1 i.arg.(0) - | Lop(Ialloc { bytes; dbginfo }) -> --- -2.44.0 - diff --git a/ocaml.spec b/ocaml.spec index c4b4035..c5c0c05 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -5,7 +5,7 @@ # primitive function declarations, all with "void" for their parameter # list. This does not match the real definitions, leading to lots of # -Wlto-type-mismatch warnings. These change the output of the tests, -# leading to many failed tests. This is still a problem in 5.2. +# leading to many failed tests. This is still a problem in 5.3. %global _lto_cflags %{nil} # OCaml has a bytecode backend that works on anything with a C @@ -45,8 +45,8 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.2.0 -Release: 3%{?dist} +Version: 5.3.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -74,30 +74,12 @@ Source2: ocaml_files.py # existing patches unchanged) adding a comment to note that it should # be incorporated into the git repo at a later time. -# Upstream after 5.2.0: -Patch: 0001-Changes-synchronisation-and-consistency-with-trunk.patch -Patch: 0002-Changes-copy-editing.patch - # Fedora-specific patches -Patch: 0003-Don-t-add-rpaths-to-libraries.patch -Patch: 0004-configure-Allow-user-defined-C-compiler-flags.patch - -# Improve performance of flambda optimizer in some cases. Required to -# compiler blow-up in coccinelle package. Upstream, but not included -# in 5.2 branch. -# https://github.com/ocaml/ocaml/pull/13150 -Patch: 0005-flambda-Improve-transitive-closure-in-invariant_para.patch - -# Upstream after 5.2.0: -Patch: 0006-Reload-exception-pointer-register-in-caml_c_call.patch - -# Fix for ppc64le code generation issue found after 5.2.0 was released. -# https://github.com/ocaml/ocaml/issues/13220 -# https://github.com/ocaml/ocaml/commit/114ddae2d4c85391a4f939dc6623424ae35a07aa -Patch: 0007-Compute-more-accurate-instruction-sizes-for-branch-r.patch +Patch: 0001-Don-t-add-rpaths-to-libraries.patch +Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch BuildRequires: make -BuildRequires: git +BuildRequires: git-core BuildRequires: gcc BuildRequires: autoconf BuildRequires: gawk @@ -135,13 +117,12 @@ Provides: bundled(md5-plumb) Provides: ocaml(compiler) = %{version} %if %{native_compiler} -%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' +%global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' -i Dynlink_cmo_format -i Dynlink_cmxs_format %else %global __ocaml_requires_opts -c -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' -i Backend_intf -i Inlining_decision_intf -i Simplify_boxed_integer_ops_intf %endif %global __ocaml_provides_opts -f '%{buildroot}%{_bindir}/ocamlrun %{buildroot}%{_bindir}/ocamlobjinfo.byte' - %description OCaml is a high-level, strongly-typed, functional and object-oriented programming language from the ML family of languages. @@ -482,6 +463,11 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Jan 9 2025 Jerry James - 5.3.0-1 +- New upstream version 5.3.0 +- Drop upstreamed patches +- BR git-core instead of git + * Thu Jul 18 2024 Fedora Release Engineering - 5.2.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index c8a1b16..eb6f2b4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.2.0.tar.gz) = 78115690186c13c1f2480e4812a9fe34cce2c28bf8a89d5c9810bca0391f930cecd9cee2b53daca8a32da1815628b33be68f3948f1ad03fa50b72b14e3ea84f2 +SHA512 (ocaml-5.3.0.tar.gz) = 73817ada340bdf4091b3edd7b292bd0074c87b4836f202f48ecf0f620a00feaa70ebc9101b97155e8caa6907646dfdf21eff728fa0e14542df3b5e5436229d06 From 9d17af02a537cd24d13ba9241cbf05f98c0c75f6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 20:40:47 +0000 Subject: [PATCH 41/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index c5c0c05..f5bfcc2 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -46,7 +46,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.3.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -463,6 +463,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 5.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Jan 9 2025 Jerry James - 5.3.0-1 - New upstream version 5.3.0 - Drop upstreamed patches From 5b0d3a3f5da9b30d345541737d8f4f626e1b11cb Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 22 Jun 2025 15:52:30 -0400 Subject: [PATCH 42/54] Fix RPM macros for Python 3.14 A change to argparse in 3.14 is leading it to misinterpret the '%' in '%files' as an operator. Escaping it makes it compatible with both 3.14 and earlier versions. --- ocaml.spec | 5 ++++- ocaml_files.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index f5bfcc2..3d444bd 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -46,7 +46,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.3.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OCaml compiler and programming environment @@ -463,6 +463,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Sun Jun 22 2025 Yaakov Selkowitz - 5.3.0-3 +- Fix RPM macros for Python 3.14 + * Fri Jan 17 2025 Fedora Release Engineering - 5.3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/ocaml_files.py b/ocaml_files.py index cf4afd1..0e4658e 100644 --- a/ocaml_files.py +++ b/ocaml_files.py @@ -429,7 +429,7 @@ if __name__ == "__main__": parser.add_argument('-i', '--install', action='store_true', default=False, - help='install files instead of generating %files') + help='install files instead of generating %%files') parser.add_argument('-n', '--no-devel', action='store_true', default=False, From b9c837a4530b0d20fa88ba22e315745e00a7322a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 23:06:40 +0000 Subject: [PATCH 43/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 3d444bd..8732a1b 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -46,7 +46,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.3.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -463,6 +463,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 5.3.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sun Jun 22 2025 Yaakov Selkowitz - 5.3.0-3 - Fix RPM macros for Python 3.14 From bc284a4d37653ed2dadb8885abdb85655306ccda Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Oct 2025 11:02:01 +0100 Subject: [PATCH 44/54] New upstream version 5.4.0 (RHBZ#2368289) --- 0001-Don-t-add-rpaths-to-libraries.patch | 8 ++++---- ...-Allow-user-defined-C-compiler-flags.patch | 19 ++++++++++--------- ocaml.spec | 7 +++++-- sources | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index b5735bd..eb7b77e 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,4 +1,4 @@ -From 507a1382cb82160c2a6cfc0ea5bcb3e33ece7307 Mon Sep 17 00:00:00 2001 +From c8e378e67fc8fbd9ef177794d4ed831d5528bd0b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 Subject: [PATCH 1/2] Don't add rpaths to libraries. @@ -8,10 +8,10 @@ Subject: [PATCH 1/2] Don't add rpaths to libraries. 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 0c9d63859a..48aa9f0a29 100644 +index 0535f404b0..085fba6626 100644 --- a/configure.ac +++ b/configure.ac -@@ -1221,8 +1221,6 @@ AS_IF([test x"$enable_shared" != "xno"], +@@ -1422,8 +1422,6 @@ AS_IF([test x"$enable_shared" != "xno"], [[*-*-openbsd7.[3-9]|*-*-openbsd[89].*]], [mkdll_flags="${mkdll_flags} -Wl,--no-execute-only"]) oc_ldflags="$oc_ldflags -Wl,-E" @@ -21,5 +21,5 @@ index 0c9d63859a..48aa9f0a29 100644 supports_shared_libraries=true], [mkdll='shared-libs-not-available']) -- -2.44.0 +2.50.1 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index 9894bc3..df04691 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,17 +1,17 @@ -From edd903fc73b98eb784b307a47110985967cb1d09 Mon Sep 17 00:00:00 2001 +From 8323a13546c138266c609be8aa12841982d3a125 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. --- - configure.ac | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) + configure.ac | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 48aa9f0a29..fc29c88f50 100644 +index 085fba6626..353e10c4fc 100644 --- a/configure.ac +++ b/configure.ac -@@ -925,6 +925,10 @@ AS_CASE([$ocaml_cc_vendor], +@@ -997,6 +997,10 @@ AS_CASE([$ocaml_cc_vendor], internal_cflags="$cc_warnings"], [common_cflags="-O"]) @@ -20,9 +20,9 @@ index 48aa9f0a29..fc29c88f50 100644 +cclibs="$cclibs $LDFLAGS" + # Enable SSE2 on x86 mingw to avoid using 80-bit registers. - AS_CASE([$host], - [i686-*-mingw32*], -@@ -2708,7 +2712,7 @@ AC_CONFIG_COMMANDS_PRE([ + AS_CASE([$target], + [i686-w64-mingw32*], +@@ -2847,7 +2851,7 @@ AC_CONFIG_COMMANDS_PRE([ [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) mkdll_ldflags="" AS_IF([test -n "${LDFLAGS}"], @@ -32,4 +32,5 @@ index 48aa9f0a29..fc29c88f50 100644 done mkdll_ldflags_exp="$mkdll_ldflags"]) -- -2.44.0 +2.50.1 + diff --git a/ocaml.spec b/ocaml.spec index 8732a1b..f31d5d3 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -45,8 +45,8 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.3.0 -Release: 4%{?dist} +Version: 5.4.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -463,6 +463,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Mon Oct 13 2025 Richard W.M. Jones - 5.4.0-1 +- New upstream version 5.4.0 (RHBZ#2368289) + * Thu Jul 24 2025 Fedora Release Engineering - 5.3.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index eb6f2b4..3f99d7d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.3.0.tar.gz) = 73817ada340bdf4091b3edd7b292bd0074c87b4836f202f48ecf0f620a00feaa70ebc9101b97155e8caa6907646dfdf21eff728fa0e14542df3b5e5436229d06 +SHA512 (ocaml-5.4.0.tar.gz) = 3684468800f4528c9fd96ef3fdd6aa04f71b77180d3ae8045d429f96b32e23cb3a8a307762c7237b6c56c087f45b59b0dab672a31166e3de254bb0fb9b4eb588 From ebbc5125daaae76311284c2c54fe55886c39e0f4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Oct 2025 11:17:54 +0100 Subject: [PATCH 45/54] Fix branch name in comment --- ocaml.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index f31d5d3..194bdcd 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -68,7 +68,7 @@ Source2: ocaml_files.py # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-41-5.2.0 +# Current branch: fedora-44-5.4.0 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should From aa50731ee38984c1d004c613e9552f79d05fceb7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 16 Jan 2026 22:24:41 +0000 Subject: [PATCH 46/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 194bdcd..a6bbf74 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -46,7 +46,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -463,6 +463,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Fri Jan 16 2026 Fedora Release Engineering - 5.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Mon Oct 13 2025 Richard W.M. Jones - 5.4.0-1 - New upstream version 5.4.0 (RHBZ#2368289) From c129230259bf77640aa6604ac7894aa6e5a32a5c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 18 Feb 2026 17:51:10 +0000 Subject: [PATCH 47/54] Move bundle to the -runtime subpackage Suggested-by: Jerry James --- ocaml.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ocaml.spec b/ocaml.spec index a6bbf74..b8e9c65 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -111,9 +111,6 @@ Requires: ocaml-runtime%{?_isa} = %{version}-%{release} BuildRequires: ocaml-srpm-macros >= 10 Requires: ocaml-srpm-macros >= 10 -# Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c -Provides: bundled(md5-plumb) - Provides: ocaml(compiler) = %{version} %if %{native_compiler} @@ -142,6 +139,9 @@ Summary: OCaml runtime environment Requires: util-linux Provides: ocaml(runtime) = %{version} +# Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c +Provides: bundled(md5-plumb) + %description runtime OCaml is a high-level, strongly-typed, functional and object-oriented programming language from the ML family of languages. From ee9df08052efbfbe77f0c08c8ba2f2b061251cdb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 18 Feb 2026 17:52:32 +0000 Subject: [PATCH 48/54] Replace x86_64 with %{x86_64} On Rawhide this macro expands to: x86_64 x86_64_v2 x86_64_v3 x86_64_v4 amd64 em64t Suggested-by: Jerry James --- ocaml.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index b8e9c65..69ece26 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -259,7 +259,7 @@ sed -i '/^EXTRACAMLFLAGS=/aLINKOPTS=-cclib -lm' otherlibs/unix/Makefile --disable-native-compiler \ --disable-native-toplevel \ %endif -%ifarch x86_64 +%ifarch %{x86_64} %if 0%{?_include_frame_pointers} --enable-frame-pointers \ %endif From 360b98ce787a783a5085772b4392e8b46faf93fd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 18 Feb 2026 17:53:18 +0000 Subject: [PATCH 49/54] Enable frame pointers on aarch64 Suggested-by: Jerry James --- ocaml.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 69ece26..2876a52 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -259,7 +259,7 @@ sed -i '/^EXTRACAMLFLAGS=/aLINKOPTS=-cclib -lm' otherlibs/unix/Makefile --disable-native-compiler \ --disable-native-toplevel \ %endif -%ifarch %{x86_64} +%ifarch %{x86_64} %{arm64} %if 0%{?_include_frame_pointers} --enable-frame-pointers \ %endif From e3af15bd1127528f83a7db55a5b7396499b58d1b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 20 Feb 2026 11:20:03 +0000 Subject: [PATCH 50/54] New upstream version 5.4.0 (RHBZ#2440356) --- 0001-Don-t-add-rpaths-to-libraries.patch | 6 +++--- 0002-configure-Allow-user-defined-C-compiler-flags.patch | 8 ++++---- ocaml.spec | 9 ++++++--- sources | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index eb7b77e..6bf857a 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,4 +1,4 @@ -From c8e378e67fc8fbd9ef177794d4ed831d5528bd0b Mon Sep 17 00:00:00 2001 +From 04e523e937625bf30d775681c11e00f6dc6fc00a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 Subject: [PATCH 1/2] Don't add rpaths to libraries. @@ -8,7 +8,7 @@ Subject: [PATCH 1/2] Don't add rpaths to libraries. 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 0535f404b0..085fba6626 100644 +index 3754ad8a39..fb60c7c14c 100644 --- a/configure.ac +++ b/configure.ac @@ -1422,8 +1422,6 @@ AS_IF([test x"$enable_shared" != "xno"], @@ -21,5 +21,5 @@ index 0535f404b0..085fba6626 100644 supports_shared_libraries=true], [mkdll='shared-libs-not-available']) -- -2.50.1 +2.52.0 diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index df04691..eddb8f3 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,4 +1,4 @@ -From 8323a13546c138266c609be8aa12841982d3a125 Mon Sep 17 00:00:00 2001 +From ef549c9a97838331877b139f407269db2a0fc691 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. @@ -8,7 +8,7 @@ Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 085fba6626..353e10c4fc 100644 +index fb60c7c14c..f6a493ccf5 100644 --- a/configure.ac +++ b/configure.ac @@ -997,6 +997,10 @@ AS_CASE([$ocaml_cc_vendor], @@ -22,7 +22,7 @@ index 085fba6626..353e10c4fc 100644 # Enable SSE2 on x86 mingw to avoid using 80-bit registers. AS_CASE([$target], [i686-w64-mingw32*], -@@ -2847,7 +2851,7 @@ AC_CONFIG_COMMANDS_PRE([ +@@ -2904,7 +2908,7 @@ AC_CONFIG_COMMANDS_PRE([ [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) mkdll_ldflags="" AS_IF([test -n "${LDFLAGS}"], @@ -32,5 +32,5 @@ index 085fba6626..353e10c4fc 100644 done mkdll_ldflags_exp="$mkdll_ldflags"]) -- -2.50.1 +2.52.0 diff --git a/ocaml.spec b/ocaml.spec index 2876a52..698904a 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -45,8 +45,8 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.4.0 -Release: 2%{?dist} +Version: 5.4.1 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -68,7 +68,7 @@ Source2: ocaml_files.py # # https://pagure.io/fedora-ocaml # -# Current branch: fedora-44-5.4.0 +# Current branch: fedora-45-5.4.1 # # ALTERNATIVELY add a patch to the end of the list (leaving the # existing patches unchanged) adding a comment to note that it should @@ -463,6 +463,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Fri Feb 20 2026 Richard W.M. Jones - 5.4.1-1 +- New upstream version 5.4.0 (RHBZ#2440356) + * Fri Jan 16 2026 Fedora Release Engineering - 5.4.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild diff --git a/sources b/sources index 3f99d7d..d5a609d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.4.0.tar.gz) = 3684468800f4528c9fd96ef3fdd6aa04f71b77180d3ae8045d429f96b32e23cb3a8a307762c7237b6c56c087f45b59b0dab672a31166e3de254bb0fb9b4eb588 +SHA512 (ocaml-5.4.1.tar.gz) = c44bc429bee4a263b107e60a4ab3b0c9c082ba2d784f63704130551676ce5624061ae1aa280688e3222d9a522555b3cb749eef784ab2145d71c0f19cac773383 From 2e0cb1fe4445b6382103f439cfa421288bae31d6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 26 Feb 2026 12:56:55 +0000 Subject: [PATCH 51/54] Fix version in changelog - current version is 5.4.1, not 5.4.0 Fixes: commit e3af15bd1127528f83a7db55a5b7396499b58d1b --- ocaml.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index 698904a..2f5430c 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -464,7 +464,7 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog * Fri Feb 20 2026 Richard W.M. Jones - 5.4.1-1 -- New upstream version 5.4.0 (RHBZ#2440356) +- New upstream version 5.4.1 (RHBZ#2440356) * Fri Jan 16 2026 Fedora Release Engineering - 5.4.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 5a8dd543c6916f24f103be6ace06d70a205c92bb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 26 Feb 2026 12:59:34 +0000 Subject: [PATCH 52/54] Backport fix for arm64 frame pointers --- 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 2 +- ...st-14589-from-xavierleroy-arm64-addi.patch | 207 ++++++++++++++++++ ocaml.spec | 11 +- 4 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 6bf857a..03c90a8 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 04e523e937625bf30d775681c11e00f6dc6fc00a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/2] Don't add rpaths to libraries. +Subject: [PATCH 1/3] Don't add rpaths to libraries. --- configure.ac | 2 -- diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index eddb8f3..6a6b5f7 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From ef549c9a97838331877b139f407269db2a0fc691 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. --- configure.ac | 6 +++++- diff --git a/0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch b/0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch new file mode 100644 index 0000000..887ddcd --- /dev/null +++ b/0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch @@ -0,0 +1,207 @@ +From c2923703d02c6389b6c4594541569bf628e706b1 Mon Sep 17 00:00:00 2001 +From: Xavier Leroy +Date: Thu, 26 Feb 2026 13:43:07 +0100 +Subject: [PATCH 3/3] Merge pull request #14589 from xavierleroy/arm64-addimm + +Fix arm64 additions with large immediates + +(cherry picked from commit 4fafb9669b9a5c898b2dda0ae851b2a0e6429c43) +(cherry picked from commit 6cda6d8a928ada5dd0f58de229d3cb193cfdff53) +--- + Changes | 6 +++ + asmcomp/arm64/emit.mlp | 84 ++++++++++++++++++++---------------------- + 2 files changed, 45 insertions(+), 45 deletions(-) + +diff --git a/Changes b/Changes +index be999a8cc4..4ad8737bb0 100644 +--- a/Changes ++++ b/Changes +@@ -1,3 +1,9 @@ ++### Bug fixes: ++ ++- #14574, #14577, #14589: Fix wrong assembly code generated for ARM64 ++ with frame pointer support. ++ (Xavier Leroy, review by Vincent Laviron, report by Richard Jones) ++ + OCaml 5.4.1 (17 February 2026) + ------------------------------ + +diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp +index c821310638..3f64eebc05 100644 +--- a/asmcomp/arm64/emit.mlp ++++ b/asmcomp/arm64/emit.mlp +@@ -54,9 +54,11 @@ let emit_label_type lbl ty = + + (* Output a pseudo-register *) + +-let emit_reg = function +- {loc = Reg r} -> emit_string (register_name r) +- | _ -> fatal_error "Emit.emit_reg" ++let reg_name = function ++ | {loc = Reg r} -> register_name r ++ | _ -> fatal_error "Emit.reg_name" ++ ++let emit_reg l = emit_string (reg_name l) + + (* Likewise, but with the 32-bit name of the register *) + +@@ -249,16 +251,28 @@ let is_immediate_float bits = + let mant = Int64.logand bits 0xF_FFFF_FFFF_FFFFL in + exp >= -3 && exp <= 4 && Int64.logand mant 0xF_0000_0000_0000L = mant + ++(* Set [rd] to [rs + n]. *) ++ ++let emit_addimm_gen rd rs n = ++ let insn = if n >= 0 then "add" else "sub" in ++ let n = abs n in ++ if n <= 0xFFF then ++ ` {emit_string insn} {emit_string rd}, {emit_string rs}, #{emit_int n}\n` ++ else begin ++ assert (n <= 0xFFF_FFF); ++ let nl = n land 0xFFF and nh = n land 0xFFF_000 in ++ ` {emit_string insn} {emit_string rd}, {emit_string rs}, #{emit_int nh}\n`; ++ if nl <> 0 then ++ ` {emit_string insn} {emit_string rd}, {emit_string rd}, #{emit_int nl}\n` ++ end ++ + (* Adjust sp (up or down) by the given byte amount *) + + let emit_stack_adjustment n = +- let instr = if n < 0 then "sub" else "add" in +- let m = abs n in +- assert (m < 0x1_000_000); +- let ml = m land 0xFFF and mh = m land 0xFFF_000 in +- if mh <> 0 then ` {emit_string instr} sp, sp, #{emit_int mh}\n`; +- if ml <> 0 then ` {emit_string instr} sp, sp, #{emit_int ml}\n`; +- if n <> 0 then cfi_adjust_cfa_offset (-n) ++ if n <> 0 then begin ++ emit_addimm_gen "sp" "sp" n; ++ cfi_adjust_cfa_offset (-n) ++ end + + (* Deallocate the stack frame and reload the return address + before a return or tail call *) +@@ -278,29 +292,11 @@ let output_epilogue env f = + + (* Output add-immediate / sub-immediate / cmp-immediate instructions *) + +-let rec emit_addimm rd rs n = +- if n < 0 then emit_subimm rd rs (-n) +- else if n <= 0xFFF then +- ` add {emit_reg rd}, {emit_reg rs}, #{emit_int n}\n` +- else begin +- assert (n <= 0xFFF_FFF); +- let nl = n land 0xFFF and nh = n land 0xFFF_000 in +- ` add {emit_reg rd}, {emit_reg rs}, #{emit_int nh}\n`; +- if nl <> 0 then +- ` add {emit_reg rd}, {emit_reg rd}, #{emit_int nl}\n` +- end ++let emit_addimm rd rs n = ++ emit_addimm_gen (reg_name rd) (reg_name rs) n + +-and emit_subimm rd rs n = +- if n < 0 then emit_addimm rd rs (-n) +- else if n <= 0xFFF then +- ` sub {emit_reg rd}, {emit_reg rs}, #{emit_int n}\n` +- else begin +- assert (n <= 0xFFF_FFF); +- let nl = n land 0xFFF and nh = n land 0xFFF_000 in +- ` sub {emit_reg rd}, {emit_reg rs}, #{emit_int nh}\n`; +- if nl <> 0 then +- ` sub {emit_reg rd}, {emit_reg rd}, #{emit_int nl}\n` +- end ++let emit_subimm rd rs n = ++ emit_addimm rd rs (-n) + + let emit_cmpimm rs n = + if n >= 0 +@@ -440,9 +436,7 @@ module Size = struct + let addsub_size n = + let m = abs n in + assert (m < 0x1_000_000); +- let ml = m land 0xFFF and mh = m land 0xFFF_000 in +- max 1 ((if mh <> 0 then 1 else 0) + +- (if ml <> 0 then 1 else 0)) ++ if m <= 0xFFF then 1 else if m land 0xFFF = 0 then 1 else 2 + + let stack_adj_size n = + (* see emit_stack_adjustment *) +@@ -451,7 +445,9 @@ module Size = struct + let prologue_size f = + let stk = initial_stack_offset f in + (if stk > 0 then stack_adj_size (-stk) else 0) +- + (if f.fun_frame_required then (if fp then 2 else 1) else 0) ++ + (if f.fun_frame_required ++ then if fp then 1 + addsub_size (stk - 16) else 1 ++ else 0) + + let epilogue_size f = + let stk = initial_stack_offset f in +@@ -491,7 +487,7 @@ module Size = struct + and pre_store = + match memory_chunk, assignment, macosx, addressing_mode with + | (Word_int | Word_val), true, true, Iindexed 0 -> 0 +- | (Word_int | Word_val), true, true, _ -> 1 (* Compute dest address *) ++ | (Word_int | Word_val), true, true, Iindexed n -> addsub_size n (* Compute dest address *) + | (Word_int | Word_val), true, false, _ -> 1 (* Barrier instruction *) + | _ -> 0 + and store = match memory_chunk with Single -> 2 | _ -> 1 in +@@ -553,7 +549,7 @@ module Size = struct + + begin match lbl1 with None -> 0 | Some _ -> 1 end + + begin match lbl2 with None -> 0 | Some _ -> 1 end + | Lswitch jumptbl -> 3 + Array.length jumptbl +- | Lentertrap -> if fp then 1 else 0 ++ | Lentertrap -> if fp then 2 (* over-approximation *) else 0 + | Ladjust_trap_depth _ -> 0 + | Lpushtrap _ -> 3 + | Lpoptrap -> 1 +@@ -694,9 +690,7 @@ let emit_stlr src base addr = + let dest_reg = + match addr with + | Iindexed 0 -> base +- | Iindexed ofs -> +- ` add {emit_reg reg_tmp1}, {emit_reg base}, #{emit_int ofs}\n`; +- reg_tmp1 ++ | Iindexed ofs -> emit_addimm reg_tmp1 base ofs; reg_tmp1 + | Ibased _ -> assert false (* Ibased is not emitted under macOS *) + in + ` stlr {emit_reg src}, [{emit_reg dest_reg}]\n` +@@ -721,7 +715,7 @@ let emit_instr env i = + if n > 0 then begin + emit_stack_adjustment (-n); + if env.f.fun_frame_required && fp then +- ` add x29, sp, #{emit_int (n-16)}\n`; ++ emit_addimm_gen "x29" "sp" (n - 16) + end + | Lop(Imove | Ispill | Ireload) -> + let src = i.arg.(0) and dst = i.res.(0) in +@@ -1080,7 +1074,7 @@ let emit_instr env i = + | Lentertrap -> + if fp then begin + let delta = (frame_size env) - 16 (* return address + frame pointer *) in +- ` add x29, sp, #{emit_int delta}\n` ++ emit_addimm_gen "x29" "sp" delta + end + | Ladjust_trap_depth { delta_traps } -> + (* each trap occupies 16 bytes on the stack *) +@@ -1119,7 +1113,7 @@ let emit_instr_debug env i = + `{emit_label lbl}:\n`; + emit_instr env i; + let sz = Size.instr_size env.f i.desc * 4 in +- ` .ifne (. - {emit_label lbl}) - {emit_int sz}\n`; ++ ` .ifgt (. - {emit_label lbl}) - {emit_int sz}\n`; + ` .error \"Emit.instr_size: instruction length mismatch\"\n`; + ` .endif\n` + +@@ -1130,7 +1124,7 @@ let rec emit_all env lbl_start acc i = + if debug then begin + (* acc measures in units of 32-bit instructions *) + let sz = acc * 4 in +- ` .ifne (. - {emit_label lbl_start}) - {emit_int sz}\n`; ++ ` .ifgt (. - {emit_label lbl_start}) - {emit_int sz}\n`; + ` .error \"Emit.instr_size: instruction length mismatch\"\n`; + ` .endif\n`; + end +-- +2.52.0 + diff --git a/ocaml.spec b/ocaml.spec index 2f5430c..65557d4 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -46,7 +46,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.4.1 -Release: 1%{?dist} +Release: 4%{?dist} Summary: OCaml compiler and programming environment @@ -78,6 +78,12 @@ Source2: ocaml_files.py Patch: 0001-Don-t-add-rpaths-to-libraries.patch Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch +# Fix for arm64 frame pointers +# https://github.com/ocaml/ocaml/issues/14574 +# https://github.com/ocaml/ocaml/pull/14589 +# Upstream 6cda6d8a928ada5dd0f58de229d3cb193cfdff53 +Patch: 0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch + BuildRequires: make BuildRequires: git-core BuildRequires: gcc @@ -463,6 +469,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Thu Feb 26 2026 Richard W.M. Jones - 5.4.1-4 +- Backport fix for arm64 frame pointers + * Fri Feb 20 2026 Richard W.M. Jones - 5.4.1-1 - New upstream version 5.4.1 (RHBZ#2440356) From b015f12145879ed9da0317639500d50b601deedf Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 9 Jul 2026 08:36:23 -0600 Subject: [PATCH 53/54] New upstream version 5.5.0 (RHBZ#2442622) - Drop upstreamed fix for arm64 frame pointers - Reenable LTO - Move ld.conf, libasmrun, and libcamlrun to ocaml-runtime - Drop hardlink dependency; rpm now does this by default - Drop unused utilx-linux dependency --- 0001-Don-t-add-rpaths-to-libraries.patch | 2 +- ...-Allow-user-defined-C-compiler-flags.patch | 15 +- ...st-14589-from-xavierleroy-arm64-addi.patch | 207 ------------------ ocaml.spec | 50 ++--- sources | 2 +- 5 files changed, 26 insertions(+), 250 deletions(-) delete mode 100644 0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 03c90a8..6bf857a 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From 04e523e937625bf30d775681c11e00f6dc6fc00a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/3] Don't add rpaths to libraries. +Subject: [PATCH 1/2] Don't add rpaths to libraries. --- configure.ac | 2 -- diff --git a/0002-configure-Allow-user-defined-C-compiler-flags.patch b/0002-configure-Allow-user-defined-C-compiler-flags.patch index 6a6b5f7..74de99b 100644 --- a/0002-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0002-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From ef549c9a97838331877b139f407269db2a0fc691 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 2/3] configure: Allow user defined C compiler flags. +Subject: [PATCH 2/2] configure: Allow user defined C compiler flags. --- configure.ac | 6 +++++- @@ -11,18 +11,7 @@ diff --git a/configure.ac b/configure.ac index fb60c7c14c..f6a493ccf5 100644 --- a/configure.ac +++ b/configure.ac -@@ -997,6 +997,10 @@ AS_CASE([$ocaml_cc_vendor], - internal_cflags="$cc_warnings"], - [common_cflags="-O"]) - -+# Allow CFLAGS and LDFLAGS to be added. -+common_cflags="$common_cflags $CFLAGS" -+cclibs="$cclibs $LDFLAGS" -+ - # Enable SSE2 on x86 mingw to avoid using 80-bit registers. - AS_CASE([$target], - [i686-w64-mingw32*], -@@ -2904,7 +2908,7 @@ AC_CONFIG_COMMANDS_PRE([ +@@ -3243,7 +3243,7 @@ AC_CONFIG_COMMANDS_PRE([ [mkexedebugflag="${mkexe_ldflags_prefix}${mkexedebugflag}"]) mkdll_ldflags="" AS_IF([test -n "${LDFLAGS}"], diff --git a/0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch b/0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch deleted file mode 100644 index 887ddcd..0000000 --- a/0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch +++ /dev/null @@ -1,207 +0,0 @@ -From c2923703d02c6389b6c4594541569bf628e706b1 Mon Sep 17 00:00:00 2001 -From: Xavier Leroy -Date: Thu, 26 Feb 2026 13:43:07 +0100 -Subject: [PATCH 3/3] Merge pull request #14589 from xavierleroy/arm64-addimm - -Fix arm64 additions with large immediates - -(cherry picked from commit 4fafb9669b9a5c898b2dda0ae851b2a0e6429c43) -(cherry picked from commit 6cda6d8a928ada5dd0f58de229d3cb193cfdff53) ---- - Changes | 6 +++ - asmcomp/arm64/emit.mlp | 84 ++++++++++++++++++++---------------------- - 2 files changed, 45 insertions(+), 45 deletions(-) - -diff --git a/Changes b/Changes -index be999a8cc4..4ad8737bb0 100644 ---- a/Changes -+++ b/Changes -@@ -1,3 +1,9 @@ -+### Bug fixes: -+ -+- #14574, #14577, #14589: Fix wrong assembly code generated for ARM64 -+ with frame pointer support. -+ (Xavier Leroy, review by Vincent Laviron, report by Richard Jones) -+ - OCaml 5.4.1 (17 February 2026) - ------------------------------ - -diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp -index c821310638..3f64eebc05 100644 ---- a/asmcomp/arm64/emit.mlp -+++ b/asmcomp/arm64/emit.mlp -@@ -54,9 +54,11 @@ let emit_label_type lbl ty = - - (* Output a pseudo-register *) - --let emit_reg = function -- {loc = Reg r} -> emit_string (register_name r) -- | _ -> fatal_error "Emit.emit_reg" -+let reg_name = function -+ | {loc = Reg r} -> register_name r -+ | _ -> fatal_error "Emit.reg_name" -+ -+let emit_reg l = emit_string (reg_name l) - - (* Likewise, but with the 32-bit name of the register *) - -@@ -249,16 +251,28 @@ let is_immediate_float bits = - let mant = Int64.logand bits 0xF_FFFF_FFFF_FFFFL in - exp >= -3 && exp <= 4 && Int64.logand mant 0xF_0000_0000_0000L = mant - -+(* Set [rd] to [rs + n]. *) -+ -+let emit_addimm_gen rd rs n = -+ let insn = if n >= 0 then "add" else "sub" in -+ let n = abs n in -+ if n <= 0xFFF then -+ ` {emit_string insn} {emit_string rd}, {emit_string rs}, #{emit_int n}\n` -+ else begin -+ assert (n <= 0xFFF_FFF); -+ let nl = n land 0xFFF and nh = n land 0xFFF_000 in -+ ` {emit_string insn} {emit_string rd}, {emit_string rs}, #{emit_int nh}\n`; -+ if nl <> 0 then -+ ` {emit_string insn} {emit_string rd}, {emit_string rd}, #{emit_int nl}\n` -+ end -+ - (* Adjust sp (up or down) by the given byte amount *) - - let emit_stack_adjustment n = -- let instr = if n < 0 then "sub" else "add" in -- let m = abs n in -- assert (m < 0x1_000_000); -- let ml = m land 0xFFF and mh = m land 0xFFF_000 in -- if mh <> 0 then ` {emit_string instr} sp, sp, #{emit_int mh}\n`; -- if ml <> 0 then ` {emit_string instr} sp, sp, #{emit_int ml}\n`; -- if n <> 0 then cfi_adjust_cfa_offset (-n) -+ if n <> 0 then begin -+ emit_addimm_gen "sp" "sp" n; -+ cfi_adjust_cfa_offset (-n) -+ end - - (* Deallocate the stack frame and reload the return address - before a return or tail call *) -@@ -278,29 +292,11 @@ let output_epilogue env f = - - (* Output add-immediate / sub-immediate / cmp-immediate instructions *) - --let rec emit_addimm rd rs n = -- if n < 0 then emit_subimm rd rs (-n) -- else if n <= 0xFFF then -- ` add {emit_reg rd}, {emit_reg rs}, #{emit_int n}\n` -- else begin -- assert (n <= 0xFFF_FFF); -- let nl = n land 0xFFF and nh = n land 0xFFF_000 in -- ` add {emit_reg rd}, {emit_reg rs}, #{emit_int nh}\n`; -- if nl <> 0 then -- ` add {emit_reg rd}, {emit_reg rd}, #{emit_int nl}\n` -- end -+let emit_addimm rd rs n = -+ emit_addimm_gen (reg_name rd) (reg_name rs) n - --and emit_subimm rd rs n = -- if n < 0 then emit_addimm rd rs (-n) -- else if n <= 0xFFF then -- ` sub {emit_reg rd}, {emit_reg rs}, #{emit_int n}\n` -- else begin -- assert (n <= 0xFFF_FFF); -- let nl = n land 0xFFF and nh = n land 0xFFF_000 in -- ` sub {emit_reg rd}, {emit_reg rs}, #{emit_int nh}\n`; -- if nl <> 0 then -- ` sub {emit_reg rd}, {emit_reg rd}, #{emit_int nl}\n` -- end -+let emit_subimm rd rs n = -+ emit_addimm rd rs (-n) - - let emit_cmpimm rs n = - if n >= 0 -@@ -440,9 +436,7 @@ module Size = struct - let addsub_size n = - let m = abs n in - assert (m < 0x1_000_000); -- let ml = m land 0xFFF and mh = m land 0xFFF_000 in -- max 1 ((if mh <> 0 then 1 else 0) + -- (if ml <> 0 then 1 else 0)) -+ if m <= 0xFFF then 1 else if m land 0xFFF = 0 then 1 else 2 - - let stack_adj_size n = - (* see emit_stack_adjustment *) -@@ -451,7 +445,9 @@ module Size = struct - let prologue_size f = - let stk = initial_stack_offset f in - (if stk > 0 then stack_adj_size (-stk) else 0) -- + (if f.fun_frame_required then (if fp then 2 else 1) else 0) -+ + (if f.fun_frame_required -+ then if fp then 1 + addsub_size (stk - 16) else 1 -+ else 0) - - let epilogue_size f = - let stk = initial_stack_offset f in -@@ -491,7 +487,7 @@ module Size = struct - and pre_store = - match memory_chunk, assignment, macosx, addressing_mode with - | (Word_int | Word_val), true, true, Iindexed 0 -> 0 -- | (Word_int | Word_val), true, true, _ -> 1 (* Compute dest address *) -+ | (Word_int | Word_val), true, true, Iindexed n -> addsub_size n (* Compute dest address *) - | (Word_int | Word_val), true, false, _ -> 1 (* Barrier instruction *) - | _ -> 0 - and store = match memory_chunk with Single -> 2 | _ -> 1 in -@@ -553,7 +549,7 @@ module Size = struct - + begin match lbl1 with None -> 0 | Some _ -> 1 end - + begin match lbl2 with None -> 0 | Some _ -> 1 end - | Lswitch jumptbl -> 3 + Array.length jumptbl -- | Lentertrap -> if fp then 1 else 0 -+ | Lentertrap -> if fp then 2 (* over-approximation *) else 0 - | Ladjust_trap_depth _ -> 0 - | Lpushtrap _ -> 3 - | Lpoptrap -> 1 -@@ -694,9 +690,7 @@ let emit_stlr src base addr = - let dest_reg = - match addr with - | Iindexed 0 -> base -- | Iindexed ofs -> -- ` add {emit_reg reg_tmp1}, {emit_reg base}, #{emit_int ofs}\n`; -- reg_tmp1 -+ | Iindexed ofs -> emit_addimm reg_tmp1 base ofs; reg_tmp1 - | Ibased _ -> assert false (* Ibased is not emitted under macOS *) - in - ` stlr {emit_reg src}, [{emit_reg dest_reg}]\n` -@@ -721,7 +715,7 @@ let emit_instr env i = - if n > 0 then begin - emit_stack_adjustment (-n); - if env.f.fun_frame_required && fp then -- ` add x29, sp, #{emit_int (n-16)}\n`; -+ emit_addimm_gen "x29" "sp" (n - 16) - end - | Lop(Imove | Ispill | Ireload) -> - let src = i.arg.(0) and dst = i.res.(0) in -@@ -1080,7 +1074,7 @@ let emit_instr env i = - | Lentertrap -> - if fp then begin - let delta = (frame_size env) - 16 (* return address + frame pointer *) in -- ` add x29, sp, #{emit_int delta}\n` -+ emit_addimm_gen "x29" "sp" delta - end - | Ladjust_trap_depth { delta_traps } -> - (* each trap occupies 16 bytes on the stack *) -@@ -1119,7 +1113,7 @@ let emit_instr_debug env i = - `{emit_label lbl}:\n`; - emit_instr env i; - let sz = Size.instr_size env.f i.desc * 4 in -- ` .ifne (. - {emit_label lbl}) - {emit_int sz}\n`; -+ ` .ifgt (. - {emit_label lbl}) - {emit_int sz}\n`; - ` .error \"Emit.instr_size: instruction length mismatch\"\n`; - ` .endif\n` - -@@ -1130,7 +1124,7 @@ let rec emit_all env lbl_start acc i = - if debug then begin - (* acc measures in units of 32-bit instructions *) - let sz = acc * 4 in -- ` .ifne (. - {emit_label lbl_start}) - {emit_int sz}\n`; -+ ` .ifgt (. - {emit_label lbl_start}) - {emit_int sz}\n`; - ` .error \"Emit.instr_size: instruction length mismatch\"\n`; - ` .endif\n`; - end --- -2.52.0 - diff --git a/ocaml.spec b/ocaml.spec index 65557d4..eabeb25 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,13 +1,6 @@ # Don't add -Wl,-dT, %undefine _package_note_flags -# OCaml 5.1 broke building with LTO. A file prims.c is generated with -# primitive function declarations, all with "void" for their parameter -# list. This does not match the real definitions, leading to lots of -# -Wlto-type-mismatch warnings. These change the output of the tests, -# leading to many failed tests. This is still a problem in 5.3. -%global _lto_cflags %{nil} - # OCaml has a bytecode backend that works on anything with a C # compiler, and a native code backend available on a subset of # architectures. A further subset of architectures support native @@ -32,7 +25,7 @@ ExcludeArch: %{ix86} # These are all the architectures that the tests run on. The tests # take a long time to run, so don't run them on slow machines. -%global test_arches aarch64 %{power64} riscv64 s390x x86_64 +%global test_arches %{arm64} %{power64} %{riscv64} s390x %{x86_64} # These are the architectures for which the tests must pass otherwise # the build will fail. #global test_arches_required aarch64 ppc64le x86_64 @@ -45,8 +38,8 @@ ExcludeArch: %{ix86} %global rcver %{nil} Name: ocaml -Version: 5.4.1 -Release: 4%{?dist} +Version: 5.5.0 +Release: 1%{?dist} Summary: OCaml compiler and programming environment @@ -78,26 +71,17 @@ Source2: ocaml_files.py Patch: 0001-Don-t-add-rpaths-to-libraries.patch Patch: 0002-configure-Allow-user-defined-C-compiler-flags.patch -# Fix for arm64 frame pointers -# https://github.com/ocaml/ocaml/issues/14574 -# https://github.com/ocaml/ocaml/pull/14589 -# Upstream 6cda6d8a928ada5dd0f58de229d3cb193cfdff53 -Patch: 0003-Merge-pull-request-14589-from-xavierleroy-arm64-addi.patch - BuildRequires: make BuildRequires: git-core BuildRequires: gcc BuildRequires: autoconf BuildRequires: gawk -BuildRequires: hardlink BuildRequires: perl-interpreter -BuildRequires: util-linux -BuildRequires: /usr/bin/annocheck +BuildRequires: annobin-annocheck BuildRequires: pkgconfig(libzstd) # Documentation requirements BuildRequires: asciidoc -BuildRequires: python3-pygments # ocamlopt runs gcc to link binaries. Because Fedora includes # hardening flags automatically, redhat-rpm-config is also required. @@ -142,7 +126,6 @@ and a comprehensive library. # and runtime/md5.c License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception AND LicenseRef-Fedora-Public-Domain Summary: OCaml runtime environment -Requires: util-linux Provides: ocaml(runtime) = %{version} # Bundles an MD5 implementation in runtime/caml/md5.h and runtime/md5.c @@ -313,7 +296,10 @@ make -j1 tests ||: %install %make_install -perl -pi -e "s|^$RPM_BUILD_ROOT||" $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf + +# OCaml 5.5.0 uses relative paths in ld.conf by default to support relocatable +# OCaml, which we don't need. Overwrite ld.conf with the absolute path. +echo %{_libdir}/ocaml/stublibs > $RPM_BUILD_ROOT%{_libdir}/ocaml/ld.conf echo %{version} > $RPM_BUILD_ROOT%{_libdir}/ocaml/fedora-ocaml-release @@ -326,9 +312,6 @@ install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{rpmmacrodir}/macros.ocaml-rpm mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/redhat install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/redhat -# Link, rather than copy, identical binaries -hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs - %files %license LICENSE @@ -371,7 +354,6 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %endif %{_libdir}/ocaml/expunge -%{_libdir}/ocaml/ld.conf %{_libdir}/ocaml/Makefile.config %{_libdir}/ocaml/*.a @@ -379,11 +361,9 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %{_libdir}/ocaml/*.cmxa %{_libdir}/ocaml/*.cmx %{_libdir}/ocaml/*.o -%{_libdir}/ocaml/libasmrun_shared.so %endif %{_libdir}/ocaml/*.mli %{_libdir}/ocaml/sys.ml.in -%{_libdir}/ocaml/libcamlrun_shared.so %{_libdir}/ocaml/{dynlink,runtime_events,str,threads,unix}/*.mli %if %{native_compiler} @@ -404,12 +384,18 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %doc README.html Changes %license LICENSE %{_bindir}/ocamlrun +%{_bindir}/*ocamlrun-a100 %{_bindir}/ocamlrund +%{_bindir}/*ocamlrund-a100 %{_bindir}/ocamlruni +%{_bindir}/*ocamlruni-a100 %dir %{_libdir}/ocaml +%{_libdir}/ocaml/libasmrun*.so +%{_libdir}/ocaml/libcamlrun*.so %{_libdir}/ocaml/*.cmo %{_libdir}/ocaml/*.cmi %{_libdir}/ocaml/*.cma +%{_libdir}/ocaml/ld.conf %{_libdir}/ocaml/stublibs %dir %{_libdir}/ocaml/dynlink %{_libdir}/ocaml/dynlink/META @@ -469,6 +455,14 @@ hardlink -t $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs %changelog +* Tue Jun 23 2026 Jerry James - 5.5.0-1 +- New upstream version 5.5.0 (RHBZ#2442622) +- Drop upstreamed fix for arm64 frame pointers +- Reenable LTO +- Move ld.conf, libasmrun, and libcamlrun to ocaml-runtime +- Drop hardlink dependency; rpm now does this by default +- Drop unused utilx-linux dependency + * Thu Feb 26 2026 Richard W.M. Jones - 5.4.1-4 - Backport fix for arm64 frame pointers diff --git a/sources b/sources index d5a609d..7c0afd0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ocaml-5.4.1.tar.gz) = c44bc429bee4a263b107e60a4ab3b0c9c082ba2d784f63704130551676ce5624061ae1aa280688e3222d9a522555b3cb749eef784ab2145d71c0f19cac773383 +SHA512 (ocaml-5.5.0.tar.gz) = bf13c18cd1fc7b2e5e9623024ea8623710f646ff2fbc0f59dab70e4d4318ed8623bdcc3ec59ce37af07af2b767f520dea23fb474c26297b3e858b6c8e080b4e6 From cba5f7abbea9ebc52cd0bbc5cf243f7147a79166 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jul 2026 09:52:03 +0000 Subject: [PATCH 54/54] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- ocaml.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml.spec b/ocaml.spec index eabeb25..3b39d37 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -39,7 +39,7 @@ ExcludeArch: %{ix86} Name: ocaml Version: 5.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: OCaml compiler and programming environment @@ -455,6 +455,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/redhat %changelog +* Thu Jul 16 2026 Fedora Release Engineering - 5.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Tue Jun 23 2026 Jerry James - 5.5.0-1 - New upstream version 5.5.0 (RHBZ#2442622) - Drop upstreamed fix for arm64 frame pointers