| 1 | Avoid 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 |
|
| 6 | diff --git a/asmrun/startup.c b/asmrun/startup.c
|
| 7 | index 070f0c6..cf8a56f 100644
|
| 8 | |
| 9 | |
| 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 |
|
| 18 | diff --git a/byterun/backtrace.c b/byterun/backtrace.c
|
| 19 | index 8dfe9b7..9cc9e72 100644
|
| 20 | |
| 21 | |
| 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;
|
| 31 | diff --git a/byterun/backtrace_prim.c b/byterun/backtrace_prim.c
|
| 32 | index e69b256..d794f73 100644
|
| 33 | |
| 34 | |
| 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 |
|