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

Fix CurTransMat::combine_matrix for arm-unknown-linux-gnueabi #173

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Fix CurTransMat::combine_matrix for arm-unknown-linux-gnueabi #173

merged 1 commit into from
Mar 13, 2024

Conversation

vklachkov
Copy link
Contributor

Thanks for the library!

I tried to use it on a Raspberry Pi Zero and got incorrect PDF files. After some research, it turned out that CurTransMat::combine_matrix does not work on the target arm-unknown-linux-gnueabi due to a bug in Rust compiler.

This MR implements a workaround.

The only problem is that Rust currently doesn't support cfg(target) and therefore this workaround will also apply to all ARMs, regardless. But this shouldn't be a problem. If accuracy and performance are very important, I will make this fix an optional feature.

Method uses f32::mul_add which is completely broken on this target.
See Rust issue rust-lang/rust#46950.

The workaround is less accurate than f32::mul_add, but works correctly.
@fschutt fschutt merged commit 166e5f7 into fschutt:master Mar 13, 2024
1 check failed
@fschutt
Copy link
Owner

fschutt commented Mar 13, 2024

Well that's a new one, lol. PDFs not working due to a compiler bug. Thanks for debugging!

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