0

I am trying to build Qt5.9.1 with QtWebengine for an arm platform. These are some architecture based arguments i am passing to the build.

QMAKE_CFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 
QMAKE_CXXFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9

By default i can see that the build is going for these values as well.

-mfloat-abi=hard -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mthumb

THIS is the error i am facing.

As far as i know, in cortex-a9 neon is optional and my particular SoC does not support neon. Also the -print-multi-lib gives this arm400-linux-g++ -print-multi-lib

armv5te_arm9;@mcpu=arm926ej-s
a9;@mcpu=cortex-a9
a7;@mcpu=cortex-a7
armv5te_arm9_soft;@mcpu=arm926ej-s@mfloat-abi=soft
armv5te_arm9_vfp;@mcpu=arm926ej-s@mfloat-abi=softfp@mfpu=vfp
a9_soft;@mcpu=cortex-a9@mfloat-abi=soft
a9_softfp_vfp;@mcpu=cortex-a9@mfloat-abi=softfp@mfpu=vfp
a9_softfp_vfpv3-d16;@mcpu=cortex-a9@mfloat-abi=softfp@mfpu=vfpv3-d16
a7_soft;@mcpu=cortex-a7@mfloat-abi=soft
a7_softfp_vfpv4;@mcpu=cortex-a7@mfloat-abi=softfp@mfpu=vfpv4
a7_softfp_neon-vfpv4;@mcpu=cortex-a7@mfloat-abi=softfp@mfpu=neon-vfpv4
a7_hard_neon-vfpv4;@mcpu=cortex-a7@mfloat-abi=hard@mfpu=neon-vfpv4

I have tried passing these three possible architecture arguments in the mkspecs.

QMAKE_CFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 -mfloat-abi=soft
QMAKE_CXXFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 -mfloat-abi=soft 

For this i got

"arm400-linux-g++: error: -mfloat-abi=soft and -mfloat-abi=hard may not be used together".

I also tried passing these arguments

-mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=vfp

-mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=vfpv3-d16

But it had the same effect.

libxxxx.a(yyyyy.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not

I am running out of options here. Why is this issue coming up ?

1 Answers1

0

You have to build all the libs with the same VFP option as your source code.

According to ATPCS(ARM-Thumb procedure call standard), float parameters are passed by VFP registers if available. Otherwise, they are passed by the ARM integer registers.

If lib A is compiled with the soft-float option, you cannot call its functions due to the ABI conflict from lib B or vice versa.

If you don't have certain lib's source code but the binary, your only option is to match the other projects build options to the lib's.

However, chances are good that you will find different versions of the library with various build options.

Jake 'Alquimista' LEE
  • 6,197
  • 2
  • 17
  • 25
  • But in my case, i tried to force this to build to use softfp by passing `-mfloat-abi=softfp`. Still in the error it is `-mfloat-abi=hard`. I can't really understand how ninja build is fixing these values. Both the lib A and lib B is from a single build. –  Nov 07 '17 at 13:38
  • @Kar Are there assembly files in the projects? In assembly, you can override the global build option in the header with the directive `.fpu`. And besides, if your SoC features VFP, you should use it since it makes a world difference in performance. – Jake 'Alquimista' LEE Nov 07 '17 at 13:47
  • I found out a [FILE](https://pastebin.com/JiGavCB4) which i believe is fixing these arguments for GN build in qtwebengine. But i am not sure about the syntax to make changes in the file. It is a `.pri` file. –  Nov 08 '17 at 06:48