projects/guix·blob python-team · refs

43 lines · 1.6 KiB

1Avoid multiply-defined symbols that lead to link errors such as:
2
3 gcc -O2 -fno-strict-aliasing -fwrapv -Wall -fno-tree-vrp -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -Wl,-E -o ocamlruni prims.o libcamlruni.a -lm -ldl -lpthread
4 ld: libcamlruni.a(backtrace.i.o):/tmp/guix-build-ocaml-4.07.1.drv-0/ocaml-4.07.1/byterun/backtrace.c:31: multiple definition of `caml_debug_info'; libcamlruni.a(backtrace_prim.i.o):/tmp/guix-build-ocaml-4.07.1.drv-0/ocaml-4.07.1/byterun/backtrace_prim.c:47: first defined here
5
6diff --git a/asmrun/startup.c b/asmrun/startup.c
7index 070f0c6..cf8a56f 100644
8--- a/asmrun/startup.c
9+++ b/asmrun/startup.c
10@@ -44,7 +44,6 @@
11 #endif
12
13 extern int caml_parser_trace;
14-CAMLexport header_t caml_atom_table[256];
15 char * caml_code_area_start, * caml_code_area_end;
16 struct ext_table caml_code_fragments_table;
17
18diff --git a/byterun/backtrace.c b/byterun/backtrace.c
19index 8dfe9b7..9cc9e72 100644
20--- a/byterun/backtrace.c
21+++ b/byterun/backtrace.c
22@@ -28,7 +28,7 @@
23 #include "caml/fail.h"
24
25 /* The table of debug information fragments */
26-struct ext_table caml_debug_info;
27+static struct ext_table caml_debug_info;
28
29 CAMLexport int32_t caml_backtrace_active = 0;
30 CAMLexport int32_t caml_backtrace_pos = 0;
31diff --git a/byterun/backtrace_prim.c b/byterun/backtrace_prim.c
32index e69b256..d794f73 100644
33--- a/byterun/backtrace_prim.c
34+++ b/byterun/backtrace_prim.c
35@@ -44,7 +44,7 @@
36 #include "caml/backtrace_prim.h"
37
38 /* The table of debug information fragments */
39-struct ext_table caml_debug_info;
40+static struct ext_table caml_debug_info;
41
42 CAMLexport char_os * caml_cds_file = NULL;
43