On Fri, Oct 07, 2016 at 12:52:32AM +0100, Maciej W. Rozycki wrote: > On Thu, 6 Oct 2016, James Hogan wrote: > > > The native ABI vDSO linker script vdso.lds is built by preprocessing > > vdso.lds.S, with the native -mabi flag passed in to get the correct ABI > > definitions. Unfortunately however certain toolchains choke on -mabi=64 > > without a corresponding compatible -march flag, for example: > > > > cc1: error: ‘-march=mips32r2’ is not compatible with the selected ABI > > scripts/Makefile.build:338: recipe for target 'arch/mips/vdso/vdso.lds' failed > > > > Fix this by including ccflags-vdso in the KBUILD_CPPFLAGS for vdso.lds, > > which includes the appropriate -march flag. > > > > Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") > > Signed-off-by: James Hogan > > Cc: Ralf Baechle > > Cc: linux-mips@linux-mips.org > > Cc: # 4.4.x- > > --- > > Reviewed-by: Maciej W. Rozycki > > NB by default GCC is configured for the default of `-march=from-abi', > which is why saying `-mabi=64' only often works as such GCC implicitly > switches to a compatible `-march=' setting (i.e. `mips3' vs `mips1' for > o32). However when configured with `-march=' set to a particular ISA > level, such as `mips32r2' quoted above you need to select a compatible ISA > explicitly when switching to a 64-bit ABI (arguably you could configure > with `-march=mips64r2' instead as with a 32-bit ABI such a setting would > limit the instruction set to the 32-bit subset automatically). Thanks Maciej for the description. The toolchain in question was a buildroot toolchain, which does I believe default to a particular -march, so that makes a lot of sense. > > Also I've noticed $(aflags-vdso) duplicate `-I' and `-E' options already > included with $(ccflags-vdso); I wonder if the duplicates should simply be > removed or whether $(cflags-vdso) ought to filter from $(KBUILD_CFLAGS) > and $(aflags-vdso) -- from $(KBUILD_AFLAGS) instead (or $(ccflags-vdso) > should just take the options from $(KBUILD_CPPFLAGS)). Also why `-E' is > supposed to take an argument? Can you please have a look at it? I think -E is to catch -EL / -EB. Removing the duplication is easily fixed (I'll post a patch soon). As for whether it should filter from the other KBUILD_ flags, I'm inclined to avoid changing it unless we can be sure it will be more robust as a result. Cheers James