-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix compilation on early arm architectures #15557
Conversation
This patch uses __ARM_ARCH set by compiler (both GCC and Clang have this) whenever possible instead of hardcoding it to 7. This change allows code to compile on earlier ARM architectures such as armv5te. Signed-off-by: Shengqi Chen <[email protected]>
The `adr` insn in neon kernel generates an compiling error on armv5/6 target. Fix that by using `ldr`. Signed-off-by: Shengqi Chen <[email protected]>
This PR is applied in Debian to fix compilation of the armel architecture, which unfortunately has a baseline of armv5te. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for resolving this issue.
The `adr` insn in neon kernel generates an compiling error on armv5/6 target. Fix that by using `ldr`. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shengqi Chen <[email protected]> Closes #15557
@behlendorf Thanks for your review! However my PR contained two commits that solves two issues on arm, I see only f9afa21 merged but bd7b0a7 not. Is this expected? |
I just found that both two are merged. It turned out to be my carelessness. Just ignore this :-) |
No worries. I see that one of the commits 4340f69 wasn't automatically linked to this PR. I'm not sure why not. |
My merged pull request openzfs#15557 fixes compilation of sha2 kernels on arm v5/6. However, the compiler guards only allows sha256/512_armv7_impl to be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all arm architectures. Some compiler guards are adjusted accordingly to avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels on old architectures. Signed-off-by: Shengqi Chen <[email protected]>
My merged pull request openzfs#15557 fixes compilation of sha2 kernels on arm v5/6. However, the compiler guards only allows sha256/512_armv7_impl to be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all arm architectures. Some compiler guards are adjusted accordingly to avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels on old architectures. Signed-off-by: Shengqi Chen <[email protected]>
My merged pull request openzfs#15557 fixes compilation of sha2 kernels on arm v5/6. However, the compiler guards only allows sha256/512_armv7_impl to be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all arm architectures. Some compiler guards are adjusted accordingly to avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels on old architectures. Signed-off-by: Shengqi Chen <[email protected]>
My merged pull request #15557 fixes compilation of sha2 kernels on arm v5/6. However, the compiler guards only allows sha256/512_armv7_impl to be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all arm architectures. Some compiler guards are adjusted accordingly to avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels on old architectures. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shengqi Chen <[email protected]> Closes #15623
This patch uses __ARM_ARCH set by compiler (both GCC and Clang have this) whenever possible instead of hardcoding it to 7. This change allows code to compile on earlier ARM architectures such as armv5te. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shengqi Chen <[email protected]> Closes openzfs#15557
The `adr` insn in neon kernel generates an compiling error on armv5/6 target. Fix that by using `ldr`. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shengqi Chen <[email protected]> Closes openzfs#15557
My merged pull request openzfs#15557 fixes compilation of sha2 kernels on arm v5/6. However, the compiler guards only allows sha256/512_armv7_impl to be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all arm architectures. Some compiler guards are adjusted accordingly to avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels on old architectures. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shengqi Chen <[email protected]> Closes openzfs#15623
Motivation and Context
Currently OpenZFS won't build on early arm architectures (see debian port on
armel
).Some errors are generated when compiling
module/icp/asm-arm/sha2/sha256-armv7.S
andmodule/icp/asm-arm/sha2/sha512-armv7.S
:But the code actually has compiler guards to provide support for early arm architectures:
zfs/module/icp/asm-arm/sha2/sha256-armv7.S
Lines 83 to 108 in a94860a
Also, another error would be thrown when
__ARM_ARCH__
macro is correctly set with early arms:This is caused by
adr
instruction on L1849:zfs/module/icp/asm-arm/sha2/sha256-armv7.S
Lines 1845 to 1853 in a94860a
On early ISAs,
adr
could not load an address (K256
) that is too far away from PC.Description
__ARM_ARCH
that would be set by compiler (both GCC and Clang) when possible, so that these files compile with early architectures such asarmv5te
andarmv6
.adr
withldr
on early architectures.How Has This Been Tested?
The code now compiles on
armv5te
andarmv6
. Since I have made no functionality change and it is taken from OpenSSL, I suppose no further test is needed.Types of changes
Checklist:
Signed-off-by
.