David Chisnall
2014-Jun-25 12:45 UTC
[LLVMdev] [cfe-dev] AArch64 Clang CLI interface proposal
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
Renato Golin
2014-Jun-25 12:57 UTC
[LLVMdev] [cfe-dev] AArch64 Clang CLI interface proposal
On 25 June 2014 13:45, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:> 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.On this subject, what if the build system (autoconf / cmake / etc) could, based on its own arguments, build the command line automatically, based on the host architecture, target triple and other flags? Wouldn't that solve the problem of having config files AND the problem of an extra bash script? However, I think this is independent of the CLI change, that needs to be saner no matter how we solve cross-compilation. I still believe that the CLI could have different ways of detecting target properties (triple, flags, config files) but all of them should plug into the same common infrastructure, ie. arch + feature flags to -cc1. cheers, --renato
David Chisnall
2014-Jun-25 12:58 UTC
[LLVMdev] [cfe-dev] AArch64 Clang CLI interface proposal
On 25 Jun 2014, at 13:57, Renato Golin <renato.golin at linaro.org> wrote:> On this subject, what if the build system (autoconf / cmake / etc) > could, based on its own arguments, build the command line > automatically, based on the host architecture, target triple and other > flags? Wouldn't that solve the problem of having config files AND the > problem of an extra bash script?Our experience with the FreeBSD ports tree is that things that require changing a build system are difficult. David