1 Matching Annotations
  1. Apr 2025
    1. opam switch create cs3110-2025sp ocaml-base-compiler.5.2.0

      I'm on MacOS x86_64 and the following error occurs:

      ```

      === ERROR while compiling ocaml-base-compiler.5.2.0 ==========================

      context 2.3.0 | macos/x86_64 | | https://opam.ocaml.org#8106bcf57fc33218275bbf0d02e725f4e9fcd0f6

      path ~/.opam/cs3110-2025sp/.opam-switch/build/ocaml-base-compiler.5.2.0

      command ~/.opam/opam-init/hooks/sandbox.sh build make -j7

      exit-code 2

      env-file ~/.opam/log/ocaml-base-compiler-68106-48fec6.env

      output-file ~/.opam/log/ocaml-base-compiler-68106-48fec6.out

      output

      /Library/Developer/CommandLineTools/usr/bin/make coldstart

      [...]

      CC runtime/fail_byt.b.o

      CC runtime/fix_code.b.o

      CC runtime/interp.b.o

      CC runtime/startup_byt.b.o

      CC runtime/zstd.b.o

      MKLIB runtime/libcamlrun.a

      MKEXE runtime/ocamlrun

      ld: archive member '/' not a mach-o file in 'runtime/libcamlrun.a'

      clang: error: linker command failed with exit code 1 (use -v to see invocation)

      make[1]: *** [runtime/ocamlrun] Error 1

      make: *** [world.opt] Error 2

      ```

      I solved this by uninstalling GNU binutils with brew following this stackoverflow question.