From f299c84c6ddf24babb331a6128d5993c2e99c1b5 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 23 May 2024 09:00:25 -0600 Subject: [PATCH 01/21] 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 02/21] 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 03/21] 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 04/21] 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 05/21] 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 06/21] 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 07/21] 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 08/21] 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 09/21] 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 10/21] 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 11/21] 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 12/21] 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 13/21] 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 14/21] 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 15/21] 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 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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