This is an archive of the discontinued LLVM Phabricator instance.

NaCl ARM: fix assembler float abi flags
ClosedPublic

Authored by dschuff on Apr 8 2015, 11:53 AM.

Details

Summary

tools::arm::getARMFloatABI() was falling back to guessing soft-float because
it wasn't seeing the GNUEABIHF environment from ComputeEffectivClangTriple
when it was called from gnutools::Assemble::ConstructJob.

Fix by using the effective clang triple in gnutools::Assemble, which now
matches the -triple flag used by cc1 and ClangAs jobs.

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff updated this revision to Diff 23433.Apr 8 2015, 11:53 AM
dschuff retitled this revision from to NaCl ARM: fix assembler float abi flags.
dschuff updated this object.
dschuff added a reviewer: jvoung.
dschuff added a subscriber: Unknown Object (MLST).
jvoung accepted this revision.Apr 10 2015, 9:34 AM
jvoung edited edge metadata.

Otherwise LGTM

lib/Driver/Tools.cpp
7401 ↗(On Diff #23433)

Should this just set Triple = llvm::Triple(getToolChain().ComputeEffectiveClangTriple(Args)); here?

In case other stuff in this case statement depends on the triple later.

This revision is now accepted and ready to land.Apr 10 2015, 9:34 AM
dschuff added inline comments.Apr 10 2015, 11:18 AM
lib/Driver/Tools.cpp
7401 ↗(On Diff #23433)

That causes -mfpu=neon to be added to the linux build as well as NaCl (that causes the linux-as.c test to fail, which uses cortex-a8 as the cpu but does not expect -mfpu=neon). IIUC it should be ok to have -mfpu=neon (for both linux and nacl) because we always default to .fpu neon in the asm file when targeting cortex-a8. But that seems to mean that the assembler doesn't even care (at least for linux and nacl) whether it gets -mfpu=neon or not. I don't really understand why it should care anyway.

The only thing I can think of that can happen, is that calculating the effective triple will then change it and possibly the default CPU (it can happen).

But since that code is a mess anyway, I don't think anyone can know beforehand. I'm happy to trust the tests, and if passing, feel free to commit.

We can catch the rest of the errors via buildbots or broken builds.

cheers,
--renato

lib/Driver/Tools.cpp
7401 ↗(On Diff #23433)

Triple management in the Clang driver is composed of random non-abelian transformations. Don't try to understand it. :)

ok, thanks, I'll commit it as uploaded here (without Jan's suggestion) since that passes all the existing tests and has the behavior we want for NaCl.

This revision was automatically updated to reflect the committed changes.