All Releases

OCaml 5.2.1

This page describes OCaml version 5.2.1, released on Nov 18, 2024. Go here for a list of all releases.

This is a bug-fix release of OCaml 5.2.0.

Installation Instructions

The base compiler can be installed as an opam switch with the following commands:

opam update
opam switch create 5.2.1

Configuration Options

The configuration of the installed opam switch can be tuned with the following options:

  • ocaml-option-afl: Set OCaml to be compiled with afl-fuzz instrumentation
  • ocaml-option-bytecode-only: Compile OCaml without the native-code compiler
  • ocaml-option-flambda: Set OCaml to be compiled with flambda activated
  • ocaml-option-musl: Set OCaml to be compiled with musl-gcc
  • ocaml-option-no-flat-float-array: Set OCaml to be compiled with --disable-flat-float-array
  • ocaml-option-static: Set OCaml to be compiled with musl-gcc -static
  • ocaml-option-address-sanitizer: Set OCaml to be compiled with address sanitiser
  • ocaml-option-leak-sanitizer: Set OCaml to be compiled with leak sanitiser
  • ocaml-option-fp: Set OCaml to be compiled with frame pointers

For instance, one can install a switch with both flambda and the --disable-flat-float-array option with

opam switch create 5.2.1+flambda+nffa ocaml-variants.5.2.1+options ocaml-option-flambda ocaml-option-no-flat-float-array

Source Distribution

  • Source tarball (.tar.gz) for compilation under Unix (including Linux and macOS X) and Microsoft Windows (including Cygwin).
  • Also available in .zip format.
  • Opam is a source-based distribution of OCaml and many companion libraries and tools. Compilation and installation are automated by powerful package managers.
  • The official development repo is hosted on GitHub.

The INSTALL file of the distribution provides detailed compilation and installation instructions. See also the Windows release notes for instructions on how to build under Windows.

Changes

This is the changelog.

  • #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)

  • #13252: Rework register assignment in the interpreter code on m68k on Linux, due to the %a5 register being used by Glibc. (Miod Vallat, report by Stéphane Glondu, review by Gabriel Scherer and Xavier Leroy)

  • #13268: Fix a call to test in configure.ac that was causing errors when LDFLAGS contains several words. (Stéphane Glondu, review by Miod Vallat)

  • #13234, #13267: Open runtime events file in read-write mode on armel (armv5) systems due to atomic operations limitations on that platform. (Stéphane Glondu, review by Miod Vallat and Vincent Laviron)

  • #13188: fix races in the FFI code coming from the use of Int_val(...) on rooted values inside blocking questions / without the runtime lock. (Calling Int_val(...) on non-rooted immediates is fine, but any access to rooted values must be done outside blocking sections / with the runtime lock.) (Etienne Millon, review by Gabriel Scherer, Jan Midtgaard, Olivier Nicole)

  • #13318: Fix regression in GC alarms, and fix them for flambda. (Guillaume Munch-Maccagnoni, report by Benjamin Monate, review