Trigger -output-complete-exe on -custom with an environment variable
authorStephane Glondu <steph@glondu.net>
Thu, 3 Sep 2020 13:21:10 +0000 (15:21 +0200)
committerStéphane Glondu <glondu@debian.org>
Thu, 3 Sep 2020 14:20:50 +0000 (16:20 +0200)
debian/patches/0007-Trigger-output-complete-exe-on-custom-with-an-enviro.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0007-Trigger-output-complete-exe-on-custom-with-an-enviro.patch b/debian/patches/0007-Trigger-output-complete-exe-on-custom-with-an-enviro.patch
new file mode 100644 (file)
index 0000000..3d7c013
--- /dev/null
@@ -0,0 +1,36 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Thu, 3 Sep 2020 15:21:10 +0200
+Subject: Trigger -output-complete-exe on -custom with an environment variable
+
+---
+ driver/main_args.ml | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/driver/main_args.ml b/driver/main_args.ml
+index 5c28ded..81f203d 100644
+--- a/driver/main_args.ml
++++ b/driver/main_args.ml
+@@ -1962,7 +1962,6 @@ third-party libraries such as Lwt, but with a different API."
+     include Core
+     include Compiler
+     let _compat_32 = set bytecode_compatible_32
+-    let _custom = set custom_runtime
+     let _dcamlprimc = set keep_camlprimc_file
+     let _dinstr = set dump_instr
+     let _dllib s = defer (ProcessDLLs (Misc.rev_split_words s))
+@@ -1981,6 +1980,15 @@ third-party libraries such as Lwt, but with a different API."
+     let _use_runtime s = use_runtime := s
+     let _v () = print_version_and_library "compiler"
+     let _vmthread () = fatal vmthread_removed_message
++    let _custom () =
++      if
++        match Sys.getenv_opt "OCAML_CUSTOM_USE_OUTPUT_COMPLETE_EXE" with
++        | None | Some "" -> false
++        | Some _ -> true
++      then
++        _output_complete_exe ()
++      else
++        set custom_runtime ()
+   end
+ end
index 138f0dddf3ddf68dcba31887b9c7a9c0994edc17..b547951826cc9db0c3e33f2bd3ff34f337200165 100644 (file)
@@ -4,3 +4,4 @@
 0004-Check-for-definition-of-AT_SECURE-before-using-it.patch
 0005-read_main_debug_info-do-not-die-in-custom-executable.patch
 0006-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
+0007-Trigger-output-complete-exe-on-custom-with-an-enviro.patch