guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: ocaml@4.09: Fix link failure.


From: guix-commits
Subject: 03/03: gnu: ocaml@4.09: Fix link failure.
Date: Thu, 5 Aug 2021 09:47:16 -0400 (EDT)

civodul pushed a commit to branch core-updates-frozen
in repository guix.

commit 058b339d31dd0553f6736920a0dad68660728113
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Aug 5 15:45:56 2021 +0200

    gnu: ocaml@4.09: Fix link failure.
    
    * gnu/packages/patches/ocaml-4.09-multiple-definitions.patch: New file.
    * gnu/packages/ocaml.scm (ocaml-4.09)[source]: Use it.
    * gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/ocaml.scm                             |  1 +
 .../patches/ocaml-4.09-multiple-definitions.patch  | 41 ++++++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 8b75405..5e5dd0b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1486,6 +1486,7 @@ dist_patch_DATA =                                         
\
   %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/ocaml-4.09-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 e9c1fd7..73ff9ab 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -254,6 +254,7 @@ functional, imperative and object-oriented styles of 
programming.")
                     "http://caml.inria.fr/pub/distrib/ocaml-";
                     (version-major+minor version)
                     "/ocaml-" version ".tar.xz"))
+              (patches (search-patches 
"ocaml-4.09-multiple-definitions.patch"))
               (sha256
                (base32
                 "1v3z5ar326f3hzvpfljg4xj8b9lmbrl53fn57yih1bkbx3gr3yzj"))))))
diff --git a/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch 
b/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch
new file mode 100644
index 0000000..b2661f8
--- /dev/null
+++ b/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch
@@ -0,0 +1,41 @@
+Avoid multiply-defined symbols that lead to link errors such as:
+
+  ld: 
libcamlrund.a(backtrace_bd.o):/tmp/guix-build-ocaml-4.09.0.drv-0/ocaml-4.09.0/runtime/backtrace.c:31:
 multiple definition of `caml_debug_info'; 
libcamlrund.a(backtrace_byt_bd.o):/tmp/guix-build-ocaml-4.09.0.drv-0/ocaml-4.09.0/runtime/backtrace_byt.c:47:
 first defined here
+
+diff --git a/runtime/backtrace.c b/runtime/backtrace.c
+index a3c2c08..f57c81c 100644
+--- a/runtime/backtrace.c
++++ b/runtime/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/runtime/backtrace_byt.c b/runtime/backtrace_byt.c
+index b913dac..b5ec926 100644
+--- a/runtime/backtrace_byt.c
++++ b/runtime/backtrace_byt.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;
+ 
+diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c
+index b4e6bc4..7eca5fa 100644
+--- a/runtime/startup_nat.c
++++ b/runtime/startup_nat.c
+@@ -44,6 +44,5 @@
+ #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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]