>
>> Sorry to step into this in the middle of a thread, but what exactly is
>> LLVM's autoconf doing that "autoconf shouldn't do if properly set up"?
>
> 1) Variables like CC, CXX, CFLAGS don't work properly when submitted via
> the command line. The handling seems to be inconsistent, i.e. it seems
> that parts of the toolchain receive these flags, others don't.
> This is just a cosmetic problem, of course.
Is this specifying CC, CXX, and CFLAGS during the "configure" process
or during the "make" process?
That was during configure.
Which parts of the
toolchain don't get the flags? Also, are we talking LLVM or LLVM-GCC?
Both.
I seem to recall that LLVM and LLVM-GCC were failing in slightly
different ways, but I'll have to verify this more precisely.
Would --debug=j be a good way to log all commands as they are executed?
Somehow I overlooked that option and didn't use it during my earlier
tests, which made diagnosing this kind of problem somewhat difficult.
> 2) The setting of --build should be the default for --host, and the
> value of --host should be the default for --target. The build machinery
> seems to take the defaults for --host and --target from elsewhere,
> specifying just --build or --host will cause amd64 assembly to be fed to
> an assembler running in i686 mode.
I don't have much of an explanation for this. I would suggest
specifying all three (build/host/target) parameters if you're running
into this problem. It might help in the short term while we figure out
the issue.
I've been doing that all the time, and it got LLVM unwedged.
It wasn't enough to get LLVM-GCC to compile though.
> 3) On a 64-bit Ubuntu, setting --build/host/target=i686-pc-linux-gnu
> will work when compiling with gcc, but llvm-gcc will try to feed 64-bit
> machine code to the assembler in this situation. At least that's what
> happens when bootstrapping.
(We derive our configure script for llvm-gcc from gcc's configure
script, so there shouldn't be any drastic changes.) If you're
cross-compiling, I don't think you can do a bootstrap.
Oh. What would be the problems with that
If you're
compiling natively, you don't need to specify the build/host/target
flags.
Try disabling bootstrapping to see if this helps your problem.
I wanted to avoid issues with compiling LLVM for 64 bits. (I'm running a
64-bit Linux here.)
There was a warning that you have to disable PIC generation in that
situation, and I wasn't sure whether that wouldn't get me into other
kinds of trouble.
> If autoconf in LLVM can be cleaned up, I'd be really like to do it.
> Having expertise in that area might just be what's been missing, so if
> you're willing to give a helping hand to an autoconf newbie, this might
> finally work out.
>
I suggest looking at the autoconf/configure.ac (for LLVM) and
configure.in & gcc/configure.ac (for LLVM-GCC) scripts. You can find
documentation here:
http://www.gnu.org/software/autoconf/manual/autoconf.html
The documentation will help you understand what the different macros
in the .ac/.in files are up to and how they work. I'll try to help as
much as I can, but I warn that I'm not an expert on GCC's configure
scripts (they do a lot of...interesting things there).

Thanks. I hope to find some time for this tomorrow.
Regards,
Jo