[gccsdk] GCC - failed to merge ...

John Tytgat John.Tytgat at aaug.net
Sat Nov 21 09:26:41 PST 2015

On 11/21/2015 05:14 PM, Gavin Wraith wrote:
> Back in September, with much kind assistance, I managed to compile
> Lua 5.3.1 with GCC 4.7.4. Now Lua 5.3.2 is out. But, although I
> think my makefile is the same, and there have been no changes
> in filenames, the compilation fails with errors
>    error: lua.o uses FPA instructions, whereas lua6 does not
>    failed to merge target specific data of file lua.o
>        --- etc ---
> Two queries: 1. Does FPA imply that is not VFP?
>               2. Does GCC retain information from previous compilations?

First of all, it's actually the output of the linker, not the compiler 
(aside, 'gcc' is just a front-end for those two). Secondly, this message 
means that the linker detects an, in his eyes, incompatible mix of 
object files concerning FP use in the object files.

The ELF object file has in its header a set of flags which are used for 
storing attribute information, like which ABI it conforms to, whether it 
is PIC code, FP type used, etc.  It's a bit crude and more detailed 
attributes are now stored in specific ELF section .ARM.attributes.

Use readelf -h to read the ELF header details, cfr. the "Flags:" entry.

If you create object files...
- with UnixLib as runtime library & soft-float calling convention + fp 
in software (i.e. default compiler options): flags are "0x200, GNU EABI, 
software FP"
- with UnixLib as runtime library & soft-float calling convention + fp 
via VFP instructions (i.e. -mfpu=vfp): flags are "0x600, GNU EABI, 
software FP, VFP"
- with SharedCLibrary (SCL) as runtime library & hard-float calling 
convention + fp via FPA instructions (i.e. -mlibscl or -mmodule) : flags 
are "0x0"

So I suspect you have a mix of SCL and UnixLib object files and/or 
inconsistent -mfpu= option overrule of its default value for the chosen 
runtime library.

> [...]
> I was expecting -mfpu=vfp to cause lua.o to have vfp instructions (actually it
> does not use any floating point instructions). And how can GCC tell me that
> lua6 does not have this or that floating point format when lua6 is the target
> and so should presumably have the same fp format as all the files which
> comprise it?

The compiler passes on the soft-float/vfp/... compiler settings to the 
assembler as well and the latter distills this info into a single ELF 
header flags entry.  Whether or not your code used FP instructions, is 
not considered.


More information about the gcc mailing list