How to crosscompile GSL for Arm Cortex M4?

Viewed 210

I am using a STM32 MCU with arm cortex m4 and want to use the gsl-2.7.1. However, I already tried for example the command ./configure --prefix=/home/user_name/gsl_arm --target=arm-none-eabi and every other suggestion that I could find on the internet and toolchain-tutorials, but in the best case I got during linking with the build library an error like "could not recognize the symbols". In the worst case, the suggested options for autoconfig were not recognized (for example, to specify the cpu). Does anyone have an idea how I have to crosscompile it?

1 Answers

I am glad to say that I was able to cross compile the GSL for Arm Cortex-M4. If you call autoconf with the following options:

COREFLAGS="-mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=soft"
./configure --prefix=/home/$(whoami)/gsl_arm CC=arm-none-eabi-gcc \
CXX=arm-none-eabi-gcc LD=arm-none-eabi-gcc AR=arm-none-eabi-ar \
OBJCOPY=arm-none-eabi-objcopy CCFLAGS="$COREFLAGS" CXXFLAGS="$COREFLAGS" \
LDFLAGS="--specs=nano.specs --specs=nosys.specs $COREFLAGS"  \
--host=x86_64-unknown-linux-gnu

The host is the host for my case, and make differ. Note that you have to use software floating point, since some libraries are only working with this.

Related