The following commit has been merged in the master branch:
commit fe9bf36fb4da57b352044ae8c91149b9bbbed924
Author: Stephane Glondu <st...@glondu.net>
Date:   Tue May 24 11:50:10 2011 +0200

    Provide a way to use legacy custom linking (Closes: #627761)

diff --git 
a/debian/patches/0011-Embed-bytecode-in-C-object-when-using-custom.patch 
b/debian/patches/0011-Embed-bytecode-in-C-object-when-using-custom.patch
index e7403f8..8552379 100644
--- a/debian/patches/0011-Embed-bytecode-in-C-object-when-using-custom.patch
+++ b/debian/patches/0011-Embed-bytecode-in-C-object-when-using-custom.patch
@@ -3,17 +3,19 @@ Date: Sun, 17 Aug 2008 17:10:03 +0200
 Subject: Embed bytecode in C object when using -custom
 
 This patch fixes non-strippability of bytecode executables linked with
-custom runtime.
+custom runtime. Having "c" in OCAML_COMPAT environment variable
+restores the original behaviour.
 
 Forwarded: not-needed
 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627761
 Signed-off-by: Stephane Glondu <st...@glondu.net>
 ---
- bytecomp/bytelink.ml |   31 +++++++++++++++++++++++++++----
- 1 files changed, 27 insertions(+), 4 deletions(-)
+ bytecomp/bytelink.ml |   36 ++++++++++++++++++++++++++++++++----
+ 1 files changed, 32 insertions(+), 4 deletions(-)
 
 diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
-index 47903c4..184079c 100644
+index 47903c4..e63dd3b 100644
 --- a/bytecomp/bytelink.ml
 +++ b/bytecomp/bytelink.ml
 @@ -415,7 +415,7 @@ let mlvalues_primitives = [
@@ -55,11 +57,23 @@ index 47903c4..184079c 100644
  #ifdef __cplusplus\n\
  }\n\
  #endif\n";
-@@ -514,6 +527,16 @@ let link objfiles output_name =
+@@ -501,6 +514,11 @@ let fix_exec_name name =
+       if String.contains name '.' then name else name ^ ".exe"
+   | _ -> name
+ 
++(* Legacy custom behaviour (Debian-specific) *)
++
++let legacy_custom =
++  try String.contains (Sys.getenv "OCAML_COMPAT") 'c' with Not_found -> false
++
+ (* Main entry point (build a custom runtime if needed) *)
+ 
+ let link objfiles output_name =
+@@ -514,6 +532,16 @@ let link objfiles output_name =
    Clflags.dllibs := !lib_dllibs @ !Clflags.dllibs; (* put user's DLLs first *)
    if not !Clflags.custom_runtime then
      link_bytecode tolink output_name true
-+  else if not !Clflags.output_c_object && not !Clflags.make_runtime then
++  else if not legacy_custom && not !Clflags.output_c_object && not 
!Clflags.make_runtime then
 +    let c_file = Filename.temp_file "camlobj" ".c" in
 +    try
 +      link_bytecode_as_c tolink c_file true;
@@ -72,7 +86,7 @@ index 47903c4..184079c 100644
    else if not !Clflags.output_c_object then begin
      let bytecode_name = Filename.temp_file "camlcode" "" in
      let prim_name = Filename.temp_file "camlprim" ".c" in
-@@ -552,7 +575,7 @@ let link objfiles output_name =
+@@ -552,7 +580,7 @@ let link objfiles output_name =
      if Sys.file_exists c_file then raise(Error(File_exists c_file));
      let temps = ref [] in
      try

-- 
OCaml packaging

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to