Refresh patches
authorStephane Glondu <steph@glondu.net>
Thu, 3 Sep 2020 13:06:02 +0000 (15:06 +0200)
committerStéphane Glondu <glondu@debian.org>
Thu, 3 Sep 2020 13:06:02 +0000 (15:06 +0200)
 * Avoid-duplicate-definitions-of-common-global-variabl: merged
   upstream
 * Reimplement-custom-without-hacks: removed for now; it will be
   reimplemented with the new -output-complete-exe feature.

debian/patches/0003-Don-t-use-rpath.patch
debian/patches/0004-Put-manpages-in-section-3o-instead-of-3.patch
debian/patches/0006-read_main_debug_info-do-not-die-in-custom-executable.patch
debian/patches/0007-Avoid-duplicate-definitions-of-common-global-variabl.patch [deleted file]
debian/patches/0008-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch
debian/patches/0008-Reimplement-custom-without-hacks.patch [deleted file]
debian/patches/0013-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch
debian/patches/series

index 1f547354c17ba125a776d83fe0d38888c32cc306..7bc167d5a42c0e9b3e8b2d5eec2766b092e7c914 100644 (file)
@@ -7,7 +7,7 @@ Subject: Don't use rpath
  1 file changed, 5 insertions(+)
 
 diff --git a/tools/ocamlmklib.ml b/tools/ocamlmklib.ml
-index b5c0aee..b4e45d1 100644
+index d5bb84c..ab3ca2b 100644
 --- a/tools/ocamlmklib.ml
 +++ b/tools/ocamlmklib.ml
 @@ -58,6 +58,11 @@ and rpath = ref []          (* rpath options *)
index 6cc46b28fd3897ec882e59d0a200d901a229b495..8588c8d60f7a3fbf05420001216da792d124d709 100644 (file)
@@ -7,10 +7,10 @@ Subject: Put manpages in section 3o instead of 3
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile
-index f8b8cf6..d2cdcab 100644
+index 6b7093b..026d409 100644
 --- a/ocamldoc/Makefile
 +++ b/ocamldoc/Makefile
-@@ -407,7 +407,7 @@ stdlib_man/Stdlib.3o: $(OCAMLDOC) $(DOC_ALL)
+@@ -416,7 +416,7 @@ stdlib_man/Stdlib.3o: $(OCAMLDOC) $(DOC_ALL)
        $(OCAMLDOC_RUN) -man -d stdlib_man -nostdlib \
        -hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \
        -pp "$(AWK) -v ocamldoc=true -f $(SRC)/stdlib/expand_module_aliases.awk" \
index 586ddbe66822324bafe71621a973684f64390ebd..a9c217832b8f8c1697311b0aabf3cbc586818e46 100644 (file)
@@ -10,10 +10,10 @@ build of ppxlib.
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/runtime/backtrace_byt.c b/runtime/backtrace_byt.c
-index 8ea94ee..d82816c 100644
+index 28fe44c..88e10fc 100644
 --- a/runtime/backtrace_byt.c
 +++ b/runtime/backtrace_byt.c
-@@ -342,7 +342,7 @@ static void read_main_debug_info(struct debug_info *di)
+@@ -378,7 +378,7 @@ static void read_main_debug_info(struct debug_info *di)
  
    fd = caml_attempt_open(&exec_name, &trail, 1);
    if (fd < 0){
diff --git a/debian/patches/0007-Avoid-duplicate-definitions-of-common-global-variabl.patch b/debian/patches/0007-Avoid-duplicate-definitions-of-common-global-variabl.patch
deleted file mode 100644 (file)
index bbbc283..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From: Xavier Leroy <xavier.leroy@college-de-france.fr>
-Date: Thu, 12 Dec 2019 16:41:17 +0100
-Subject: Avoid duplicate definitions of "common" global variables
-
-The variables are caml_debug_info and caml_atom_table.
-The multiple definitions look like a cut-and-paste error.
-They cause problems with C compilers that don't follow the "common" model.
-
-Bug: https://github.com/ocaml/ocaml/issues/9144
-Bug-Debian: https://bugs.debian.org/957623
----
- runtime/backtrace.c   | 3 ---
- runtime/startup_nat.c | 1 -
- 2 files changed, 4 deletions(-)
-
-diff --git a/runtime/backtrace.c b/runtime/backtrace.c
-index a3c2c08..ddf7af1 100644
---- a/runtime/backtrace.c
-+++ b/runtime/backtrace.c
-@@ -27,9 +27,6 @@
- #include "caml/backtrace_prim.h"
- #include "caml/fail.h"
--/* The table of debug information fragments */
--struct ext_table caml_debug_info;
--
- CAMLexport int32_t caml_backtrace_active = 0;
- CAMLexport int32_t caml_backtrace_pos = 0;
- CAMLexport backtrace_slot * caml_backtrace_buffer = NULL;
-diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c
-index 43b85e3..5b20036 100644
---- a/runtime/startup_nat.c
-+++ b/runtime/startup_nat.c
-@@ -44,7 +44,6 @@
- #endif
- extern int caml_parser_trace;
--CAMLexport header_t caml_atom_table[256];
- char * caml_code_area_start, * caml_code_area_end;
- struct ext_table caml_code_fragments_table;
index 856e72f23ba60af009ff6c5d515d489b53919547..9c3063747dec65120c321d3e3873e5e49143ee59 100644 (file)
@@ -8,12 +8,12 @@ Bug: https://github.com/ocaml/ocaml/issues/9800
  1 file changed, 10 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index 82172d7..0f22211 100644
+index 069fe96..ab1e188 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -952,6 +952,16 @@ AS_CASE(["$arch,$system"],
-   [power,netbsd], [profiling=true],
-   [profiling=false])
+@@ -1018,6 +1018,16 @@ AS_CASE([$arch],
+        [common_cflags="-no-pie $common_cflags"],
+     [])])
  
 +# Disable DT_TEXTREL warnings on Linux i386
 +# See https://github.com/ocaml/ocaml/issues/9800
@@ -27,4 +27,4 @@ index 82172d7..0f22211 100644
 +
  # Assembler
  
- AS_CASE([$host],
+ AS_IF([test -n "$host_alias"], [toolpref="${host_alias}-"], [toolpref=""])
diff --git a/debian/patches/0008-Reimplement-custom-without-hacks.patch b/debian/patches/0008-Reimplement-custom-without-hacks.patch
deleted file mode 100644 (file)
index 194a0bc..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Sun, 18 Aug 2019 08:04:51 +0200
-Subject: Reimplement -custom without hacks
-
-Origin: https://github.com/ocaml/ocaml/pull/8872
----
- bytecomp/bytelink.ml                         | 32 +++++++++--
- ocamltest/Makefile                           |  3 +-
- testsuite/tests/embedded/ocamltests          |  1 -
- testsuite/tests/lib-dynlink-bytecode/main.ml |  2 +-
- testsuite/tests/lib-threads/ocamltests       |  1 -
- tools/cmpbyt.ml                              | 85 +++++++++++++++-------------
- 6 files changed, 77 insertions(+), 47 deletions(-)
- delete mode 100644 testsuite/tests/embedded/ocamltests
-
-diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
-index 0b964e6..40b2850 100644
---- a/bytecomp/bytelink.ml
-+++ b/bytecomp/bytelink.ml
-@@ -438,7 +438,7 @@ let output_cds_file outfile =
- (* Output a bytecode executable as a C file *)
--let link_bytecode_as_c tolink outfile =
-+let link_bytecode_as_c tolink outfile with_main =
-   let outchan = open_out outfile in
-   Misc.try_finally
-     ~always:(fun () -> close_out outchan)
-@@ -481,7 +481,19 @@ let link_bytecode_as_c tolink outfile =
-        (* The table of primitives *)
-        Symtable.output_primitive_table outchan;
-        (* The entry point *)
--       output_string outchan "\
-+       if with_main then begin
-+         output_string outchan "\
-+\nint main(int argc, char_os **argv)\
-+\n{\
-+\n  caml_startup_code(caml_code, sizeof(caml_code),\
-+\n                    caml_data, sizeof(caml_data),\
-+\n                    caml_sections, sizeof(caml_sections),\
-+\n                    /* pooling */ 0,\
-+\n                    argv);\
-+\n  return 0; /* not reached */\
-+\n}\n"
-+       end else begin
-+         output_string outchan "\
- \nvoid caml_startup(char_os ** argv)\
- \n{\
- \n  caml_startup_code(caml_code, sizeof(caml_code),\
-@@ -516,7 +528,9 @@ let link_bytecode_as_c tolink outfile =
- \n                               caml_sections, sizeof(caml_sections),\
- \n                               /* pooling */ 1,\
- \n                               argv);\
--\n}\
-+\n}\n"
-+       end;
-+       output_string outchan "\
- \n#ifdef __cplusplus\
- \n}\
- \n#endif\n";
-@@ -575,6 +589,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
-+    let c_file = Filename.temp_file "camlobj" ".c" in
-+    Misc.try_finally
-+      ~always:(fun () -> remove_file c_file)
-+      (fun () ->
-+         link_bytecode_as_c tolink c_file true;
-+         let exec_name = fix_exec_name output_name in
-+         if not (build_custom_runtime c_file exec_name)
-+         then raise(Error Custom_runtime)
-+      )
-   else if not !Clflags.output_c_object then begin
-     let bytecode_name = Filename.temp_file "camlcode" "" in
-     let prim_name =
-@@ -637,7 +661,7 @@ let link objfiles output_name =
-     Misc.try_finally
-       ~always:(fun () -> List.iter remove_file !temps)
-       (fun () ->
--         link_bytecode_as_c tolink c_file;
-+         link_bytecode_as_c tolink c_file false;
-          if not (Filename.check_suffix output_name ".c") then begin
-            temps := c_file :: !temps;
-            if Ccomp.compile_file ~output:obj_file ?stable_name c_file <> 0 then
-diff --git a/ocamltest/Makefile b/ocamltest/Makefile
-index f226e55..7c7edf4 100644
---- a/ocamltest/Makefile
-+++ b/ocamltest/Makefile
-@@ -198,7 +198,8 @@ allopt: ocamltest.opt$(EXE)
- opt.opt: allopt
- ocamltest$(EXE): $(bytecode_modules)
--      $(ocamlc_cmd) -custom ocamlcommon.cma ocamlbytecomp.cma -o $@ $^
-+      $(ocamlc_cmd) -ccopt "-I $(ROOTDIR)/runtime" -custom \
-+        ocamlcommon.cma ocamlbytecomp.cma -o $@ $^
- %.cmo: %.ml
-       $(ocamlc) -c $<
-diff --git a/testsuite/tests/embedded/ocamltests b/testsuite/tests/embedded/ocamltests
-deleted file mode 100644
-index b03fb35..0000000
---- a/testsuite/tests/embedded/ocamltests
-+++ /dev/null
-@@ -1 +0,0 @@
--cmcaml.ml
-diff --git a/testsuite/tests/lib-dynlink-bytecode/main.ml b/testsuite/tests/lib-dynlink-bytecode/main.ml
-index 558dc69..15892fa 100644
---- a/testsuite/tests/lib-dynlink-bytecode/main.ml
-+++ b/testsuite/tests/lib-dynlink-bytecode/main.ml
-@@ -45,7 +45,7 @@ reference = "${test_source_directory}/static.reference"
- ******** ocamlc.byte
- program = "${test_build_directory}/custom.exe"
--flags = "-custom -linkall -I ."
-+flags = "-ccopt '-I ${ocamlsrcdir}/runtime' -custom -linkall -I ."
- all_modules = "registry.cmo plug2.cma plug1.cma"
- use_runtime = "false"
- ********* run
-diff --git a/testsuite/tests/lib-threads/ocamltests b/testsuite/tests/lib-threads/ocamltests
-index 1df74eb..76ec72d 100644
---- a/testsuite/tests/lib-threads/ocamltests
-+++ b/testsuite/tests/lib-threads/ocamltests
-@@ -10,7 +10,6 @@ pr7638.ml
- prodcons.ml
- prodcons2.ml
- sieve.ml
--signal.ml
- sockets.ml
- swapchan.ml
- tls.ml
-diff --git a/tools/cmpbyt.ml b/tools/cmpbyt.ml
-index 983234f..71bbe1e 100644
---- a/tools/cmpbyt.ml
-+++ b/tools/cmpbyt.ml
-@@ -35,47 +35,54 @@ let skip_section name =
- let cmpbyt file1 file2 =
-   let ic1 = open_in_bin file1 in
--  let (toc1, pos1) = readtoc ic1 in
-   let ic2 = open_in_bin file2 in
--  let (toc2, pos2) = readtoc ic2 in
--  seek_in ic1 pos1;
--  seek_in ic2 pos2;
--  let rec cmpsections t1 t2 =
--    match t1, t2 with
--    | [], [] ->
--        true
--    | (name1, len1) :: t1, t2  when skip_section name1 ->
--        seek_in ic1 (pos_in ic1 + len1);
--         cmpsections t1 t2
--    | t1, (name2, len2) :: t2  when skip_section name2 ->
--        seek_in ic2 (pos_in ic2 + len2);
--        cmpsections t1 t2
--    | [], _  ->
--        eprintf "%s has more sections than %s\n" file2 file1;
--        false
--    | _,  [] ->
--        eprintf "%s has more sections than %s\n" file1 file2;
--        false
--    | (name1, len1) :: t1, (name2, len2) :: t2 ->
--        if name1 <> name2 then begin
--          eprintf "Section mismatch: %s (in %s) / %s (in %s)\n"
--                  name1 file1 name2 file2;
--          false
--        end else if len1 <> len2 then begin
--          eprintf "Length of section %s differ: %d (in %s) / %d (in %s)\n"
--                  name1 len1 file1 len2 file2;
--          false
--        end else begin
--          match cmpbytes ic1 ic2 len1 0 with
--          | Differ ofs ->
--              eprintf "Files %s and %s differ: section %s, offset %d\n"
--                      file1 file2 name1 ofs;
--              false
--          | Same ->
--              cmpsections t1 t2
--        end
-+  let len1 = in_channel_length ic1 in
-+  let len2 = in_channel_length ic2 in
-+  let res =
-+    if len1 = len2 && cmpbytes ic1 ic2 len1 0 = Same then
-+      true
-+    else
-+      let (toc1, pos1) = readtoc ic1 in
-+      let (toc2, pos2) = readtoc ic2 in
-+      seek_in ic1 pos1;
-+      seek_in ic2 pos2;
-+      let rec cmpsections t1 t2 =
-+        match t1, t2 with
-+        | [], [] ->
-+           true
-+        | (name1, len1) :: t1, t2  when skip_section name1 ->
-+           seek_in ic1 (pos_in ic1 + len1);
-+           cmpsections t1 t2
-+        | t1, (name2, len2) :: t2  when skip_section name2 ->
-+           seek_in ic2 (pos_in ic2 + len2);
-+           cmpsections t1 t2
-+        | [], _  ->
-+           eprintf "%s has more sections than %s\n" file2 file1;
-+           false
-+        | _,  [] ->
-+           eprintf "%s has more sections than %s\n" file1 file2;
-+           false
-+        | (name1, len1) :: t1, (name2, len2) :: t2 ->
-+           if name1 <> name2 then begin
-+               eprintf "Section mismatch: %s (in %s) / %s (in %s)\n"
-+                 name1 file1 name2 file2;
-+               false
-+             end else if len1 <> len2 then begin
-+               eprintf "Length of section %s differ: %d (in %s) / %d (in %s)\n"
-+                 name1 len1 file1 len2 file2;
-+               false
-+             end else begin
-+               match cmpbytes ic1 ic2 len1 0 with
-+               | Differ ofs ->
-+                  eprintf "Files %s and %s differ: section %s, offset %d\n"
-+                    file1 file2 name1 ofs;
-+                  false
-+               | Same ->
-+                  cmpsections t1 t2
-+             end
-+      in
-+      cmpsections toc1 toc2
-   in
--  let res = cmpsections toc1 toc2 in
-   close_in ic1; close_in ic2;
-   res
index af639f377d51b3a949a86c6e16358fe1221990df..9a9d1a39a7f3420650bcb42c094b39fca00fb64b 100644 (file)
@@ -17,10 +17,10 @@ Last-Update: <2019-07-22>
  2 files changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index f5d8a26..82172d7 100644
+index aa5f26f..069fe96 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -767,6 +767,9 @@ AS_IF([test x"$enable_shared" != "xno"],
+@@ -831,6 +831,9 @@ AS_IF([test x"$enable_shared" != "xno"],
        natdynlinkopts="-Wl,-E"
        shared_libraries_supported=true])])
  
@@ -31,15 +31,15 @@ index f5d8a26..82172d7 100644
  
  # Configure native dynlink
 diff --git a/tools/Makefile b/tools/Makefile
-index ee0e0be..b6d74d5 100644
+index dbad0b7..b4adcff 100644
 --- a/tools/Makefile
 +++ b/tools/Makefile
-@@ -323,7 +323,7 @@ endif
+@@ -276,7 +276,7 @@ DEF_SYMBOL_PREFIX = '-Dsymbol_prefix="_"'
+ endif
  
- objinfo_helper$(EXE): objinfo_helper.c $(ROOTDIR)/runtime/caml/s.h
-       $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \
--          $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK)
-+          $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK) $(CCLINKFLAGS)
+ objinfo_helper$(EXE): objinfo_helper.$(O)
+-      $(CC) $(BFD_LDFLAGS) $(OC_CFLAGS) $(OUTPUTEXE)$@ $< $(BFD_LDLIBS)
++      $(CC) $(BFD_LDFLAGS) $(OC_CFLAGS) $(OUTPUTEXE)$@ $< $(BFD_LDLIBS) $(CCLINKFLAGS)
+ objinfo_helper.$(O): $(ROOTDIR)/runtime/caml/s.h
  
- OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \
-         $(ROOTDIR)/compilerlibs/ocamlbytecomp.cma \
index c66a94db21ff78a288b550592612d22f8ec8ad7b..c9d9fc17f096c9363296907112beacd0756c1060 100644 (file)
@@ -2,7 +2,5 @@
 0004-Put-manpages-in-section-3o-instead-of-3.patch
 0013-Use-CCLINKFLAGS-for-linking-all-executables-and-shar.patch
 0005-Check-for-definition-of-AT_SECURE-before-using-it.patch
-0008-Reimplement-custom-without-hacks.patch
 0006-read_main_debug_info-do-not-die-in-custom-executable.patch
-0007-Avoid-duplicate-definitions-of-common-global-variabl.patch
 0008-Disable-DT_TEXTREL-warnings-on-Linux-i386.patch