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

Change NO_STD_TARGET to aarch64-unknown-none 🦖 #1715

Merged
merged 2 commits into from
Mar 14, 2023
Merged

Conversation

ascjones
Copy link
Collaborator

Since Rust 1.68, check-no-std fails. Lots of errors missing definitions from atomic.rs e.g.

cannot find macro `atomic_int` in this scope

I have confirmed this by running the check with cargo +1.67.1 and it works okay.

This looks to be an occurrence of rust-lang/rust#106795, which is fixed by rust-lang/rust#106856, but not stabilized yet (I'm not sure exactly how to tell). In any case it works with cargo +nightly so I assume this target will be fixed in a upcoming stable release.

In the meantime I have chosen a different target which has the same property of only supporting no_std: aarch64-unknown-none. This is a tier-2 target which is guaranteed to build, see https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-2

@ascjones ascjones requested review from a team, cmichi, HCastano and SkymanOne as code owners March 14, 2023 11:54
@ascjones ascjones changed the title Change NO_STD_TARGET to thumbv7m-none-eabi 🦖 Change NO_STD_TARGET to thumbv7m-none-eabi 🦖 Mar 14, 2023
@ascjones ascjones changed the title Change NO_STD_TARGET to thumbv7m-none-eabi 🦖 Change NO_STD_TARGET to aarch64-unknown-non 🦖 Mar 14, 2023
@ascjones ascjones changed the title Change NO_STD_TARGET to aarch64-unknown-non 🦖 Change NO_STD_TARGET to aarch64-unknown-none 🦖 Mar 14, 2023
@ascjones ascjones requested a review from athei March 14, 2023 11:59
@ascjones ascjones merged commit a7b3747 into master Mar 14, 2023
@ascjones ascjones deleted the aj/no-std-target branch March 14, 2023 17:41
@HCastano
Copy link
Contributor

@athei since the change that broke the bpf target seems to be related to atomics, is your comment from the original PR outdated now?

Just wondering if we need to switch back to a more constrained target in the future, or if keeping the aarch64 one is fine

@ascjones
Copy link
Collaborator Author

We can certainly switch back to bpf once the fix is stabilized, it seems that works again on nightly. Although since atomics are in core and we are doing -Zbuild-std="core,alloc", I'm not sure whether the fix is that atomics are enabled again for bpf. So we need some clarity.

I'm wondering whether we could/should create our own custom target as per https://docs.rust-embedded.org/embedonomicon/custom-target.html.

@ascjones
Copy link
Collaborator Author

This is the relevant issue for atomics rust-lang/rust#106795

@athei
Copy link
Contributor

athei commented Mar 15, 2023

I'm not sure whether the fix is that atomics are enabled again for bpf. So we need some clarity.

bpf does not have atomics. So that can't be the fix. The core library does handle this case with conditional compilation. There might just be a bug with this esoteric target.

Just wondering if we need to switch back to a more constrained target in the future, or if keeping the aarch64 one is fine.

I think we can stick with aarch64.

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.

4 participants