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

Openbsd fails to build ocaml 5.20, 4.14.2 etc. on a fresh install #26181

Open
MarcCoquand opened this issue Jul 2, 2024 · 2 comments
Open

Openbsd fails to build ocaml 5.20, 4.14.2 etc. on a fresh install #26181

MarcCoquand opened this issue Jul 2, 2024 · 2 comments

Comments

@MarcCoquand
Copy link

If your issue concerns a package not building, please report to
https://github.com/ocaml/opam-repository/issues or to the package maintainer
unless you are confident it is an issue in the opam tool itself.
If your issue concerns failures with the opam.ocaml.org website, please report to
https://github.com/ocaml/infrastructure/issues

# opam config report
# opam-version      2.0.10 
# self-upgrade      no
# system            arch=x86_64 os=openbsd os-distribution=openbsd os-version=7.5
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              1
# repositories      1 (http) (default repo at 175a8ca8)
# pinned            0
# current-switch    default

opam init and opam switch create 4.14.2 fails on a fresh Openbsd install.

 #=== ERROR while compiling ocaml-base-compiler.4.14.2 =========================#                                             
# context     2.0.10 | openbsd/x86_64 |  | https://opam.ocaml.org#175a8ca8                                                   
# path        ~/.opam/4.14.2/.opam-switch/build/ocaml-base-compiler.4.14.2                                                   
# command     /usr/local/bin/gmake -j1                                                                                       
# exit-code   2                                                                                                              
# env-file    ~/.opam/log/ocaml-base-compiler-19142-1872ec.env                                                               
# output-file ~/.opam/log/ocaml-base-compiler-19142-1872ec.out                                                              
### output ###                                                                                                              
# [...]                                                                                                                     
# ../../ocamlc.opt -g -nostdlib -I ../../stdlib -c -strict-sequence -principal -                                             absname -w +a-4-9-40-41-42-44-45-48-66-70 -warn-error +A -bin-annot -safe-string                                              -strict-formats -I byte extract_crc.ml
# ../../ocamlc.opt -g -nostdlib -I ../../stdlib -o extract_crc dynlink.cma byte/dynlink_compilerlibs.cmo extract_crc.cmo
# gmake[4]: *** [Makefile:239: extract_crc] Segmentation fault (core dumped)
# gmake[4]: *** Deleting file 'extract_crc'
# gmake[4]: Leaving directory '/home/mccd/.opam/4.14.2/.opam-switch/build/ocaml-base-compiler.4.14.2/otherlibs/dynlink'
# gmake[3]: *** [Makefile:34: all] Error 2
# gmake[3]: Leaving directory '/home/mccd/.opam/4.14.2/.opam-switch/build/ocaml-base-compiler.4.14.2/otherlibs'
# gmake[2]: *** [Makefile:962: otherlibraries] Error 2
# gmake[2]: Leaving directory '/home/mccd/.opam/4.14.2/.opam-switch/build/ocaml-base-compiler.4.14.2'
# gmake[1]: *** [Makefile:253: opt.opt] Error 2
# gmake[1]: Leaving directory '/home/mccd/.opam/4.14.2/.opam-switch/build/ocaml-base-compiler.4.14.2'
# gmake: *** [Makefile:314: world.opt] Error 2
@kit-ty-kate kit-ty-kate transferred this issue from ocaml/opam Jul 2, 2024
@kit-ty-kate
Copy link
Member

I'm unable to reproduce with a similar setup (OpenBSD 7.5 / x86_64), for me the compiler compiled just fine.
And while your version of opam is extremely outdated, it is not failing in opam but during the compilation so it is unrelated to opam itself.

Are you able to reproduce if you try to compile the compiler by hand? And if so are you able to get a stacktrace to be able to see where it's segfaulting?

@avsm
Copy link
Member

avsm commented Jul 17, 2024

You'll need to apply ocaml/ocaml#13023 -- you almost certainly have a modern Intel CPU that's enforcing control flow integrity.

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

3 participants