Closed zonyitoo closed 4 months ago
I believe the problem related to the Cross.toml configuration that you have here. See my comment on your other issue. Since I believe these have the same root cause, I will close this issue.
@justsmth Wait, actually Rustup is now on the same boat (again with https://github.com/rust-lang/rustup/pull/3898) 😅 For cross compilation we have historically used the Docker images provided by rust-lang/rust, and maybe that error was caused by a very outdated version of GCC (we use 8.5.0, and the log above uses 8.3.0)?
The log here is more or less the same thing: https://github.com/rust-lang/rustup/actions/runs/9720503984/job/26831972336?pr=3898
I mean I could try to use cross
on our side instead but that migration might not be easy :]
The real problem is, since I have no intention of using fipsmodule
(it's not supported for the target in question according to https://aws.github.io/aws-lc-rs/requirements/linux.html), why I'm getting an error on that part of the codebase?
..., why I'm getting an error on that part of the codebase?
It's just due to how the code is structured. Code that is related to the certification has been placed into a "fipsmodule" directory, but the additional "delocation" and runtime checks required for certification are only activated for a "FIPS" build. We have some detail about how a "FIPS" build differs from our default build here: https://github.com/aws/aws-lc/blob/main/crypto/fipsmodule/FIPS.md
This comment might be relevant to this build failure: https://github.com/aws/aws-lc/blob/5a4a7d17d589af6d7110eded4155ebaaf5026029/crypto/fipsmodule/cpucap/cpu_arm_linux.c#L116-L121
I have a fairly simple patch for it, but I need to test it:
---
crypto/fipsmodule/cpucap/cpu_arm_linux.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/crypto/fipsmodule/cpucap/cpu_arm_linux.c b/crypto/fipsmodule/cpucap/cpu_arm_linux.c
index e4ab5ab49..a2c5a1809 100644
--- a/crypto/fipsmodule/cpucap/cpu_arm_linux.c
+++ b/crypto/fipsmodule/cpucap/cpu_arm_linux.c
@@ -118,7 +118,11 @@ void OPENSSL_cpuid_setup(void) {
// this is now rare (see Chrome's Net.NeedsHWCAP2Workaround metric), but AES
// and PMULL extensions are very useful, so we still carry the workaround
// for now.
+#if defined(AT_HWCAP2)
unsigned long hwcap2 = getauxval(AT_HWCAP2);
+#else
+ unsigned long hwcap2 = 0;
+#endif
if (hwcap2 == 0) {
hwcap2 = crypto_get_arm_hwcap2_from_cpuinfo(&cpuinfo);
g_needs_hwcap2_workaround = hwcap2 != 0;
--
This comment might be relevant to this build failure: https://github.com/aws/aws-lc/blob/5a4a7d17d589af6d7110eded4155ebaaf5026029/crypto/fipsmodule/cpucap/cpu_arm_linux.c#L116-L121
I have a fairly simple patch for it, but I need to test it:
--- crypto/fipsmodule/cpucap/cpu_arm_linux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/fipsmodule/cpucap/cpu_arm_linux.c b/crypto/fipsmodule/cpucap/cpu_arm_linux.c index e4ab5ab49..a2c5a1809 100644 --- a/crypto/fipsmodule/cpucap/cpu_arm_linux.c +++ b/crypto/fipsmodule/cpucap/cpu_arm_linux.c @@ -118,7 +118,11 @@ void OPENSSL_cpuid_setup(void) { // this is now rare (see Chrome's Net.NeedsHWCAP2Workaround metric), but AES // and PMULL extensions are very useful, so we still carry the workaround // for now. +#if defined(AT_HWCAP2) unsigned long hwcap2 = getauxval(AT_HWCAP2); +#else + unsigned long hwcap2 = 0; +#endif if (hwcap2 == 0) { hwcap2 = crypto_get_arm_hwcap2_from_cpuinfo(&cpuinfo); g_needs_hwcap2_workaround = hwcap2 != 0; --
@justsmth Thanks! The patch looks reasonable to me. Is there a way I can easily test it within the current cargo setup though?
The change to address this in AWS-LC made it into the release yesterday: https://github.com/aws/aws-lc/releases/tag/v1.31.0
Hopefully, we can get a PR up today for aws-lc-sys to align it with that release.
This should be resolved with our latest release: https://github.com/aws/aws-lc-rs/releases/tag/v1.8.1
Problem:
It looks like that
AT_HWCAP2
was missing.It could be reproduced in this project: https://github.com/shadowsocks/shadowsocks-rust by running:
Relevant details
AWS-LC for Rust versions or commit: (crates.io aws-lc-sys v0.17.0)
System information: for linux, below info can be collected by running
uname -srvmp
Build log: