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

Support the timerfd API on FreeBSD. #978

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunfishcode
Copy link
Member

FreeBSD has recently added support for Linux's timerfd API. Enable rustix's timerfd API on FreeBSD as well.

@sunfishcode
Copy link
Member Author

This depends on rust-lang/libc#3506.

@sunfishcode
Copy link
Member Author

This is failing on FreeBSD with:

error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/bin://.cargo/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustczpR8VD/symbols.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.139lfgpbdkhqqmdo.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.15p1tzoz9qlnt3bq.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.18q957d26miain23.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1963fsa1j92p5a33.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1dgv6s9ojlg1gqqa.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1dydp6g46s4ych55.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1eiwsbncc7xyb3q.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1g3w4oc04fvmsh27.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1kwdffwuz1fmve7a.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1l1u5seezzyh3v93.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1mfnfxnv9zl3h35u.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1mhqzq957509f0xc.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1o7kwx1tb1mht5sj.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.1sowfu3jurehyhzm.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.29dj0ueyu0lxdlbz.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2ak30tkfdykem731.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2avz09vpks4snjr3.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2az700sl0zy52txn.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2ibgzxabyi4wam1t.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2rtegb4istvv2fhb.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2umulpboukqbdgog.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2vrxqg6xvihj7may.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2xiq1h8jorvyoxvw.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.2zs9uf3o6z49z86e.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.322ujb691cqoifhd.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.32q5ot2ag0958v1.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.35p53vtzbzffckr.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.3d6bx0pd0hxlohgb.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.3elxd8djh620jp85.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.3g5gavauqjl61e36.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.3hy8p52td0ti42y2.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.3l5fimw2r61lgn20.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.3qwji58blzsosfxp.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.46h4o60ujfptctji.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.49phjpftbge0z0ox.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4ec2vio8hyxp5c98.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4geugc88wez5qdv.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4krll260jmk08tfe.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4oaxfpba2w0lak6q.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4ojdfc5jtvcsheqg.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4salya8mrv1webma.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4uv7fqxx9qcyg4a6.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.4zlw8ftxs5occ28e.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.56vkt0mf0q7aexro.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.57jutiupq2qfkbz8.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.5e3uop3mbcmmfww5.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.7jmrke0avrouqqu.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.7pwa7xbrkdta6qy.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.byhn1wf26z6qmth.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.dmswdu8ricpzblv.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.ds1rzz997cwgztw.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.fd7qu64pd5swc1l.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.ict6s2t2hu7z1zd.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.o967wsfqrvcmqaq.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.oqq5xnzs2urymfo.rcgu.o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9.399j9g6yuzztjepo.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cirrus-ci-build/target/debug/deps" "-L" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib" "-Wl,-Bstatic" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libtest-9531ab6f4defe7d3.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libgetopts-aec337e71e9b3b6c.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libunicode_width-0553d19e8f27aefc.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_std-f82d0a6256584235.rlib" "/tmp/cirrus-ci-build/target/debug/deps/librustix-2dfb775e25876807.rlib" "/tmp/cirrus-ci-build/target/debug/deps/libitoa-4afeac15cde65a97.rlib" "/tmp/cirrus-ci-build/target/debug/deps/liberrno-bd77780a506e0d0b.rlib" "/tmp/cirrus-ci-build/target/debug/deps/libbitflags-bb0ba36f6f40c1df.rlib" "/tmp/cirrus-ci-build/target/debug/deps/liblibc-03c4332a31c83022.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd-0d6964a847d65faf.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libpanic_unwind-8efc99ad55c82a5f.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libobject-af9806ed9ecba529.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libmemchr-41a7571ab28423af.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libaddr2line-70ef4e5cbc6c1f57.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libgimli-86cd0731a548ff19.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_demangle-07e138f618d7ec85.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libstd_detect-5f9230f5aa9a510a.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libhashbrown-51f769e72f79a229.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_alloc-1c738da014ae4394.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libminiz_oxide-fc464bf8dab9ab96.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libadler-54d69bc6178e3b45.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libunwind-0ad5fa639536d228.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcfg_if-137bdb893293f6c2.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/liblibc-2a7dee2d5af6d62a.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/liballoc-2c0247338c2ff708.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/librustc_std_workspace_core-cfc5f31e215c9308.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcore-6913833f09e2a106.rlib" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib/libcompiler_builtins-a1048af6214be916.rlib" "-Wl,-Bdynamic" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lmemstat" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-lexecinfo" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lrt" "-lutil" "-lexecinfo" "-lkvm" "-lmemstat" "-lkvm" "-lutil" "-lprocstat" "-lrt" "-ldevstat" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/.rustup/toolchains/stable-x86_64-unknown-freebsd/lib/rustlib/x86_64-unknown-freebsd/lib" "-o" "/tmp/cirrus-ci-build/target/debug/deps/time-1964614b6a1ef6f9" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: ld: error: undefined symbol: timerfd_create
          >>> referenced by syscalls.rs:284 (src/backend/libc/time/syscalls.rs:284)
          >>>               rustix-2dfb775e25876807.3mck5smmlo70tska.rcgu.o:(rustix::backend::time::syscalls::timerfd_create::h8d17af26c77400ea) in archive /tmp/cirrus-ci-build/target/debug/deps/librustix-2dfb775e25876807.rlib
          
          ld: error: undefined symbol: timerfd_settime
          >>> referenced by syscalls.rs:318 (src/backend/libc/time/syscalls.rs:318)
          >>>               rustix-2dfb775e25876807.3mck5smmlo70tska.rcgu.o:(rustix::backend::time::syscalls::timerfd_settime::h3d8703122c817515) in archive /tmp/cirrus-ci-build/target/debug/deps/librustix-2dfb775e25876807.rlib
          
          ld: error: undefined symbol: timerfd_gettime
          >>> referenced by syscalls.rs:418 (src/backend/libc/time/syscalls.rs:418)
          >>>               rustix-2dfb775e25876807.3mck5smmlo70tska.rcgu.o:(rustix::backend::time::syscalls::timerfd_gettime::hb99d751eb7dfea2d) in archive /tmp/cirrus-ci-build/target/debug/deps/librustix-2dfb775e25876807.rlib
          cc: error: linker command failed with exit code 1 (use -v to see invocation)

FreeBSD has recently added support for Linux's timerfd API. Enable
rustix's timerfd API on FreeBSD as well.
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