ocaml / opam-repository

Main public package repository for opam, the source package manager of OCaml.
https://opam.ocaml.org
Creative Commons Zero v1.0 Universal
516 stars 1.12k forks source link

ld: archive member '/' not a mach-o file #26370

Closed NightProg closed 1 week ago

NightProg commented 4 weeks ago

Hello, I got this error:

[ERROR] The compilation of ocaml-base-compiler.5.2.0 failed at "make -j11".

#=== ERROR while compiling ocaml-base-compiler.5.2.0 ==========================#
# context     2.2.0 | macos/x86_64 |  | https://opam.ocaml.org#6eee105e52e098e36949a584c053a18bcb9b2f6b
# path        ~/.opam/ocaml-base-compiler/.opam-switch/build/ocaml-base-compiler.5.2.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j11
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-53039-010102.env
# output-file ~/.opam/log/ocaml-base-compiler-53039-010102.out
### output ###
# /Library/Developer/CommandLineTools/usr/bin/make coldstart
# [...]
#   CC runtime/fix_code.b.o
#   CC runtime/interp.b.o
#   CC runtime/startup_byt.b.o
#   CC runtime/zstd.b.o
#   CC runtime/prims.o
#   MKLIB runtime/libcamlrun.a
#   MKEXE runtime/ocamlrun
# ld: archive member '/' not a mach-o file in '/Users/antoine/.opam/ocaml-base-compiler/.opam-switch/build/ocaml-base-compiler.5.2.0/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

after executing opam init -y. does i do something wrong or its just a ocaml / opam problem ? Have a good day

dbuenzli commented 3 weeks ago

Do you happen to have something like binutils or gcc installed via brew in your PATH ? If that's the case that may be the problem. Issue either of (assuming you are using brew):

brew unlink bintutils
brew unlink gcc 

and try again.

NightProg commented 1 week ago

Thanks you so much yeah it worked