Search code examples
embedded-linuxyoctobitbake

Recipe compilation fails due to Floating Point Unit compatibility issue (I assume)


I'm stuck compiling a bitbake recipe for an Allwinner H2 SoC. It seems to be a problem of floating point unit compatibility. This is the compilation error log (abbreviated paths and added line breaks for a little better readability):

python3-scipy/1.3.3-r0/recipe-sysroot-native/[...]/gcc/arm-poky-linux-gnueabi/8.3.0/ld: error: build/lib.linux-x86_64-3.7/scipy/fftpack/_fftpack.cpython-37m-arm-linux-gnueabi.so uses VFP register arguments, build/temp.linux-x86_64-3.7/libfftpack.a(cffti1.o) does not
python3-scipy/1.3.3-r0/recipe-sysroot-native/[...]/gcc/arm-poky-linux-gnueabi/8.3.0/ld:: failed to merge target specific data of file build/temp.linux-x86_64-3.7/libfftpack.a(cffti1.o)

[...]

| error: Command "/home/marius/mender-orangepi-warrior/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-scipy/1.3.3-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -Wall -g -march=armv7ve -mthumb -mfpu=neon -mfloat-abi=hard \
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security \
--sysroot=/home/marius/mender-orangepi-warrior/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-scipy/1.3.3-r0/recipe-sysroot -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now \
-L/home/marius/mender-orangepi-warrior/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-scipy/1.3.3-r0/recipe-sysroot/usr/lib/python3.7/site-packages/numpy/core/lib build/temp.linux-x86_64-3.7/build/src.linux-x86_64-3.7/scipy/fftpack/_fftpackmodule.o \
build/temp.linux-x86_64-3.7/scipy/fftpack/src/zfft.o build/temp.linux-x86_64-3.7/scipy/fftpack/src/drfft.o build/temp.linux-x86_64-3.7/scipy/fftpack/src/zrfft.o build/temp.linux-x86_64-3.7/scipy/fftpack/src/zfftnd.o \
build/temp.linux-x86_64-3.7/build/src.linux-x86_64-3.7/scipy/fftpack/src/dct.o build/temp.linux-x86_64-3.7/build/src.linux-x86_64-3.7/scipy/fftpack/src/dst.o build/temp.linux-x86_64-3.7/build/src.linux-x86_64-3.7/build/src.linux-x86_64-3.7/scipy/fftpack/fortranobject.o \
-L/home/marius/mender-orangepi-warrior/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-scipy/1.3.3-r0/recipe-sysroot/usr/lib -Lbuild/temp.linux-x86_64-3.7 -ldfftpack -lfftpack -lpython3.7m \
-lgfortran -o build/lib.linux-x86_64-3.7/scipy/fftpack/_fftpack.cpython-37m-arm-linux-gnueabi.so -Wl,--version-script=build/temp.linux-x86_64-3.7/link-version-scipy.fftpack._fftpack.map" failed with exit status 1
| ERROR: 'python3 setup.py build ' execution failed.

I tried to enforce hard and soft FPU handling by setting target_FPU="soft", "hard" and "vfp-neon" in the machine configuration. In all cases compilation crashed at the same step. I further experimented with the compiler flags of the failing step, such as changing -mfloat-abi to soft, hard and vfp-neon. None lead to success.

Any hint on how to compile this recipe for this architecture is highly appreciated!

Edit: This is the recipe I'm trying to bitbake: meta-scipy


Solution

  • The error you see happen because the fortran compiler isn't passed the correct floating point arguments. I've created a pull request to meta-scipy which solves this, at least I can now build for Raspberry Pi without forcing soft-float.