This is an archive of the discontinued LLVM Phabricator instance.

[mips] Pass the ABI to the integrated assembler and add tests the existing arguments.
ClosedPublic

Authored by dsanders on Jul 16 2014, 5:13 AM.

Details

Summary

With this patch (and a corresponding LLVM patch), assembling an empty file with
GCC and Clang -fintegrated-as produce near identical objects. The remaining
differences are:

  • GCC/GAS produce objects have a .pdr section
  • GCC/GAS produce objects have a .gnu.attributes section

Other differences are insignificant such as precise file offsets and the order
of strings in the string table.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 11497.Jul 16 2014, 5:13 AM
dsanders retitled this revision from to [mips] Pass the ABI to the integrated assembler and add tests the existing arguments..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: atanasyan.
atanasyan edited edge metadata.Jul 16 2014, 5:23 AM

See my comment below.

lib/Driver/Tools.cpp
1042

Why do we need to turn off o32 and n64 features here? Why do we switch off only these features and and do not handle n32 and eabi the same way?

dsanders added inline comments.Jul 16 2014, 5:29 AM
lib/Driver/Tools.cpp
1042

It's to clear the possible backend default ABI's and replace them with the user-specied ABI or Clang's default. The backend can only use o32 or n64 by default

atanasyan added inline comments.Jul 16 2014, 5:51 AM
lib/Driver/Tools.cpp
1042

So we add a new dependency between the driver and the backend here. When or if somebody changes default ABI in the backend he or she must remember about driver. It does not sound good.

Can we fix the backend to be sure that if it gets a single ABI feature say +n32 it definitely override any default ABI settings?

dsanders added inline comments.Jul 16 2014, 6:04 AM
lib/Driver/Tools.cpp
1042

That's right and I agree that we need to find a better way. It will at least assert if they forget.

Can we fix the backend to be sure that if it gets a single ABI feature say +n32 it definitely override any default ABI settings?

Unfortunately no. There's currently no way to group them into a single mutually exclusive group and no way to distinguish a default ABI from a specified ABI. The long term solution to this is most likely to add support for the -target-abi option from 'clang -cc1' to 'clang -cc1as'.

atanasyan accepted this revision.Jul 16 2014, 7:52 AM
atanasyan edited edge metadata.
atanasyan added inline comments.
lib/Driver/Tools.cpp
1042

Thanks. Now I see the problem.

The patch is looking good.

This revision is now accepted and ready to land.Jul 16 2014, 7:52 AM
dsanders closed this revision.Jul 17 2014, 2:55 AM