p30arena
Posts: 2
Joined: Sat Oct 09, 2021 11:57 am

Qt Cross Compilation for Raspberry Pi 4 | Debian 11 aarch64 | unrecognized command-line option "-mfloat-abi=softfp"

Sat Oct 09, 2021 12:32 pm

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- ... 0-lts.html

https://github.com/abhiTronix/raspberry ... uctions.md

This is the compiler I'm using: https://snapshots.linaro.org/gnu-toolch ... gnu.tar.xz

from this page: https://snapshots.linaro.org/gnu-toolch ... 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.

Code: Select all

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?

p30arena
Posts: 2
Joined: Sat Oct 09, 2021 11:57 am

Re: Qt Cross Compilation for Raspberry Pi 4 | Debian 11 aarch64 | unrecognized command-line option "-mfloat-abi=softfp"

Mon Oct 11, 2021 4:32 am

fixed this by editing the qmake.conf

used linux_device_post instead of linux_arm_device_post

Code: Select all

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)

Return to “General programming discussion”