

























if [[ "$CARCH" == "aarch64" ]]; then
export RUSTFLAGS="-C target-cpu=native"
export CFLAGS="-march=native"
export CXXFLAGS="$CFLAGS"
export LDFLAGS=""
fi
CFLAGS is a flag for c compiler - it forces to use the native cpu crypto https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
Hi a2sc. I see, indeed, that as it is the PKGBUILD fails to build the sha2-asm cargo dependency on an aarch64 with a bunch of:
warning: sha2-asm@0.6.4: src/sha256_aarch64.S:191: Error: selected processor does not support `sha256h2 q3,q4,v7.4s'
warnings then ultimately an error:
error: failed to run custom build command for `sha2-asm v0.6.4`
I'm unsure why this is though to be honest. I see that tulir has his CI building for this architecture with not much different really:
https://mau.dev/tulir/gomuks-build-docker/-/blob/master/.gitlab-ci.yml#L79
How did you arrive at the need to add those flags? I checked out the sha2-asm rust crate and that seems to not only have limited aarch64 support, but also to be on the way out: https://github.com/RustCrypto/asm-hashes and I found no special instructions for compiling on aarch64 there either. Would love to learn more from you if you don't mind explaining those flags please.
if you want to build it on aarch64 raspi 5, you must replace the build function with:
build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
if [[ "$CARCH" == "aarch64" ]]; then
export RUSTFLAGS="-C target-cpu=native"
export CFLAGS="-march=armv8-a+crypto"
export CXXFLAGS="$CFLAGS"
export LDFLAGS=""
fi
cargo clean
cargo build -p libsignal-ffi --profile=release
}
Thanks @BrainDamage Indeed I was going to try and see if 0.52.3 would work with mautrix-signal, but then got distracted and pushed this mixup. Thanks for you comment, should be fixed now.
This package sets 0.52.3 pkgver, but the hash is for version 0.52.0 and the only reverse-dependency has version 0.52.0 pinned. Was it a typo?
This also compiles and works on aarch64
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
Right, so looking into a bit more, it does indeed look like the suggestions you made help the build succeed, however on my RPi4 a test then fails. So I'm not too sure how reliable this would actually be on aarch64.
At this stage, I feel like it would be more rigorous to remove aarch64 from the arch array altogether, as that is closer to what I am able to test... You'd still be able to use a modified version of the PKGBUILD if you like of course, although I realise that might be less convenient. But I'm not too sure why the test is failing and it does suggest that even with the native CPU settings to C and C++ it is not perfect. And the fact that the asm-hashes rust package is deprecated is not encouraging...