[Qbs] How to pass -march=armv7-a to the g++ linking command line (without -Wl, )

Christian Kandeler christian.kandeler at qt.io
Mon Jan 15 15:57:19 CET 2018

On Mon, 15 Jan 2018 15:13:41 +0100
Ola Røer Thorsen <ola at silentwings.no> wrote:

> [...]
> The qmake build ends up linking the application with a command line like
> this:
> arm-fslc-linux-gnueabi-g++
>         -mfloat-abi=hard
>         --sysroot=/srv/XXXXXXXX/sysroots/armv7at2hf-neon-fslc-linux-gnueabi
>         -Wl,--gc-sections
>         -Wl,-O1
>         -Wl,-rpath,/opt/qt5.6.3/lib
>         -o etc etc
> Qbs does this:
> arm-fslc-linux-gnueabi-g++
> -Wl,-rpath,/opt/qt5.6.3/lib,--gc-sections,-O1
> --sysroot=/srv/XXXXXXXXX/sysroots/armv7at2hf-neon-fslc-linux-gnueabi
> -L/srv/XXXXXXX/sysroots/armv7at2hf-neon-fslc-linux-gnueabi/opt/qt5.6.3/lib
> -march=armv7-a
> -o etc etc
> I'm struggling to find the property or similar in the cpp module that adds
> the "-mfloat-abi=hard"-option to g++ when used for linking.
> Adding "-mfloat-abi=hard" to cpp.linkerFlags does not work as the option
> should not be wrapped with "-Wl,".
> Adding -"mfloat-abi=hard" to cpp.commonCompilerFlags is necessary for the
> compiling but does not work for the linking.
> So, how do I make qbs link using "g++ --mfloat-abi=hard"?

That would be cpp.driverFlags. See http://doc-snapshots.qt.io/qbs/qml-qbsmodules-cpp.html#driverFlags-prop

(The question you asked in the body of the email does not match the one from the subject, by the way.)


More information about the Qbs mailing list