[PATCH] D52784: [ARM][AArch64] Pass through endianness flags to the GNU assembler

Peter Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 08:06:14 PDT 2018


peter.smith created this revision.
peter.smith added reviewers: rengolin, compnerd, olista01.
Herald added subscribers: chrib, kristof.beyls, srhines.
Herald added a reviewer: javed.absar.

The big-endian arm32 Linux builds are currently failing when the -mbig-endian and -fno-use-integrated-as flags are used and the assembler default is little endian. We are not registering that the clang -mbig-endian flag needs to be passed through to the assembler to override its default target.

      

The patch always passes through -EL or -BE to the assembler, taking into account the target and the -mbig-endian and -mlittle-endian flag.

      

Fixes pr38770

FIXME: While fixing this I note that giving the endianness in march does not override the endianness in the triple. This is not specific to -fno-integrated-as so if I write --target=arm-linux-gnueabihf -march=armebv7-a then the output is little endian. I've updated the targets in the test so that the target endian matches the march endianness.

I think that this behaviour is wrong for a couple of reasons:

- -march=armebv7-a should either give an error message if it disagrees with the triple or should override the triple.
- The GNU assembler doesn't understand eb in march so we should ideally not pass it through, or rely on people to not use march that way.

This can be fixed but I've not done so in this patch.


https://reviews.llvm.org/D52784

Files:
  lib/Driver/ToolChains/Gnu.cpp
  test/Driver/linux-as.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52784.167950.patch
Type: text/x-patch
Size: 11512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181002/eae95972/attachment.bin>


More information about the cfe-commits mailing list