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

rav1d fails to build on aarch64 #773

Closed
negge opened this issue Feb 29, 2024 · 8 comments · Fixed by #806
Closed

rav1d fails to build on aarch64 #773

negge opened this issue Feb 29, 2024 · 8 comments · Fixed by #806
Assignees

Comments

@negge
Copy link

negge commented Feb 29, 2024

I tried to build rav1d on aarch64 and get the following error:

# cargo build --release
error: cannot produce proc-macro for `atomig-macro v0.3.0` as the target `aarch64-unknown-linux-gnu` does not support these crate types

This is using the latest rust on Ubuntu rustc 1.76.0-nightly (6b771f6b5 2023-11-15)

@kkysen
Copy link
Collaborator

kkysen commented Feb 29, 2024

What OS are you encountering this on? I don't think it's an issue with aarch64-unnknown-linux-gnu in general, since @fbossen has been compiling and running rav1d on aarch64-unnknown-linux-gnu on macOS. Perhaps it is an issue with +crt-static and static linking (rust-lang/rust#78210)?

@fbossen
Copy link
Collaborator

fbossen commented Feb 29, 2024

I am running into the same issue as @negge on a Raspberry Pi with Ubuntu 22.04. As @kkysen points out, no such issue on macOS for aarch64.

@fbossen
Copy link
Collaborator

fbossen commented Feb 29, 2024

@negge I seem to have better luck with cargo build --release --target aarch64-unknown-linux-gnu

@rinon
Copy link
Collaborator

rinon commented Feb 29, 2024

This might be an issue with atomig itself: https://docs.rs/atomig/latest/atomig/#notes ("This has the unfortunate effect that this whole library will fail to compile on any targets where any of the atomic methods/types are unavailable."). We don't really need this dependency, so we should probably just replace it.

@fbossen
Copy link
Collaborator

fbossen commented Feb 29, 2024

This might be an issue with atomig itself: https://docs.rs/atomig/latest/atomig/#notes ("This has the unfortunate effect that this whole library will fail to compile on any targets where any of the atomic methods/types are unavailable."). We don't really need this dependency, so we should probably just replace it.

Not sure the issue is with atomig itself. The same issue was present earlier with paste

@negge
Copy link
Author

negge commented Mar 1, 2024

@negge I seem to have better luck with cargo build --release --target aarch64-unknown-linux-gnu

Thanks @fbossen, I was able to build the project with that command line.

@kkysen
Copy link
Collaborator

kkysen commented Mar 1, 2024

@negge, we figured out that our .cargo/config.toml with rustflags set to -C target-feature=+crt-static was the issue. We had added that to cross-compile and run with qemu, and we're trying to figure out how to support both qemu and normal builds. In the meantime, manually specifying --target aarch64-unknown-linux-gnu should work as @fbossen pointed out.

@LukasKalbertodt
Copy link

The error message in the top comment suggests that this has nothing to do with any atomic operations, but with the fact that proc-macro crates are not supported in certain build/target configurations. There seems to be a solution to this issue now, but to throw out another way to fix this: you can remove the derive feature from atomig and replace these derives of Atom and AtomLogic with manual impls:

impl atomic::Atom for PictureFlags {
    type Repr = u8;
    fn pack(self) -> Self::Repr { self. 0 }
    fn unpack(src: Self::Repr) -> Self { Self(src) }
}
impl atomic::AtomLogic for PictureFlags {}

@thedataking thedataking self-assigned this Mar 15, 2024
thedataking added a commit that referenced this issue Mar 15, 2024
The feature flags were causing build failures with
aarch64 GNU/Linux. Closes #773.
thedataking added a commit that referenced this issue Mar 15, 2024
The feature flags were causing build failures with
aarch64 GNU/Linux. Closes #773.
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 a pull request may close this issue.

6 participants