Topic: Compilation problem for cross compiling
Hello my friends, I am going to make an example with wolfssl library and FreeRTOS
my environment is :
Target STM32f446 Nucleo-64 (ARM cortex M4 )
IDE System Workbench for STM32
so I realized first I need to compile the library for my environment so I installed arm-none-eabi-gcc toolchain on my ubuntu then with this configuration I tried to build the library (this configuration comes from manual section 2.6.1)
./configure --host=arm-none-eabi \ CC=arm-none-eabi-gcc LD=arm-none-eabi-ld \ AR=arm-none-eabi-ar RANLIB=arm-none-eabi-ranlib \ CFLAGS="-DNO_WOLFSSL_DIR \ -DWOLFSSL_USER_IO -DNO_WRITEV \ -mcpu=cortex-m4 -mthumb -Os \ -specs=rdimon.specs" CPPFLAGS="-I./"
So it was not successful and I received this error
CC wolfcrypt/test/testsuite_testsuite_test-test.o CC examples/client/testsuite_testsuite_test-client.o In file included from examples/client/client.c:47:0: ./wolfssl/test.h:143:14: fatal error: netdb.h: No such file or directory #include <netdb.h> ^~~~~~~~~ compilation terminated. make: *** [examples/client/testsuite_testsuite_test-client.o] Error 1 make: *** Waiting for unfinished jobs.... make: Leaving directory `/home/mohsen/wolfssl-4.8.1' make: *** [all-recursive] Error 1 make: Leaving directory `/home/mohsen/wolfssl-4.8.1' make: *** [all] Error 2
I didn't find any solution for that so I tried to use another configuration which was mentioned inspection Building with configure in github (https://github.com/wolfSSL/wolfssl/tree … DE/GCC-ARM)
also I changed the -march=armv8-a to -march=armv7-m
./configure \ --host=arm-non-eabi \ CC=arm-none-eabi-gcc \ AR=arm-none-eabi-ar \ STRIP=arm-none-eabi-strip \ RANLIB=arm-none-eabi-ranlib \ --prefix=/home/mohsen/default-wolfssl-arm7 \ CFLAGS="-march=armv7-m --specs=nosys.specs \ -DHAVE_PK_CALLBACKS -DWOLFSSL_USER_IO -DNO_WRITEV" \ --disable-filesystem --enable-fastmath \ --disable-shared
It was successful so I linked this library to my IDE but when I tried to use any wolfssl function like MD5 I received this error.
In file included from /home/mohsen/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_22.214.171.124812190825/tools/compiler/arm-none-eabi/include/dirent.h:7:0, from /home/mohsen/wolfssl-arm7/include/wolfssl/wolfcrypt/wc_port.h:723, from /home/mohsen/wolfssl-arm7/include/wolfssl/wolfcrypt/types.h:35, from /home/mohsen/wolfssl-arm7/include/wolfssl/wolfcrypt/md5.h:30, from ../src/main.c:4: /home/mohsen/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_126.96.36.199812190825/tools/compiler/arm-none-eabi/include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported" #error "<dirent.h> not supported" ^~~~~ In file included from /home/mohsen/wolfssl-arm7/include/wolfssl/wolfcrypt/types.h:35:0, from /home/mohsen/wolfssl-arm7/include/wolfssl/wolfcrypt/md5.h:30, from ../src/main.c:4: /home/mohsen/wolfssl-arm7/include/wolfssl/wolfcrypt/wc_port.h:788:9: error: unknown type name 'DIR' DIR* dir; ^~~ make: *** [src/main.o] Error 1
What do you think where is my mistake?