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 1/8] 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 2/8] 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 3/8] 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 4/8] 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 5/8] 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 6/8] 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 7/8] 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 8/8] 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