On 16/01/2018 4:23 AM, Wookey wrote:
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:
arm-fslc-linux-gnueabi-g++
-mfloat-abi=hard
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.
I found this piece of information very interesting indeed, what's your
stance about -march then? In my case, I have one toolchain per platform
(roughly), they all have the same generic triplet (arm-linux-gnueabi),
but target different ARM arch (armv5te, armv6, cortex A?, ...) and
actually have sometimes different float ABI.
I'm currently trying to refactor that to have more consistency across
our toolchains, so your above comments caught my attention.
Chris
PS: Glad to see you on this ML, I remember you from the Emdebian project
when I gave it a try, that was 10 years ago! ;)
Wookey
_______________________________________________
Qbs mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs
_______________________________________________
Qbs mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs