Skip to content

Support long double intrinsics in any aarch64 linux #429

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

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

richkadel
Copy link
Contributor

Expands the support added in #377 from just musl to any linux.

Fixes #428

@richkadel
Copy link
Contributor Author

@alexcrichton - Here's the PR I proposed in zulip.

cc: @tmandry @petrhosek

@richkadel
Copy link
Contributor Author

richkadel commented Jul 14, 2021

@Amanieu - Alex referred me to you for reviewing this change. Do you have time to take a look at this?

(There is some urgency for resolving this for Fuchsia, so I appreciate any help you can provide. Thank you!)

@Amanieu
Copy link
Member

Amanieu commented Jul 14, 2021

Arguably this should apply to all targets using aarch64, so we can just go ahead and remove the if. Looking at compiler-rt's CMakeLists.txt shows that the *tf intrinsics are always included.

@richkadel
Copy link
Contributor Author

richkadel commented Jul 14, 2021

I just pushed an amended commit to address the CI error:

checking /target/aarch64-unknown-linux-gnu/debug/deps/libcompiler_builtins-9c67e34fdec82140.rlib for duplicate symbols
================================================================
0000000000000000 T __fe_getround
0000000000000000 T __fe_raise_inexact
Error: Process completed with exit code 1.

I wasn't sure if I should include the entire block from the musl condition or not, but apparently those symbols should be in the musl condition only.

@richkadel
Copy link
Contributor Author

Arguably this should apply to all targets using aarch64, so we can just go ahead and remove the if. Looking at compiler-rt's CMakeLists.txt shows that the *tf intrinsics are always included.

Got it. Will do. Thanks.

@richkadel
Copy link
Contributor Author

@Amanieu - Done. Thanks!

@Amanieu
Copy link
Member

Amanieu commented Jul 14, 2021

The CI error happens because fp_mode.c is compiled and included twice. The fix is to avoid compiling the same file multiple times on line 510 of build.rs.

This wasn't caught before because only aarch64-gnu is tested on CI, not aarch64-musl.

@richkadel
Copy link
Contributor Author

Ah, I can add a hashset lookup on line 510 to avoid adding dups, and move those last two symbols with the others under any aarch64.

I think that's what you're suggesting, so I'll start that. Let me know if I misunderstand.

@Amanieu
Copy link
Member

Amanieu commented Jul 14, 2021

Yes, that's what I had in mind.

Expands the support added in rust-lang#377 from just musl to any linux.

Also checks for and avoids adding duplicate sources.

Fixes rust-lang#428
@richkadel
Copy link
Contributor Author

Done (I think) but I'm not sure how to launch a test of that code locally on my machine (cargo test from both the root dir and the testcrate dir didn't even attempt to compile it). Apologies if CI finds a typo/syntax error.

If there's a better way to test locally, let me know and I'll check it.

@Amanieu Amanieu merged commit cbbf3a0 into rust-lang:master Jul 14, 2021
@richkadel
Copy link
Contributor Author

@Amanieu thank you for your quick response!

Can I help with any steps in https://github.com/rust-lang/compiler-builtins/blob/master/PUBLISHING.md in some way?

@Amanieu
Copy link
Member

Amanieu commented Jul 14, 2021

I just published a new release.

@richkadel
Copy link
Contributor Author

Awesome! Thanks so much!

@richkadel
Copy link
Contributor Author

@Amanieu - I just wanted to let you know that this change did resolve the problems we had 👍 .

Thanks again!

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.

Missing symbols on aarch64-unknown-linux-gnu
2 participants