[cfe-dev] Fwd: Re: Small patches to allow fully independent clang/llvm/compiler-rt/libc++

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 15 07:45:56 PDT 2015


On 15 October 2015 at 15:13, C Bergström <cbergstrom at pathscale.com> wrote:
> 1) What should us humans do in the meantime? If it's not done in 30
> days can we consider something simple which gets the job done?

I don't really know. This idea has at least 5 years (I proposed it in
2010) and has been in the list of projects for a while. Nobody seemed
to care much, so I just gave up until this week when someone was
interested in actually implementing it.

The first step would be to have a script that only calculates the
CFLAGS, like llvm-config, so:

$ clang `llvm-target-config --target=mips-linux-gnu --something else`

You can write that script yourself, or liaise with the other people
interested in it to speed up the process. That'd get the job done. I
don't recommend it on a product, or long term support. It's a hack.


> 2) Instead of having the compiler read a config file *every* time -
> would it be possible to just compile that into the driver?
> Implementation detail, but keep installs a bit less complicated.

Perfectly possible. My original idea was to have that in git anyway,
so no reason why Clang can't incorporate it into code (a la TableGen).

Future changes can be submitted as a patch to Clang. Plain and simple.

> clang foo.c # No flags or triples or tuples or gimples.. it just works
> and magically underneath will be gnu-free

If the script / Clang can detect the environment better than it does
today, it could realise that it wants to build a gnu-free binary just
by looking at the filesystem (/etc/release info, /usr/lib stuff,
/proc/cpuinfo vendor).

The names on the configuration database shouldn't change, but the way
they're recognised and set the default are clearly possible.

cheers,
--renato



More information about the cfe-dev mailing list