[PATCH] Default to armv7 cpu for NaCl when march=arm

Renato Golin renato.golin at linaro.org
Tue Mar 24 15:10:11 PDT 2015


In http://reviews.llvm.org/D8589#146393, @dschuff wrote:

> What I really want is that when I have a driver named "arm-nacl-clang" which results in an invocation like:
>  clang -target arm-nacl then the underlying clang -cc1 invocation should be like
>  clang -cc1 -triple armv7--nacl-gnueabihf


I thought so, and I think that's the broken part of it. GCC does it that way, but Clang driver doesn't, and hacks have been made to do so in this horrible way, and it's past time we fix this.

Why can't you have a driver named "armv7-nacl-gnueabihf-clang"?

> So it looks like clang's getARMCPUForMarch is the only user of this getARMCPUForArch. Should I just move this logic there first?


I wish things were that simple. The last time I looked at that part of the code (you may imagined why) was at least one year ago. But what's still clear to me is that those functions hunt you on your sleep. :)

There was some refactoring a while ago, when most of them were moved to the same place (we had many copies of them, slightly different, as you would expect).

If you can't have the driver's name changed, then I should suggest changing the driver at the driver level. In Tools.cpp, freebsd, hexagon and others have created their own versions of drivers, maybe NaCl could do the same? I have to say my knowledge in the driver is old and distant now, but maybe someone else more acquainted with Clang could point you in the right direction.


http://reviews.llvm.org/D8589

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list