Print .cmi flags in objinfo
authorStéphane Glondu <glondu@debian.org>
Sun, 1 Mar 2026 21:24:41 +0000 (22:24 +0100)
committerStéphane Glondu <glondu@debian.org>
Sun, 1 Mar 2026 21:37:02 +0000 (22:37 +0100)
debian/patches/Print-.cmi-flags-in-objinfo.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/Print-.cmi-flags-in-objinfo.patch b/debian/patches/Print-.cmi-flags-in-objinfo.patch
new file mode 100644 (file)
index 0000000..337d06d
--- /dev/null
@@ -0,0 +1,43 @@
+From: =?utf-8?q?St=C3=A9phane_Glondu?= <glondu@debian.org>
+Date: Sun, 1 Mar 2026 22:23:34 +0100
+Subject: Print .cmi flags in objinfo
+
+---
+ tools/objinfo.ml | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/tools/objinfo.ml b/tools/objinfo.ml
+index 83e3659..f16194a 100644
+--- a/tools/objinfo.ml
++++ b/tools/objinfo.ml
+@@ -85,9 +85,21 @@ let print_cma_infos (lib : Cmo_format.library) =
+   printf "\n";
+   List.iter print_cmo_infos lib.lib_units
+-let print_cmi_infos name crcs =
++let print_cmi_infos name crcs flags =
++  let open Cmi_format in
+   if not !quiet then begin
+     printf "Unit name: %s\n" name;
++    printf "Flags: [ ";
++    begin
++      flags
++      |> List.map (function
++             | Rectypes -> "Rectypes"
++             | Opaque -> "Opaque"
++             | Alerts _ -> "Alerts _")
++      |> String.concat "; "
++      |> printf "%s"
++    end;
++    printf " ]\n";
+     printf "Interfaces imported:\n";
+     List.iter print_name_crc crcs
+   end
+@@ -370,6 +382,7 @@ let dump_obj_by_kind filename ic obj_kind =
+          | None -> ()
+          | Some cmi ->
+             print_cmi_infos cmi.Cmi_format.cmi_name cmi.Cmi_format.cmi_crcs
++              cmi.Cmi_format.cmi_flags
+        end;
+        begin match cmt with
+          | None -> ()
index f7cc4551103f052cec533c951ad6543cbf06755e..43c3c3e8ddcaa5b6750e5be9867407e4e4422310 100644 (file)
@@ -5,3 +5,4 @@ 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
+Print-.cmi-flags-in-objinfo.patch