https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92673

            Bug ID: 92673
           Summary: OCaml fails to link with recent trunk
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

I tested both OCaml 4.02.3 and 4.09.0. For both, linking with gcc 10.0, your
development version r278668 svn://gcc.gnu.org/svn/gcc fails (cf. below). This
problem was observed both on Debian Linux as well as on MacOSX. I don't know
whether this is a regression on the side of the linker of gcc, or the linker
has become stricter, and there is some sloppyness in the build/link system of
OCaml. I reported this also with the OCaml development team:
https://github.com/ocaml/ocaml/issues/9144
gcc information:
Path: /usr/local/packages/gcc_10.0
Working Copy Root Path: /usr/local/packages/gcc_10.0
URL: svn://gcc.gnu.org/svn/gcc/trunk
Relative URL: ^/trunk
Repository Root: svn://gcc.gnu.org/svn/gcc
Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4
Revision: 278668
Node Kind: directory
Schedule: normal
Last Changed Author: gjl
Last Changed Rev: 278668
Last Changed Date: 2019-11-25 09:59:06 +0100 (Mon, 25 Nov 2019)

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin18.7.0/10.0.0/lto-wrapper
Target: x86_64-apple-darwin18.7.0
Configured with: ../configure --prefix=/usr/local/ --with-gmp=/usr/local/
--with-mpfr=/usr/local/ --with-mpc=/usr/local/ --enable-checking=release
--enable-languages=c,c++,fortran,lto
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.0.0 20191125 (experimental) (GCC) 



4.02.3:
gcc -Wl,-no_compact_unwind -o ocamlrun
prims.o libcamlrun.a -lcurses -lpthread
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(fix_code.o)
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(startup.o)
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(ints.o)
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(extern.o)
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(intern.o)
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(meta.o)
duplicate symbol '_caml_code_fragments_table' in:
libcamlrun.a(backtrace.o)
libcamlrun.a(debugger.o)
ld: 7 duplicate symbols for architecture x86_64
collect2: error: ld returned 1 exit status

4.09.0:
gcc -shared -flat_namespace -undefined suppress -Wl,-no_compact_unwind -o
libcamlrun_shared.so interp_bpic.o misc_bpic.o stacks_bpic.o fix_code_bpic.o
startup_aux_bpic.o startup_byt_bpic.o freelist_bpic.o major_gc_bpic.o
minor_gc_bpic.o memory_bpic.o alloc_bpic.o roots_byt_bpic.o globroots_bpic.o
fail_byt_bpic.o signals_bpic.o signals_byt_bpic.o printexc_bpic.o
backtrace_byt_bpic.o backtrace_bpic.o compare_bpic.o ints_bpic.o floats_bpic.o
str_bpic.o array_bpic.o io_bpic.o extern_bpic.o intern_bpic.o hash_bpic.o
sys_bpic.o meta_bpic.o parsing_bpic.o gc_ctrl_bpic.o md5_bpic.o obj_bpic.o
lexing_bpic.o callback_bpic.o debugger_bpic.o weak_bpic.o compact_bpic.o
finalise_bpic.o custom_bpic.o dynlink_bpic.o spacetime_byt_bpic.o afl_bpic.o
unix_bpic.o bigarray_bpic.o main_bpic.o -lm -lpthread
duplicate symbol '_caml_debug_info' in:
backtrace_byt_bpic.o
backtrace_bpic.o
ld: 1 duplicate symbol for architecture x86_64
collect2: error: ld returned 1 exit status

Reply via email to