This is an archive of the discontinued LLVM Phabricator instance.

[MIPS] Add support for direct-to-nacl in Clang
ClosedPublic

Authored by petarj on Jun 25 2015, 10:55 AM.

Details

Summary

[MIPS] Add support for direct-to-nacl in Clang

For Mips direct-to-nacl, the goal is to be close to le32 front-end and
use Mips32EL backend. This patch defines new NaClMips32ELTargetInfo and
modifies it slightly to be close to le32. It also adds necessary parts,
inline with ARM and X86.

Diff Detail

Repository
rL LLVM

Event Timeline

petarj updated this revision to Diff 28480.Jun 25 2015, 10:55 AM
petarj retitled this revision from to [MIPS] Add support for direct-to-nacl in Clang.
petarj updated this object.
petarj edited the test plan for this revision. (Show Details)
petarj added a reviewer: dschuff.
petarj set the repository for this revision to rL LLVM.
petarj added a subscriber: Unknown Object (MLST).
dschuff added inline comments.Jun 25 2015, 11:17 AM
lib/Driver/ToolChains.cpp
2391 ↗(On Diff #28480)

should this be mipsel-nacl/bin?

2416 ↗(On Diff #28480)

it seems wrong to include a C++ path here; I don't think this function is C++ specific?
And in any case, is this intended to override -nobuiltininc?

lib/Driver/Tools.cpp
1184 ↗(On Diff #28480)

this part may not be upstreamable since the LLVM part that implements it won't be upstreamable.

8327 ↗(On Diff #28480)

which symbols are causing trouble here, and how? can you give some more detail?

I wasn't aware of the difference, but I have an unrelated change that may be affected by it.

petarj added inline comments.Jun 25 2015, 3:45 PM
lib/Driver/ToolChains.cpp
2391 ↗(On Diff #28480)

should this be mipsel-nacl/bin?

Not in our version today. "bin" is required/sufficient to find mipsel-nacl-ld.
This way we do not need to install ld into a new location.

2416 ↗(On Diff #28480)

ooouch, this hunk ended up in the wrong function.

lib/Driver/Tools.cpp
1184 ↗(On Diff #28480)

OK, I will remove it in the next patch set.

8327 ↗(On Diff #28480)

which symbols are causing trouble here,

Symbols that are same in both libraries. One example is picking wrong implementation of __libnacl_irt_thread.

and how? can you give some more detail?

Take a look at example that Nikola reported at

https://sourceware.org/ml/binutils/2015-03/msg00017.html

petarj updated this revision to Diff 28511.Jun 25 2015, 4:13 PM
petarj removed rL LLVM as the repository for this revision.

New patch uploaded. PTAL.

petarj set the repository for this revision to rL LLVM.Jun 25 2015, 4:16 PM
dschuff accepted this revision.Jul 6 2015, 10:12 PM
dschuff edited edge metadata.
dschuff added inline comments.
lib/Driver/ToolChains.cpp
2391 ↗(On Diff #28511)

this is ok for now. at some point I want to rework how the nacl file-path code works because it's a bit nonstandard... I'd like for e.g. --sysroot to work (it doesn't today).

This revision is now accepted and ready to land.Jul 6 2015, 10:12 PM

oh, also don't forget to add a test, similar to nacl-direct.c (or add to that directly)

petarj updated this revision to Diff 29225.Jul 7 2015, 5:33 PM
petarj edited edge metadata.

Patch rebased and test added to test/Driver/nacl-direct.c.

This revision was automatically updated to reflect the committed changes.