Topic: Building for Arm7m from Ubuntu
I'm on a Ubuntu 22.04.4 LTS machine. I have no problems building wolfSSL for my OS.
./configure
make
sudo make install
The above runs perfectly.
But, what I really need to do is cross-compile for an arm7m target.
I used the following command to create my makefile:
./configure --host=arm-non-eabi CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld STRIP=arm-none-eabi-strip \
RANLIB=arm-none-eabi-ranlib --prefix=$HOME/wolfssl-arm \
CFLAGS="-march=armv7-m --specs=nosys.specs -DHAVE_PK_CALLBACKS -DWOLFSSL_USER_IO -DNO_WRITEV" \
--disable-filesystem --enable-fastmath --disable-shared
Creating my makefile also works fine.
When I try to run make I get many undefined references such as:
CCLD wolfcrypt/test/testwolfcrypt
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: wolfcrypt/benchmark/benchmark.o: in function `bench_stats_asym_finish_ex.constprop.0':
benchmark.c:(.text+0x292): undefined reference to `clock_gettime'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: wolfcrypt/benchmark/benchmark.o: in function `bench_stats_sym_finish.constprop.0':
benchmark.c:(.text+0x472): undefined reference to `clock_gettime'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: wolfcrypt/benchmark/benchmark.o: in function `bench_hmac.constprop.0':
benchmark.c:(.text+0x730): undefined reference to `clock_gettime'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: benchmark.c:(.text+0x774): undefined reference to `__aeabi_read_tp'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: benchmark.c:(.text+0x7cc): undefined reference to `clock_gettime'
I assume I have some missing libraries, but no matter what I do I can't get the libraries into the make process to fix this issue.
I've also tried to make changes in <wolfssl_root>/IDE/GCC-ARM/Makefile.common. Is this a factor, could corruption here affect my build.
Any help would be much appreciated.