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

Fix inclusion of makedev in Linux on glibc 2.26 #114

Closed
wants to merge 1 commit into from
Closed

Fix inclusion of makedev in Linux on glibc 2.26 #114

wants to merge 1 commit into from

Conversation

dark
Copy link

@dark dark commented Jul 21, 2018

While using core.v0.11.1 with the 4.06.1 release of ocaml, installed
via opam on a Gentoo Linux install with glibc 2.26, linking of ocaml
binaries fails with:

 [...]/.opam/4.06.1/lib/core/libcore_stubs.a(unix_stubs.o): In function `unix_mknod_stub':
 [...]/.opam/4.06.1/build/core.v0.11.1/_build/default/src/unix_stubs.c:281: undefined reference to `makedev'
 collect2: error: ld returned 1 exit status
 File "caml_startup", line 1:
 Error: Error during linking
 Command exited with code 2.

Glibc had traditionally supported the BSD way of including makedev via
<sys/types.h>, but 2.25 has deprecated this behavior. The macro is now
imported via <sys/sysmacros.h>.

I have tested compilation of this patch both on Linux and MacOS 10.13,
but on top of the v0.11 branch; master is broken for me due to #110. I
have replaced the libcore_stubs.a in my opam installation with the
fixed one, and the 'undefined reference' error disappeared.

Signed-off-by: Marco Leogrande dark.knight.ita@gmail.com

While using core.v0.11.1 with the 4.06.1 release of ocaml, installed
via opam on a Gentoo Linux install with glibc 2.26, linking of ocaml
binaries fails with:

 [...]/.opam/4.06.1/lib/core/libcore_stubs.a(unix_stubs.o): In function `unix_mknod_stub':
 [...]/.opam/4.06.1/build/core.v0.11.1/_build/default/src/unix_stubs.c:281: undefined reference to `makedev'
 collect2: error: ld returned 1 exit status
 File "caml_startup", line 1:
 Error: Error during linking
 Command exited with code 2.

Glibc had traditionally supported the BSD way of including makedev via
<sys/types.h>, but 2.25 has deprecated this behavior. The macro is now
imported via <sys/sysmacros.h>.

I have tested compilation of this patch both on Linux and MacOS 10.13,
but on top of the v0.11 branch; master is broken for me due to #110. I
have replaced the libcore_stubs.a in my opam installation with the
fixed one, and the 'undefined reference' error disappeared.

Signed-off-by: Marco Leogrande <dark.knight.ita@gmail.com>
@ghost
Copy link

ghost commented Aug 6, 2018

Thanks, I added this patch to our internal review system

@copy copy mentioned this pull request Aug 21, 2018
@ghost
Copy link

ghost commented Aug 21, 2018

Sorry, we normally have a system to track changes that come from github so that we remember to click the merge button on github, but I missed a step in the process.

This change has now been integrated internally and was pushed back to github.

@ghost ghost closed this Aug 21, 2018
@dark dark deleted the makedev branch August 22, 2018 09:29
@dark
Copy link
Author

dark commented Aug 22, 2018

No problem, thanks for approving the change!

This pull request was closed.
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

Successfully merging this pull request may close these issues.

1 participant