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

Ola Røer Thorsen ola at silentwings.no
Mon Jan 15 15:13:41 CET 2018


I've got a product running on Linux arm imx6. It's being cross-compiled on
Linux x86_64. I've got it set up with both qmake and now qbs that hopefully
should replace qmake at some point.

The binary created by qbs fails to run as it's set up to use the wrong
interpreter. I need to pass "-mfloat-abi=hard" to g++ when it's used to
link the application.

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"?

Best regards,
Ola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20180115/08c55925/attachment.html>


More information about the Qbs mailing list