Stabilize compiler-libs ABI by not including config.cmx
authorStéphane Glondu <glondu@debian.org>
Sun, 1 Mar 2026 20:32:57 +0000 (21:32 +0100)
committerStéphane Glondu <glondu@debian.org>
Sun, 1 Mar 2026 20:58:20 +0000 (21:58 +0100)
debian/patches/Compile-utils-config.-cmi-cmx-with-opaque.patch [new file with mode: 0644]
debian/patches/series
debian/rules

diff --git a/debian/patches/Compile-utils-config.-cmi-cmx-with-opaque.patch b/debian/patches/Compile-utils-config.-cmi-cmx-with-opaque.patch
new file mode 100644 (file)
index 0000000..21758cb
--- /dev/null
@@ -0,0 +1,26 @@
+From: =?utf-8?q?St=C3=A9phane_Glondu?= <glondu@debian.org>
+Date: Sun, 1 Mar 2026 21:32:31 +0100
+Subject: Compile utils/config.{cmi,cmx} with -opaque
+
+The goal is to stabilize compiler-libs ABI.
+---
+ Makefile | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 4ce5da6..c9d4300 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2546,6 +2546,12 @@ endif
+ %.cmx: %.ml
+       $(V_OCAMLOPT)$(COMPILE_NATIVE_MODULE) -c $<
++utils/config.cmi: utils/config.mli
++      $(V_OCAMLC)$(CAMLC) $(OC_COMMON_COMPFLAGS) -I $(@D) $(INCLUDES) -opaque -c $<
++
++utils/config.cmx: utils/config.ml
++      $(V_OCAMLOPT)$(COMPILE_NATIVE_MODULE) -opaque -c $<
++
+ partialclean::
+       for d in utils parsing typing bytecomp asmcomp middle_end file_formats \
+            lambda middle_end/closure middle_end/flambda \
index 6da62215d11e3ea7abdd06bbcf7f2ab9483fd4b7..f7cc4551103f052cec533c951ad6543cbf06755e 100644 (file)
@@ -4,3 +4,4 @@ Do-not-error-on-warnings-in-autoconf.patch
 Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch
 Mark-test_compact_manydomains-as-multicore.patch
 Increase-the-amount-of-data-written-to-a-pipe-in-a-test.patch
+Compile-utils-config.-cmi-cmx-with-opaque.patch
index 1aadd633845479d7df250e44622b75f81e75a5c0..dee2d0948c3877a76fe2045d03c509d41efd7787 100755 (executable)
@@ -222,6 +222,8 @@ install-stamp-arch: install-stamp
 install-stamp:
 # Install OCaml
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+# Remove config.cmx so that it is not part of compiler-libs ABI
+       rm -f debian/tmp$(OCAML_STDLIB_DIR)/compiler-libs/config.cmx
 ifeq (,$(DEB_TEST_BUILD_PREFIX))
 # Remove Debian-specific file
        rm -f debian/tmp$(OCAML_STDLIB_DIR)/ld.conf