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

Make macOS static libraries thin for linking #64

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

Conversation

KoviRobi
Copy link

This just used

lipo libftd2xx.a -thin x86_64 -output x86_64/libftd2xx.a
lipo libftd2xx.a -thin arm64 -output arm64/libftd2xx.a

See rust-lang/cargo#8875 (comment)

This just used

    lipo libftd2xx.a -thin x86_64 -output x86_64/libftd2xx.a
    lipo libftd2xx.a -thin arm64 -output arm64/libftd2xx.a

See rust-lang/cargo#8875 (comment)
@KoviRobi
Copy link
Author

Looks like this might be fixed in the future rust-lang/rust#55235

@newAM
Copy link
Member

newAM commented Dec 14, 2022

Thanks!

Would it be possible to generate these in the build.rs script? That makes it easier to maintain when the vendor libraries update. As far as I know it is impossible to cross-compile this for an Apple target from Windows or Linux; I don't think it would cause anything to break to assume that the compilation host will have the Apple developer tools installed.

Also, just to make sure I read those issues correctly, this solves an error that appears when trying to compile into a rust library?

@KoviRobi
Copy link
Author

Yeah good point, it should be possible to compile at build time, I'll have to look into it maybe over the weekend. But also, there is llvm-lipo, though I haven't figured out how to link to macOS yet -- though somehow zig manages it. And yeah the crate builds fine , it's at the final linking step you have this problem.

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.

2 participants