[LLVMdev] [cfe-dev] AArch64 Clang CLI interface proposal

David Chisnall David.Chisnall at cl.cam.ac.uk
Wed Jun 25 05:45:20 PDT 2014


On 25 Jun 2014, at 12:58, James Molloy <james at jamesmolloy.co.uk> wrote:

> This is one of the worst parts about the Clang CLI for cross compilation at the moment. I'd really like, if we're changing the CLI, to allow users to remove it. For example, if I specify -march=armv7-a, it *shouldn't* need me to put "-target arm" before it to work!

One thing that I've been pondering for a little while is making clang's use of the triple a config file.  In particular, we'd like to invoke things like mips4-unknown-freebsd-clang and have it really mean 'clang -target mips64-unknown-freebsd -mcpu=mips4 -msoft-float --sysroot=/usr/local/sysroots/mips4 {whatever}'.  For cross compiles, we'd only need one clang, a symlink, and a config file.  I pondered a more structured config file, but really there isn't much that we'd want to do that isn't already covered by command-line arguments, so just having it look for ${LOCALBASE}/etc/llvm/mips4-unknown-freebsd-clang.conf would be fine.

We can do this via shell scripts now, but even with exec the extra shell invocation has a measurable overhead and in some cases (e.g. i386-unknown-freebsd-clang on FreeBSD/x86-64) we'd like to just use the default values for the triple.

David





More information about the llvm-dev mailing list