Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install merlin with opam with gcc14 #1774

Open
MizurenNanako opened this issue May 25, 2024 · 1 comment
Open

Failed to install merlin with opam with gcc14 #1774

MizurenNanako opened this issue May 25, 2024 · 1 comment

Comments

@MizurenNanako
Copy link

On Archlinux, with gcc14, trying to install merlin through opam, got this:

seems the problem is due to lto1 and passing -no-lto to gcc might solve it, but how can I pass some LDFLAGS to opam?

The following actions will be performed:
  ∗ install dot-merlin-reader 4.9      [required by merlin]
  ∗ install merlin            4.14-501
===== ∗ 2 =====
Do you want to continue? [Y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved dot-merlin-reader.4.9  (cached)
⬇ retrieved merlin.4.14-501  (cached)
[ERROR] The compilation of dot-merlin-reader.4.9 failed at "dune build -p dot-merlin-reader -j 7".

#=== ERROR while compiling dot-merlin-reader.4.9 ==============================#
# context     2.1.5 | linux/x86_64 | ocaml.5.1.1 | https://opam.ocaml.org#6ed19e32
# path        ~/.opam/default/.opam-switch/build/dot-merlin-reader.4.9
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p dot-merlin-reader -j 7
# exit-code   1
# env-file    ~/.opam/log/dot-merlin-reader-4609-4dc677.env
# output-file ~/.opam/log/dot-merlin-reader-4609-4dc677.out
### output ###
# [...]
# File "src/dot-merlin/dune", line 3, characters 7-24:
# 3 |  (name dot_merlin_reader)
#            ^^^^^^^^^^^^^^^^^
# (cd _build/default && /usr/bin/ocamlopt.opt -w -40 -g -o src/dot-merlin/dot_merlin_reader.exe /home/***/.opam/default/lib/findlib/findlib.cmxa /usr/lib/ocaml/str/str.cmxa /usr/lib/ocaml/unix/unix.cmxa /home/***/.opam/default/lib/merlin-lib/utils/merlin_utils.cmxa -I /home/***/.opam/default/lib/merlin-lib/utils /home/***/.opam/default/lib/csexp/csexp.cmxa /home/***/.opam/default/lib/merlin-lib[...]
# lto1: fatal error: bytecode stream in file ‘/home/***/.opam/default/lib/merlin-lib/utils/libmerlin_utils_stubs.a’ generated with LTO version 13.1 instead of the expected 14.0
# compilation terminated.
# lto-wrapper: fatal error: gcc returned 1 exit status
# compilation terminated.
# /usr/bin/ld: error: lto-wrapper failed
# collect2: error: ld returned 1 exit status
# File "caml_startup", line 1:
# Error: Error during linking (exit code 1)



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build dot-merlin-reader 4.9
└─ 
╶─ No changes have been performed
@sidkshatriya
Copy link
Contributor

Is it that you were working on an ocaml project with gcc 13 then upgraded your Arch Linux and now you have gcc 14 ?

It's possible that gcc does not like working with gcc 13 and gcc 14 artifacts mixed together. Have you tried creating a fresh opam switch and tried to install merlin in it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants