alexcrichton / xz2-rs

Bindings to liblzma in Rust (xz streams in Rust)
Apache License 2.0
81 stars 52 forks source link

Fix static build on FreeBSD #123

Open artemist opened 6 months ago

artemist commented 6 months ago

Similar to the previous illumos issue (#61), FreeBSD does not expose gettimeofday with the set value of _POSIX_C_SOURCE. The same fix, configuring liblzma to use clock_gettime, works on FreeBSD.

It might be useful to extend this patch to also match other BSD (or even System V) derivatives but I have only tested this on FreeBSD.

UnitedMarsupials commented 3 months ago

Hi, @artemist. Perhaps, you can also offer a patch for the #125 -- to make sure, the system-provided -lzma is detected?

artemist commented 3 months ago

It's not an issue I've noticed, since I've been working on FreeBSD nix (same kernel and libc, but very different build environment).