-
Notifications
You must be signed in to change notification settings - Fork 829
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
Allow armv8-asm on ARMv7-A with -mthumb-interwork #8035
Conversation
If a customer includes both the ARM32 and the Thumb files, won't this cause a problem? |
The code is generated so I'll need to modify the scripts to produce the final result. |
Only ARMv6-M and v7-M (armthumb and cortex-m) seem to be thumb-only |
thumb gets defined in configure.ac. |
I'm not sure what you mean here. |
please note that once compiled, the code works fine on this A5 (at least the SHA I've tested). I'm actually surprised it still needs |
Ah I see now. No, it's not our configuration defining test-thumb-arm.c:
|
I understand this is limiting for eclipse users, perhaps we need a a set of defines that mutually excludes the two ports? ARMCC offers the following to discriminate the ISA: Gcc has defines like
|
It looks like it's not just my ARMv7-A, as all platform including newer ARMv8-A can compile with |
@SparkiDev I'm keeping this open as a reminder. I still think this should be addressed, although in the asm generator. I have a wolfboot port pending that currently depends on this workaround. |
5c5bd31
to
a23d384
Compare
I have tested and pushed a different suggestion for the assembly with checks for |
retest this please |
ARMv7-A (e.g. Cortex-A5) support calls between ARM and Thumb mode. When this is enabled (via
-mthumb -mthumb-interwork
, some functions in the amrv8- ARMASM port are guarded out via&& !defined(__thumb__)
statement.Description
This patch removes the
!__thumb__
dependency from ARMASM functions to allow compiling with-mthumb-interwork
.This compile flag is required in wolfBoot, as some bring-up procedures are written in thumb assembly, and this MPU allows calling between ARM and THUMB code when this option is enabled.
Testing
Attempting to enable ARMASM to speed up wolfBoot integrity check on SAMA5D3.
Added defines:
-DWOLFSSL_SP_ARM32_ASM -DWOLFSSL_ARMASM -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=7 -DWOLFSSL_ARMASM_INLINE -DWOLFSSL_ARMASM_NO_NEON
Relevant gcc flags, turning on both arm and thumb at the same time:
gcc -mcpu=cortex-a5 -mtune=cortex-a5 -mthumb -mthumb-interwork
Current code leaves out
Transform_Sha256_Len
(unresolved symbol while linking sha256 support).After removing the dependency on
!__thumb__
, the module compiles and works as expected.