From 563ce51f7b1bf170a2a950ee962974c952ef4f84 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Fri, 24 Jul 2020 16:17:42 +0200 Subject: [PATCH] Fix FTBFS with gcc-10 (Closes: #957623) --- ...definitions-of-common-global-variabl.patch | 41 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 debian/patches/0007-Avoid-duplicate-definitions-of-common-global-variabl.patch 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 new file mode 100644 index 00000000..bbbc283d --- /dev/null +++ b/debian/patches/0007-Avoid-duplicate-definitions-of-common-global-variabl.patch @@ -0,0 +1,41 @@ +From: Xavier Leroy +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; + diff --git a/debian/patches/series b/debian/patches/series index 091e2f65..7bd239ed 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ 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 -- 2.30.2