janestreet / janestreet/core_bench

Linking with core_bench fails in a bytecode-only switch

Open
#17 9 comments 0 reactions 0 assignees View on GitHub
forwarded-to-js-devs
Dominant language
OCaml
Stars
57
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am unable to build a program that uses `core_bench` under OCaml 4.09.0+bytecode-only.

To reproduce the problem, the following instructions suffice:

```
git clone git@github.com:janestreet/core_bench.git
cd core_bench
git checkout v0.13.0
dune build @all
```

This produces the following output:

```
File "_none_", line 1:
Error: Error while linking /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/core.cma(Core__Linux_ext):
The external function `core_linux_timerfd_settime' is not available
ocamlc test/test_bench.exe (exit 2)
(cd _build/default && /home/fpottier/.opam/4.09.0+bytecode-only/bin/ocamlc -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o test/test_bench.exe -custom /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/base_internalhash_types/base_internalhash_types.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/base_internalhash_types /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/caml/caml.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/sexplib0/sexplib0.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/shadow_stdlib/shadow_stdlib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/base.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/base /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_compare/runtime-lib/ppx_compare_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_sexp_conv/runtime-lib/ppx_sexp_conv_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_hash/runtime-lib/ppx_hash_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_enumerate/runtime-lib/ppx_enumerate_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/fieldslib/fieldslib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_here/runtime-lib/ppx_here_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_assert/runtime-lib/ppx_assert_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_bench/runtime-lib/ppx_bench_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_inline_test/config/inline_test_config.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_inline_test/runtime-lib/ppx_inline_test_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/splittable_random/splittable_random.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base_quickcheck/base_quickcheck.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/md5/md5_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml/unix.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml/bigarray.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml /home/fpottier/.opam/4.09.0+bytecode-only/lib/variantslib/variantslib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/bin_prot/shape/bin_shape_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/bin_prot/bin_prot.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/bin_prot /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/config/expect_test_config.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/common/expect_test_common.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/collector/expect_test_collector.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/collector /home/fpottier/.opam/4.09.0+bytecode-only/lib/typerep/typerep_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/stdio/stdio.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/jane-street-headers/jane_street_headers.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/time_now/time_now.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/time_now /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_module_timer/runtime/ppx_module_timer_runtime.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base_bigstring/base_bigstring.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/base_bigstring /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/base_for_tests/base_for_tests.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/parsexp/parsexp.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/sexplib/sexplib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/core_kernel.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml/threads/threads.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/error_checking_mutex/error_checking_mutex.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/error_checking_mutex /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/bounded_int_table/bounded_int_table.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/flags/flags.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/version_util/version_util.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/version_util /home/fpottier/.opam/4.09.0+bytecode-only/lib/sexplib/unix/sexplib_unix.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/spawn/spawn.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/spawn /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/core.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core /home/fpottier/.opam/4.09.0+bytecode-only/lib/textutils/console/console.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/textutils/ascii_table/ascii_table.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/time_stamp_counter/time_stamp_counter.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/time_stamp_counter src/core_bench.cma test/.test_bench.eobjs/byte/allocation_tests.cmo test/.test_bench.eobjs/byte/array_tests.cmo test/.test_bench.eobjs/byte/basic_tests.cmo test/.test_bench.eobjs/byte/exception_tests.cmo test/.test_bench.eobjs/byte/gc_tests.cmo test/.test_bench.eobjs/byte/tsc.cmo test/.test_bench.eobjs/byte/tuple_tests.cmo test/.test_bench.eobjs/byte/test_bench.cmo)
/tmp/ccKRPh7s.o:(.data+0x2b78): undefined reference to `core_linux_timerfd_settime'
/tmp/ccKRPh7s.o:(.data+0x2b80): undefined reference to `core_linux_timerfd_gettime'
/tmp/ccKRPh7s.o:(.data+0x2b88): undefined reference to `core_linux_timerfd_create'
/tmp/ccKRPh7s.o:(.data+0x2bc0): undefined reference to `core_linux_timerfd_CLOCK_REALTIME'
/tmp/ccKRPh7s.o:(.data+0x2bc8): undefined reference to `core_linux_timerfd_CLOCK_MONOTONIC'
/tmp/ccKRPh7s.o:(.data+0x2bd0): undefined reference to `core_linux_timerfd_TFD_NONBLOCK'
/tmp/ccKRPh7s.o:(.data+0x2bd8): undefined reference to `core_linux_timerfd_TFD_CLOEXEC'
collect2: error: ld returned 1 exit status
File "_none_", line 1:
Error: Error while building custom runtime system
ocamlc test/mv_regr.exe (exit 2)
(cd _build/default && /home/fpottier/.opam/4.09.0+bytecode-only/bin/ocamlc -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o test/mv_regr.exe -custom /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/base_internalhash_types/base_internalhash_types.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/base_internalhash_types /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/caml/caml.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/sexplib0/sexplib0.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/shadow_stdlib/shadow_stdlib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/base.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/base /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_compare/runtime-lib/ppx_compare_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_sexp_conv/runtime-lib/ppx_sexp_conv_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_hash/runtime-lib/ppx_hash_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_enumerate/runtime-lib/ppx_enumerate_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/fieldslib/fieldslib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_here/runtime-lib/ppx_here_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_assert/runtime-lib/ppx_assert_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_bench/runtime-lib/ppx_bench_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_inline_test/config/inline_test_config.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_inline_test/runtime-lib/ppx_inline_test_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/splittable_random/splittable_random.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base_quickcheck/base_quickcheck.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base/md5/md5_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml/unix.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml/bigarray.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml /home/fpottier/.opam/4.09.0+bytecode-only/lib/variantslib/variantslib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/bin_prot/shape/bin_shape_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/bin_prot/bin_prot.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/bin_prot /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/config/expect_test_config.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/common/expect_test_common.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/collector/expect_test_collector.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_expect/collector /home/fpottier/.opam/4.09.0+bytecode-only/lib/typerep/typerep_lib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/stdio/stdio.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/jane-street-headers/jane_street_headers.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/time_now/time_now.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/time_now /home/fpottier/.opam/4.09.0+bytecode-only/lib/ppx_module_timer/runtime/ppx_module_timer_runtime.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/base_bigstring/base_bigstring.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/base_bigstring /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/base_for_tests/base_for_tests.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/parsexp/parsexp.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/sexplib/sexplib.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/core_kernel.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml/threads/threads.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/ocaml /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/error_checking_mutex/error_checking_mutex.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/error_checking_mutex /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/bounded_int_table/bounded_int_table.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/flags/flags.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/version_util/version_util.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core_kernel/version_util /home/fpottier/.opam/4.09.0+bytecode-only/lib/sexplib/unix/sexplib_unix.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/spawn/spawn.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/spawn /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/core.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core /home/fpottier/.opam/4.09.0+bytecode-only/lib/textutils/console/console.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/textutils/ascii_table/ascii_table.cma /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/time_stamp_counter/time_stamp_counter.cma -I /home/fpottier/.opam/4.09.0+bytecode-only/lib/core/time_stamp_counter src/core_bench.cma test/.test_bench.eobjs/byte/mv_regr.cmo)
/tmp/ccfrpcyq.o:(.data+0x2b78): undefined reference to `core_linux_timerfd_settime'
/tmp/ccfrpcyq.o:(.data+0x2b80): undefined reference to `core_linux_timerfd_gettime'
/tmp/ccfrpcyq.o:(.data+0x2b88): undefined reference to `core_linux_timerfd_create'
/tmp/ccfrpcyq.o:(.data+0x2bc0): undefined reference to `core_linux_timerfd_CLOCK_REALTIME'
/tmp/ccfrpcyq.o:(.data+0x2bc8): undefined reference to `core_linux_timerfd_CLOCK_MONOTONIC'
/tmp/ccfrpcyq.o:(.data+0x2bd0): undefined reference to `core_linux_timerfd_TFD_NONBLOCK'
/tmp/ccfrpcyq.o:(.data+0x2bd8): undefined reference to `core_linux_timerfd_TFD_CLOEXEC'
collect2: error: ld returned 1 exit status
File "_none_", line 1:
Error: Error while building custom runtime system
```

I am running Ubuntu LTS 16.04, in case that matters.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the documented git checkout and `dune build @all` under OCaml 4.09.0+bytecode-only. Trace how `core_linux_timerfd_*` is linked into the `core.cma` dependency and compare the failing custom bytecode link command. Done means the build completes without the undefined references.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.