[cfe-dev] Configuration files

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 19 03:23:19 PDT 2016


On 19 September 2016 at 11:15, David Chisnall
<david.chisnall at cl.cam.ac.uk> wrote:
> I’d like to see {foo}-clang interpreted as equivalent to clang --config {foo}.  We currently understand {triple}-clang, but this isn’t enough to describe most cross-compile toolchains.  I’d love to be able to drop a sysroot (maybe a cross-linker) and a config file in a system with a working clang and have cross compilation.

That's a good point, too. If there are no {foo} config files in the
search path, assume it's a triple, and fallback to the current
behaviour.

It's up to the distros to create the config files and symlinks to
their own configs. Users can do the same on their own ~/bin PATHs.


> We should also probably automatically silence unused options from config files.  For example, if my cross-compile toolchain passes some extra linker arguments with -Wl,-foo, then I don’t want every single line in my build to complain that -Wl is unused in conjunction with -c.

That's going to be a bit harder. Since the proposal is to just
pre-pend the config, it'd be *really* easy and transparent to
implement this in the driver. But if we need to know where the option
came from and then act differently, this would need pervasive changes
to many different places in the driver, and different toolchain
emulation (darwin, freebsd, linux, etc) may behave differently, since
they implement the same logic mostly on their own.

I'd consider this wish-lis, more than part of the initial proposal.

cheers,
--renato



More information about the cfe-dev mailing list