I want to install flow parser, so I need an OCaml older than 4.07.1. Unfortunately I cannot install it using opam in a local switch:
[ERROR] The compilation of ocaml-base-compiler failed at "/home/schmitta/.opam/opam-init/hooks/sandbox.sh build make -j7 world".
#=== ERROR while compiling ocaml-base-compiler.4.07.1 =========================#
# context 2.0.7 | linux/x86_64 | | https://opam.ocaml.org#2d5e1096
# path ~/work/skeletons/jskel/_opam/.opam-switch/build/ocaml-base-compiler.4.07.1
# command ~/.opam/opam-init/hooks/sandbox.sh build make -j7 world
# exit-code 2
# env-file ~/.opam/log/ocaml-base-compiler-8727-6d07ae.env
# output-file ~/.opam/log/ocaml-base-compiler-8727-6d07ae.out
### output ###
# (echo '#define CAML_INTERNALS'; \
# [...]
# sed -e 's/.*/ "&",/' primitives; \
# echo ' 0 };') > prims.c
# gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -fno-tree-vrp -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE prims.c
# 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
# /usr/bin/ld: libcamlruni.a(backtrace.i.o):/home/schmitta/work/skeletons/jskel/_opam/.opam-switch/build/ocaml-base-compiler.4.07.1/byterun/backtrace.c:31: multiple definition of `caml_debug_info'; libcamlruni.a(backtrace_prim.i.o):/home/schmitta/work/skeletons/jskel/_opam/.opam-switch/build/ocaml-base-compiler.4.07.1/byterun/backtrace_prim.c:47: first defined here
# rm -f libcamlrund.a && ar rc libcamlrund.a interp.d.o misc.d.o stacks.d.o fix_code.d.o startup_aux.d.o startup.d.o freelist.d.o major_gc.d.o minor_gc.d.o memory.d.o alloc.d.o roots.d.o globroots.d.o fail.d.o signals.d.o signals_byt.d.o printexc.d.o backtrace_prim.d.o backtrace.d.o compare.d.o ints.d.o floats.d.o str.d.o array.d.o io.d.o extern.d.o intern.d.o hash.d.o sys.d.o meta.d.o parsing[...]
# collect2: error: ld returned 1 exit status
# make[1]: *** [Makefile:199: ocamlruni] Error 1
# make[1]: *** Waiting for unfinished jobs....
# make[1]: Leaving directory '/home/schmitta/work/skeletons/jskel/_opam/.opam-switch/build/ocaml-base-compiler.4.07.1/byterun'
# make: *** [Makefile:389: coldstart] Error 2
I’m using gcc 10.1.0, so it might be related to https://github.com/ocaml/ocaml/issues/9144
Is there a way to work around this? Should I file a bug report?