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

Vendored libusb does not work on older versions of macOS (below 10.12). #94

Open
sourcebox opened this issue Jul 29, 2021 · 6 comments
Open

Comments

@sourcebox
Copy link

This is mainly related to the clock_gettime() function which is not available before macOS 10.12. On the other hand, libusb can be compiled on older systems (I tested 10.11) via Homebrew.

There is a define HAVE_CLOCK_GETTIME which is always set to 1 in the build.rs of the libusb1-sys, so it will fail on macOS 10.11 and below.

@a1ien
Copy link
Owner

a1ien commented Jul 29, 2021

Hmmm.., i think we need some patch build.rs to use Xcode/config.h when build libusb for macOS. And not broke other build)

@sourcebox
Copy link
Author

There's also one case to consider: compiling on older macOS may work by setting HAVE_CLOCK_GETTIME to 0 on these OSs. But if you compile on macOS 10.12 or higher, the executable will not work on those older systems. Maybe by setting HAVE_CLOCK_GETTIME to 0 then also, but what is the impact on doing this?

@sourcebox
Copy link
Author

Maybe making the HAVE_CLOCK_GETTIME dependent of MACOSX_DEPLOYMENT_TARGET is an option.

@a1ien
Copy link
Owner

a1ien commented Jul 29, 2021

I very little knowledge about macOs. So if want add support on older mac I am ask for PR. Because i not have any device with macOs for testing

@sourcebox
Copy link
Author

I'll have a look at this at some point, but it can take a while.

@mcuee
Copy link

mcuee commented Apr 30, 2023

I am not so sure if it is just HAVE_CLOCK_GETTIME, maybe there are others.
Ref: a potential example which may or may not matter for rusb.

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

No branches or pull requests

3 participants