[LLVMdev] The Trouble with Triples

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Jul 9 02:39:09 PDT 2015


On 9 Jul 2015, at 10:25, Daniel Sanders <Daniel.Sanders at imgtec.com> wrote:
> 
>> Some people have suggested config files. So we'd have (say)
>> Targets.cfg on LLVM's source tree copied to the build tree, unless you
>> specify -DTARGETS_CONFIG=/foo/bar/UbuntuTargets.cfg, and that would
>> populate the defaults in TargetABI. Of course, this would be a big
>> change and it's probably for after we do all we already planned to. :)
> 
> Some of my colleagues from other projects have suggested the same thing off-list. It sounds like a good solution to me. I haven't given much thought to the details yet, but the one concern that springs to mind is that a simple config file (e.g. a triple -> tuple map) is likely to repeat itself a lot, and avoiding that redundancy moves the config file towards a small scripting language. Finding the right balance might be tricky.

The use-case that I’d really like to go from mostly-working to actually-working is the ability to create symlinked versions of clang with a triple prefix and have it behave sensibly.  We can symlink clang to mips64-unknown-freebsd-clang and get a working cross-compiler, more or less, except that we also want to specify things like the default sysroot.  Having the bit in the name of the compiler just be a name for a config file containing a set of command-line options would be very nice - we’d have a set of predefined names, and then if someone wanted to provide a androidsdk-v47-arm.conf (or whatever) and just drop it into a known location then they’d be able to use androidsdk-v47-arm-clang as a cross compiler.

David





More information about the llvm-dev mailing list