Closed hannesm closed 2 months ago
This error is occurring because of the 4.14.2 release. The FreeBSD base images have been updated to 4.14.2, but OCaml-CI still needs to. I am working on updating the various elements at the moment.
Thanks for your reply. The OCaml 5 failure, is this expected on FreeBSD? I have not seen it earlier.
An example successful build and run with OCaml-CI from last week (where likely FreeBSD 13 was used): https://ocaml.ci.dev/github/mirage/mirage-crypto/commit/61721c270d4cbd3222950dc21632d88eb69be339/variant/freebsd-5.1_opam-2.1
We now have the OCaml 4.14.2 base images and support in OCaml CI. I now see the same linking error in 4.14.2 as we are seeing in 5.1.1. I can reproduce the issue within the FreeBSD 14.0p5 jail, by downloading core_unix and building a test sample of just let _ = Linux_ext.Timerfd.create
.
~/core_unix-v0.16.0 $ dune exec --release -- bin/test.exe
....
ld: error: undefined symbol: core_linux_timerfd_create
>>> referenced by linux_ext.o:(.text+0x39FD) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32D0) in archive linux_ext/src/linux_ext.a
ld: error: undefined symbol: core_linux_timerfd_settime
>>> referenced by linux_ext.o:(.text+0x3C61) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.text+0x3F41) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32C8) in archive linux_ext/src/linux_ext.a
ld: error: undefined symbol: core_linux_timerfd_gettime
>>> referenced by linux_ext.o:(.text+0x3E9A) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32C0) in archive linux_ext/src/linux_ext.a
ld: error: undefined symbol: core_linux_timerfd_CLOCK_REALTIME
>>> referenced by linux_ext.o:(.text+0x7364) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32F0) in archive linux_ext/src/linux_ext.a
ld: error: undefined symbol: core_linux_timerfd_CLOCK_MONOTONIC
>>> referenced by linux_ext.o:(.text+0x737E) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32E8) in archive linux_ext/src/linux_ext.a
ld: error: undefined symbol: core_linux_timerfd_TFD_NONBLOCK
>>> referenced by linux_ext.o:(.text+0x7430) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32E0) in archive linux_ext/src/linux_ext.a
ld: error: undefined symbol: core_linux_timerfd_TFD_CLOEXEC
>>> referenced by linux_ext.o:(.text+0x7449) in archive linux_ext/src/linux_ext.a
>>> referenced by linux_ext.o:(.data+0x32D8) in archive linux_ext/src/linux_ext.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
I will continue to investigate.
The configuration of core_unix is performed using jst-config, which tests the system functionality using small C programs. One of these is
#include <sys/timerfd.h>
int main()
{
timerfd_create(0, 0);
return 0;
}
This defines JSC_TIMERFD
in config.h
.
On both of the FreeBSD 14 systems, there is a header called sys/timerfd.h
. If I rename/move this header, JSC_TIMERFD
is not defined and the test code builds successfully.
In the FreeBSD 14 blog it says
New efforts to enhance interoperability with Linux represent an interesting shift in direction for FreeBSD. FreeBSD 14 makes it easier for users to port applications and programs from Linux to FreeBSD, or vice versa. In this area, a number of utilities have been added to FreeBSD 14, including an nproc(1) utility, compatible with the Linux program of the same name, native timerfd(2) facility to enable porting of Linux programs that use timerfd, and a netlink(4) utility for further compatibility with Linux.
Thanks for your investigations -- sounds like there should be an issue (and potential fix for core_unix).
Testing with mirage-crypto... these commands run the tests successfully:
sudo mv /usr/include/sys/timerfd.h /usr/include/sys/timerfd.h.bak
opam switch create . 5.1.1 --deps-only --with-test -y
opam exec -- dune build @install @check @runtest
Since the issue is not in ocaml-ci, and it has been reported upstream, I'm closing this issue.
Dear Madam or Sir,
thanks for providing this CI system. I encounter various failures that are FreeBSD related:
https://ocaml.ci.dev/github/mirage/mirage-crypto/commit/c7c4eb58a6aca2a316b9f1883f02a29e52238768/variant/freebsd-4.14_opam-2.1
And https://ocaml.ci.dev/github/mirage/mirage-crypto/commit/c7c4eb58a6aca2a316b9f1883f02a29e52238768/variant/freebsd-5.1_opam-2.1