From: Stephane Glondu Date: Tue, 24 May 2011 09:50:10 +0000 (+0200) Subject: Provide a way to use legacy custom linking (Closes: #627761) X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~304 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fe9bf36fb4da57b352044ae8c91149b9bbbed924;p=ocaml.git 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 e7403f86..8552379c 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 --- - 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