Skip to content

Compilation of runtime4 on main fails with a recent gcc #4033

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

Open
Gbury opened this issue May 22, 2025 · 2 comments
Open

Compilation of runtime4 on main fails with a recent gcc #4033

Gbury opened this issue May 22, 2025 · 2 comments
Labels
bug Something isn't working runtime

Comments

@Gbury
Copy link
Contributor

Gbury commented May 22, 2025

Compiling on main from a fresh copy (or after a git clean -dfx) fails on my machine with the following log/errors:

File "runtime4/dune", line 61, characters 0-721:
61 | (rule
62 |  (targets
63 |   libasmrun.a
....
96 |     (run make "SAK_LINK=cc -o $(1) $(2)" COMPUTE_DEPS=false sak)
97 |     (run make -sj8 %{targets} COMPUTE_DEPS=false)
98 |     (bash "rm .depend")))))
  CC prims.o
prims.c:310:14: error: conflicting types for ‘caml_get_public_method’; have ‘value(void)’ {aka ‘long int(void)’}
  310 | extern value caml_get_public_method();
      |              ^~~~~~~~~~~~~~~~~~~~~~
In file included from prims.c:2:
caml/mlvalues.h:413:18: note: previous declaration of ‘caml_get_public_method’ with type ‘value(value,  value)’ {aka ‘long int(long int,  long int)’}
  413 | CAMLextern value caml_get_public_method (value obj, value tag);
      |                  ^~~~~~~~~~~~~~~~~~~~~~
prims.c:558:14: error: conflicting types for ‘caml_set_oo_id’; have ‘value(void)’ {aka ‘long int(void)’}
  558 | extern value caml_set_oo_id();
      |              ^~~~~~~~~~~~~~
caml/mlvalues.h:602:18: note: previous declaration of ‘caml_set_oo_id’ with type ‘value(value)’ {aka ‘long int(long int)’}
  602 | CAMLextern value caml_set_oo_id(value obj);
      |                  ^~~~~~~~~~~~~~
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
make[1]: *** [../Makefile.common:174: prims.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile.common-jst:82: runtime-stdlib] Error 1

From the looks of it, it may be because I have a too recent version of gcc (i.e. gcc (GCC) 15.1.1 20250425), and downgrading to gcc 14 solves the problem, but it's still annoying.

@Gbury Gbury added bug Something isn't working runtime labels May 22, 2025
@lthls
Copy link
Contributor

lthls commented May 22, 2025

Cross-ref: ocaml/ocaml#12700, which fixes the issue upstream and is already present in the default runtime (i.e. runtime5).

@lthls
Copy link
Contributor

lthls commented May 26, 2025

See also ocaml/ocaml#12577 which is 4.14 version of the patch, that may apply more cleanly on runtime4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime
Projects
None yet
Development

No branches or pull requests

2 participants