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

building 4.08.1 fails on fedora-32 #9540

Closed
xaki23 opened this issue May 7, 2020 · 6 comments
Closed

building 4.08.1 fails on fedora-32 #9540

xaki23 opened this issue May 7, 2020 · 6 comments

Comments

@xaki23
Copy link

xaki23 commented May 7, 2020

"found" while trying to build mirage-firewall.
seems like a gray area between "opam" and "ocaml", but @hannesm pointed me here.

switch create 4.08.1 fails on fedora-32 (gcc 10.0.1 and system-ocaml 4.10 )

# gcc -shared -o libcamlrun_shared.so interp_bpic.o misc_bpic.o stacks_bpic.o fix_code_bpic.o startup_aux_bpic.o startup_byt_bpic.o freelist_bpic.o major_gc_bpic.o minor_gc_bpic.o memory_bpic.o alloc_bpic.o roots_byt_bpic.o globroots_bpic.o fail_byt_bpic.o signals_bpic.o signals_byt_bpic.o printexc_bpic.o backtrace_byt_bpic.o backtrace_bpic.o compare_bpic.o ints_bpic.o floats_bpic.o str_bpic.o [...]
# /usr/bin/ld: backtrace_bpic.o:/home/user/.opam/mirage-firewall-4.08.1/.opam-switch/build/ocaml-base-compiler.4.08.1/runtime/backtrace.c:31: multiple definition of `caml_debug_info'; backtrace_byt_bpic.o:/home/user/.opam/mirage-firewall-4.08.1/.opam-switch/build/ocaml-base-compiler.4.08.1/runtime/backtrace_byt.c:47: first defined here
# collect2: error: ld returned 1 exit status
# make[1]: *** [Makefile:310: libcamlrun_shared.so] Error 1
# make[1]: Leaving directory '/home/user/.opam/mirage-firewall-4.08.1/.opam-switch/build/ocaml-base-compiler.4.08.1/runtime'
# make: *** [Makefile:323: coldstart] Error 2
@XVilka
Copy link
Contributor

XVilka commented May 7, 2020

It's a problem of -fno-common with GCC 10, I suspect: https://gcc.gnu.org/gcc-10/porting_to.html

See the respective commit in OCaml 06db4c9

@xavierleroy
Copy link
Contributor

The issue was fixed in OCaml 4.09.1 and 4.10.0. Could you use one of those versions instead of 4.08.1?

@xavierleroy
Copy link
Contributor

Looks like the answer is "yes": mirage/qubes-mirage-firewall#96 (comment)

@psafont
Copy link
Contributor

psafont commented Jun 17, 2020

Are there any other workarounds for allowing 4.08.1 switches to be created using the latest version of gcc?

This is going to be painful for Citrix engineers as 4.08.1 is used in supported releases and it's meant to be supported for years.

@Octachron
Copy link
Member

We are planning to publish updated opam packages for older OCaml versions with an explicit -fcommon flag.

See ocaml/opam-repository#16583 .

The easy path is to compile with CC="cc -fcommon". This has the unfortunate effect on turning off a de-optimization (-fno-tree-vrp) for gcc that is here as a workaround for an intel sky lake bug.

We willl publish the patched opam packages once this last wrinkle is figured out.

@glondu
Copy link
Contributor

glondu commented Jul 27, 2020

In Debian, I applied this patch, but the package FTBFS at the moment because of #9800 .

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

6 participants