Home > Software engineering >  unrecognized command-line option "-mfloat-abi=softfp" | Qt Cross Compilation for Raspberry
unrecognized command-line option "-mfloat-abi=softfp" | Qt Cross Compilation for Raspberry

Time:10-11

I've installed Debian Bullseye from this page: https://raspi.debian.net/daily-images/

on a Raspberry Pi 4 machine and prepared the required libraries and packages following these guides:

https://www.interelectronix.com/qt-515-cross-compilation-raspberry-compute-module-4-ubuntu-20-lts.html

https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/QT_build_instructions.md

This is the compiler I'm using: https://snapshots.linaro.org/gnu-toolchain/12.0-2021.10-1/aarch64-linux-gnu/gcc-linaro-12.0.0-2021.10-x86_64_aarch64-linux-gnu.tar.xz

from this page: https://snapshots.linaro.org/gnu-toolchain/12.0-2021.10-1/aarch64-linux-gnu/


issue description

When I run ./configure... after some processing the compiler throws an error:

aarch64-linux-gnu-g : error: unrecognized command-line option -mfloat-abi=softfp

Meanwhile, Linaro or official ARM compilers do not support VFP, FPU, etc. so I had to change the qmake.conf to try to remove that command-line option from the compiler flags.

QMAKE_CFLAGS -= -mfloat-abi=softfp
QMAKE_CFLAGS_RELEASE -= -mfloat-abi=softfp
QMAKE_CXXFLAGS -= -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE -= -mfloat-abi=softfp

I've tried every solution listed on: Qmake: how to remove compiler flag for a certain project, without changing qmake.conf?

But still had no luck! That command-line magically appears again!

Have you had any luck compiling for aarch64?

How can I resolve this issue?

UPDATE

my configure command:

~/Qt/5.15.2/Src/configure -release -device linux-rasp-pi4-v3d-g   \
-device-option CROSS_COMPILE=~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/tools/gcc-linaro-12.0.0-2021.10-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- \
-sysroot ~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot -prefix /usr/local/qt5.15.2 \
-extprefix ~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/qt5.15.2 \
-opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine \
-nomake tests -make libs -pkg-config -no-use-gold-linker -v -recheck \
-L~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/lib/aarch64-linux-gnu \
-I~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/aarch64-linux-gnu

I edited qmake.conf in linux-rasp-pi4-v3d-g folder:

include(../common/linux_device_pre.conf)

#QMAKE_LIBS_EGL          = -lEGL
#QMAKE_LIBS_OPENGL_ES2   = -lGLESv2 -lEGL

#QMAKE_CFLAGS            = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8
QMAKE_CFLAGS            = -march=armv8-a -mtune=cortex-a72
QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS

#DISTRO_OPTS             = hard-float
DISTRO_OPTS             = deb-multi-arch

#EGLFS_DEVICE_INTEGRATION = eglfs_kms

include(../common/linux_arm_device_post.conf)

QMAKE_CFLAGS            = $$replace(QMAKE_CFLAGS, "-mfloat-abi=softfp", "")
QMAKE_CFLAGS_RELEASE            = $$replace(QMAKE_CFLAGS_RELEASE, "-mfloat-abi=softfp", "")
QMAKE_CXXFLAGS          = $$replace(QMAKE_CXXFLAGS, "-mfloat-abi=softfp", "")
QMAKE_CXXFLAGS_RELEASE          = $$replace(QMAKE_CXXFLAGS_RELEASE, "-mfloat-abi=softfp", "")

COMPILER_FLAGS            = $$replace(COMPILER_FLAGS, "-mfloat-abi=softfp", "")

load(qt_config)

CodePudding user response:

fixed this by editing the qmake.conf

used linux_device_post instead of linux_arm_device_post

include(../common/linux_device_pre.conf)
QT_QPA_DEFAULT_PLATFORM =

QMAKE_CFLAGS            = -march=armv8-a -mtune=cortex-a72
QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS

DISTRO_OPTS             = deb-multi-arch

include(../common/linux_device_post.conf)

load(qt_config)
  • Related