summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2021-08-05 15:19:20 +0200
committerLudovic Courtès <ludo@gnu.org>2021-08-05 15:46:46 +0200
commit1d580f47a9f3b9a0ff9cbb490ff9db7388d74952 (patch)
tree2c36627762f29663eb52d083f1022aa4c35337b6 /gnu
parentbfb690be87d37c22681b366278c21be0176e7f58 (diff)
downloadguix-patches-1d580f47a9f3b9a0ff9cbb490ff9db7388d74952.tar
guix-patches-1d580f47a9f3b9a0ff9cbb490ff9db7388d74952.tar.gz
gnu: ocaml@4.07: Fix link failure.
The link failure shows up when using ld from GNU Binutils 2.37, and not with 2.34. * gnu/packages/patches/ocaml-multiple-definitions.patch: New file. * gnu/packages/ocaml.scm (ocaml-4.07-boot)[source]: Use it. * gnu/local.mk (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/ocaml.scm1
-rw-r--r--gnu/packages/patches/ocaml-multiple-definitions.patch43
3 files changed, 45 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index a0f320d0ae..8b75405661 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1485,6 +1485,7 @@ dist_patch_DATA = \
%D%/packages/patches/ocaml-dose3-Fix-for-ocaml-4.06.patch \
%D%/packages/patches/ocaml-dose3-dont-make-printconf.patch \
%D%/packages/patches/ocaml-dose3-Install-mli-cmx-etc.patch \
+ %D%/packages/patches/ocaml-multiple-definitions.patch \
%D%/packages/patches/omake-fix-non-determinism.patch \
%D%/packages/patches/oneko-remove-nonfree-characters.patch \
%D%/packages/patches/onnx-use-system-googletest.patch \
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 8137eb1187..92c1704c79 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -275,6 +275,7 @@ functional, imperative and object-oriented styles of programming.")
(sha256
(base32
"1f07hgj5k45cylj1q3k5mk8yi02cwzx849b1fwnwia8xlcfqpr6z"))
+ (patches (search-patches "ocaml-multiple-definitions.patch"))
(modules '((guix build utils)))
(snippet
`(begin
diff --git a/gnu/packages/patches/ocaml-multiple-definitions.patch b/gnu/packages/patches/ocaml-multiple-definitions.patch
new file mode 100644
index 0000000000..e8678f4f64
--- /dev/null
+++ b/gnu/packages/patches/ocaml-multiple-definitions.patch
@@ -0,0 +1,43 @@
+Avoid multiply-defined symbols that lead to link errors such as:
+
+ 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
+ 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
+
+diff --git a/asmrun/startup.c b/asmrun/startup.c
+index 070f0c6..cf8a56f 100644
+--- a/asmrun/startup.c
++++ b/asmrun/startup.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/byterun/backtrace.c b/byterun/backtrace.c
+index 8dfe9b7..9cc9e72 100644
+--- a/byterun/backtrace.c
++++ b/byterun/backtrace.c
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+diff --git a/byterun/backtrace_prim.c b/byterun/backtrace_prim.c
+index e69b256..d794f73 100644
+--- a/byterun/backtrace_prim.c
++++ b/byterun/backtrace_prim.c
+@@ -44,7 +44,7 @@
+ #include "caml/backtrace_prim.h"
+
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+
+ CAMLexport char_os * caml_cds_file = NULL;
+