The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
Compiled with Keil uVision on a Cortex-M3, several errors like this one are reported in the file sp_cortexm.c:
sp_cortexm.c(31511): error: symbol 'L_sp_256_sqr_8_store' is already defined
31511 | "L_sp_256_sqr_8_store:\n\t"
| ^
<inline asm>(50): note: instantiated into assembly here
50 | L_sp_256_sqr_8_store:
| ^
Options WOLFSSL_SP_ASM and WOLFSSL_SP_ARM_CORTEX_M_ASM are enabled.
The issue is due to the compiler setting using highest size optimization (-Oz option with armclang), as explained in the GCC compiler manual:
Under certain circumstances, GCC may duplicate (or remove duplicates of) your assembly code when optimizing. This can lead to unexpected duplicate symbol errors during compilation if your asm code defines symbols or labels. Using ‘%=’ (see AssemblerTemplate) may help resolve this problem.
After adding '%=' in all the labels from sp_cortexm.c, the code is compiling properly, ie:
"L_sp_256_sqr_8_store%=:\n\t"
Contact Details
dgatien@intevaproducts.com
Version
5.7.0
Description
Compiled with Keil uVision on a Cortex-M3, several errors like this one are reported in the file sp_cortexm.c:
Options WOLFSSL_SP_ASM and WOLFSSL_SP_ARM_CORTEX_M_ASM are enabled.
The issue is due to the compiler setting using highest size optimization (-Oz option with armclang), as explained in the GCC compiler manual:
After adding '%=' in all the labels from sp_cortexm.c, the code is compiling properly, ie:
"L_sp_256_sqr_8_store%=:\n\t"
Reproduction steps
Relevant log output
No response