[Qbs] How to pass -march=armv7-a to the g++ linking command line (without -Wl, )
wookey at wookware.org
Mon Jan 15 16:23:03 CET 2018
On 2018-01-15 15:13 +0100, Ola Røer Thorsen wrote:
> 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 qmake build ends up linking the application with a command line like this:
> 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.
It's not just linking, its an ABI option that applies to the compile
stage too. ABIs are so fundamental that these are two different
architectures in Debian-based distros: armel and armhf. Which have
different toolchains, and cross-toolchains, so if you use the right
triplet then you get the right output and everything matches up.
I would question why you are using a linux-gnueabi toolchain when you
want linux-gnueabihf outputs. Obviously it can be done, but a good way
to avoid problems with the wrong ABI is to use a toolchain that
defaults to the right thing. I don't know what your base distro is,
but if it's debian-based then using a the distro-supplied
arm-linux-gnueabihf-g++ would avoid this problem completely. If you
are in redhat-world I presume there are equivalent cross-toolchains.
Keeping ABI info in triplets is much cleaner than special-casing the
magic option for getting one ABI whilst building with a toolchain for
another, especially in upstream projects. (this includes -m32/-m64 in
x86 world, which is also a special case that doesn't necessarily work
on other architectures and architecture-pairs).
I reaslise this is a rather tangential answer to your actual question,
but it is hopefully helpful.
Principal hats: Linaro, Debian, Wookware, ARM
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the Qbs