Topic: Xilinx Complie Error

Greetings,

I am attempting to compile WolfSSL within the Xilinx Vitis IDE for execution on a Xilinx board. I have followed the steps in the README under the IDE/XilinxSDK folder; however, at compile time I receive the following error.

"#Error can not use both ARMv8 and instructions and XILINX hardened crypto"

I have attempted to modify the user_settings.h defines to resolve this error, but have been unsuccessful.

Thanks,
Hodge

Share

Re: Xilinx Complie Error

Hello Hodge,

Thanks for joining the wolfSSL Forums. In your configuration, please ensure that either WOLFSSL_ARMASM or WOLFSSL_XILINX_CRYPT is defined, but not both.

Thanks,
Eric - wolfSSL Support

Re: Xilinx Complie Error

Greetings Eric,

I have toggled the defines both ways in the user_settings.h file. I am editing the file located IDE/XiLinxSDK folder. Perhaps this is the wrong file to edit.

Here the current contents are:

/* Xilinx SDK */
#define WOLFSSL_XILINX
#undef WOLFSSL_ARMASM
#define WOLFSSL_XILINX_CRYPT
#if defined(versal) && defined(WOLFSSL_XILINX_CRYPT)
#define WOLFSSL_XILINX_CRYPT_VERSAL
#endif
#ifndef FREERTOS
#define SINGLE_THREADED
#endif
#define NO_FILESYSTEM
#define HAVE_UINTPTR_T

/* Platform - remap printf */
#include "xil_printf.h"
#define XPRINTF xil_printf

#if !defined(WOLFSSL_XILINX_CRYPT_VERSAL)
/* Enable ARMv8 (Aarch64) assembly speedups - SHA256 / AESGCM */
/* Note: Requires CFLAGS="-mcpu=generic+crypto -mstrict-align" */
#define WOLFSSL_ARMASM
#endif

Thanks,
Hodge

Share

Re: Xilinx Complie Error

Hi Hodge,

Is "versal" defined? Otherwise it looks like "WOLFSSL_ARMASM" is being defined at the end:

#if !defined(WOLFSSL_XILINX_CRYPT_VERSAL)
/* Enable ARMv8 (Aarch64) assembly speedups - SHA256 / AESGCM */
/* Note: Requires CFLAGS="-mcpu=generic+crypto -mstrict-align" */
#define WOLFSSL_ARMASM
#endif

Re: Xilinx Complie Error

Greetings Eric,

Versal shouldn't be defined, but just to be certain I undef'ed it. Below is the current configuraiton of User_settings.h.

/* Xilinx SDK */
#define WOLFSSL_XILINX
#define WOLFSSL_ARMASM
#undef WOLFSSL_XILINX_CRYPT
#undef WOLFSSL_XILINX_CRYPT_VERSAL
#if defined(versal) && defined(WOLFSSL_XILINX_CRYPT)
#define WOLFSSL_XILINX_CRYPT_VERSAL
#endif
#ifndef FREERTOS
#define SINGLE_THREADED
#endif
#define NO_FILESYSTEM
#define HAVE_UINTPTR_T

/* Platform - remap printf */
#include "xil_printf.h"
#define XPRINTF xil_printf

#if !defined(WOLFSSL_XILINX_CRYPT_VERSAL)
/* Enable ARMv8 (Aarch64) assembly speedups - SHA256 / AESGCM */
/* Note: Requires CFLAGS="-mcpu=generic+crypto -mstrict-align" */
#define WOLFSSL_ARMASM
#endif


It appears the user_settings.h file is not being utilized by the complier; however, the compile time options appear correct:

06:16:56 **** Build of configuration Debug for project refdes ****
make all
'Building file: C:/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.c'
'Invoking: ARM v8 gcc compiler'
aarch64-none-elf-gcc -DWOLFSSL_USER_SETTINGS -Wall -O0 -g3 -I"C:\reg\test_a53\src" -I"C:\wolfssl" -I"C:\wolfssl\IDE\XilinxSDK" -IC:/Users/g41150/workspace/refdes_platform/export/refdes_platform/sw/refdes_platform/standalone_domain/bspinclude/include -I"C:\Users\g41150\workspace\refdes\src\drv" -c -fmessage-length=0 -MT"src/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.o" -fPIC -mstrict-align -mcpu=generic+crypto -v -MMD -MP -MF"src/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.d" -MT"src/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.o" -o "src/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.o" "C:/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.c"
Using built-in specs.
COLLECT_GCC=C:\Xilinx\Vitis\2020.2\gnu\aarch64\nt\aarch64-none\bin\\..\x86_64-oesdk-mingw32\usr\bin\aarch64-xilinx-elf\aarch64-xilinx-elf-gcc.exe
Target: aarch64-xilinx-elf

I assume I am doing something foolish, but I don't know how best to identify what that might be. I appreciate the help.

-Hodge

Share

Re: Xilinx Complie Error

Hi Hodge,

Check out the project instructions from the readme:
https://github.com/wolfSSL/wolfssl/tree … om-scratch

In particular, confirm that the preprocessor macro "WOLFSSL_USER_SETTINGS" is set, per step 15

Thanks,
Eric

Re: Xilinx Complie Error

Eric,

Thanks for the support. You were correct. It was the lack of "define versal". This has advanced me to the next error:

    make: *** [src/wolfssl/wolfcrypt/src/port/xilinx/subdir.mk:29: src/wolfssl/wolfcrypt/src/port/xilinx/xil-aesgcm.o] Error 1

The help files state a similar error could be caused by the failure to include xilmailbox. However, I have done that and when looking at the makefile can see its inclusion as noted below.

    psu_cortexa53_0/libsrc/xilmailbox_v1_2/src/Makefile psu_cortexa53_0/libsrc/xilsecure_v4_3/src/Makefile


Additionally, I have noted a few other issues.

1)  When using the standalone as the OS and attempt to change the lwip211 setting api_mode from RAW to socket it receive the following error:

    Error occurred while generating bsp sources for the domain 'standalone_domain'.
    Failed to generate the bsp sources for domain.standalone_domain

    Details: ERROR: lwIP with Sockets requires "xilkernel or freertos" OS

    ERROR: [Hsi 55-1545] Problem running tcl command ::sw_lwip211_v1_3::lwip_drc : ERROR: lwIP with Sockets requires         "xilkernel or freertos" OS
    while executing
    "error "ERROR: lwIP with Sockets requires \"xilkernel or freertos\" OS" "" "mdt_error""
    (procedure "lwip_sw_drc" line 10)
    invoked from within
    "lwip_sw_drc $libhandle $emac_names_list"
    (procedure "::sw_lwip211_v1_3::lwip_drc" line 82)
    invoked from within
    "::sw_lwip211_v1_3::lwip_drc lwip211"

    ERROR: [Hsi 55-1440] Error(s) while running DRCs.

2) If I switch the OS from standalone to FreeROTS (because standalone is proving so troublesome) the xilmailbox is not provided as a library to include and the build fails because it is missing.

I have tried to build the wolfssl code as s static library instead of including it in my primary application, but receive similar errors. I am using Vitis 2020.2 as my IDE and there is a lack of help for that specific version, but it seems like I should be able to work around it.

That said my primary concern is that neither FreeRTOS nor the standalone OS appear to be viable solutions because of errors 1 and 2 noted above, but I have been, perhaps foolishly, trying to get a build of the standalone OS using the api_mode of raw just to see if I could.

Thanks for sticking with the long post. Thoughts?

-Hodge

Share