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

B0_ocaml: linking c libraries fails in some configurations #12

Open
saagraa opened this issue Jun 14, 2023 · 0 comments
Open

B0_ocaml: linking c libraries fails in some configurations #12

saagraa opened this issue Jun 14, 2023 · 0 comments

Comments

@saagraa
Copy link

saagraa commented Jun 14, 2023

Apologies in advance, I'm not certain if this a problem with B0 or something else.

In this repo (https://github.com/saagraa/ocaml_linking_example) I have a few makefiles and a B0.ml file:

  • Makefile.b0 is in attempt to copy what B0 does
  • Makefile and Makefile.2 swap the order of the -cclib parameters. They exclusively use -cclib, whereas the b0 one uses -ccopt
  • Swapping the order of -cclib and -ccopt didn't impact the results in Makefile.b0.

I've got two systems:
System A:

  • Ubuntu
  • Linux 5.4
  • gcc 9.4
  • ld 2.34
  • Ocaml 4.14.1 (ocamlopt -config-var native_c_libraries => -lm -ldl)

System B

  • Void Linux
  • Linux 4.4
  • gcc 12.2
  • ld 2.39
  • Ocaml 4.14.1 (ocaml -config-var native_c_libraries => -lm)

On System A (older gcc/ld):

  • make works and links main
  • make -f Makefile.2 results in an ld error
  • make -f Makefile.b0 results in an ld error
  • b0 results in an ld error

On System B (newer gcc/ld):

  • make works and links main
  • make -f Makefile.2 works and links main
  • make -f Makefile.b0 works and links main
  • b0 works and links main

I'm guessing this is caused by some change from gcc 9.4 -> 12.2 and ld 2.34 -> 2.39. Nothing in the ld news file stands out to me though.

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

1 participant