switching to llvm-g++ as the host compiler

IANACE (I Am Not A Configury Expert :-), but I've been asked to reconfigure LLVM and LLVM-GCC to build with LLVM-GCC (perhaps more accurately, LLVM-G++).

The patches to do this are short. In the LLVM tree, this suffices; it looks for LLVM-GCC first, and if that fails, falls back to GCC:

Index: llvm.test/autoconf/configure.ac

IANACE (I Am Not A Configury Expert :-), but I've been asked to
reconfigure LLVM and LLVM-GCC to build with LLVM-GCC (perhaps more
accurately, LLVM-G++).

The patches to do this are short. In the LLVM tree, this suffices; it
looks for LLVM-GCC first, and if that fails, falls back to GCC:

Would it make sense to have configure bootstrap the current sources
instead of using whatever llvm-gcc is installed?

Of course, I'm omitting the diffs resulting from the re-auto-
confiscation of both trees. I was obliged to tweak all the version
checks in the LLVM file AutoRegen.sh in order to get it to run :-),
but no errors turned up after my hacking. (Should AutoRegen.sh be
updated too?)

I was just asking about this in IRC. I couldn't grok why AutoRegen.sh
wouldn't work on a stock Leopard install. Fixing this would be most
welcome.

deep

Seems reasonable.

The attached patches affect the *tests*, not the actual builds
themselves; is that intentional?

-Eli

Please make sure when we are running the llvm test suite the "native" executables are still built with gcc (or another compiler) unless it's explicitly specified to be llvm-gcc. Thanks.

Evan

Shouldn't it be using the compiler specified by --with-llvmgcc/--with-llvmgxx if specified? Normally that just gives a compiler driver for the test suite, but it seems appropriate to use here as well, since most people won't have llvm-gcc-4.2 built with --program-prefix=llvm- unless they do special configuration there as well.

Or maybe llvm-gcc-4.2 should be defaulting to --program-prefix=llvm- if --enable-llvm is used?

Shantonu

Also, we should fall back to a default of "gcc" and "g++" if LLVM
isn't available.

-bw

I'm missing something significant here. I tried my patch before posting it to the list, and I'm pretty sure that LLVM got compiled with a previously installed LLVM-GCC. And the tests I ran seemed "normal" too (i.e. the right thing got tested).

Am I misunderstanding you? Could you be more specific? What, exactly, do you foresee going wrong?

Thank you in advance,

stuart

Oh, nevermind, my stupid mistake.

-Eli