README: Build Environment Changes

LLVMers,

If you're not working from the CVS "head", you can ignore this.

Otherwise, please read it!

I have committed changes to CVS head that require changes to your build
environment. This is part of PR432. The changes involve getting the CFE
to build an executable named llvm-gcc instead of gcc. The hyphenated
name was chosen to be consistent with other LLVM tools, it is also
needed on some platforms so that llvm-nm can be found in the path when
the CFE is configuring the libstdc++ (don't ask why!).

Quick Fix:
1. Put the $CFEINSTALL/bin directory into your PATH variable
2. Remove $CFEINSTALL/bin/*
3. Remove shell aliases for "llvmgcc" and "llvmgxx" or change them to
    invoke llvm-gcc and llvm-gxx.
4. Rebuild llvm with "make tools-only"
5. Rebuild the CFE with --program-prefix=llvm-
6. Rebuild llvm with "make"

More Details:
1. Put the $CFEINSTALL/bin directory into your PATH variable. We're
    going to configure the CFE so it produces llvm-gcc, not "gcc" so
    putting $CFEINSTALL/bin in your path is okay as it won't conflict
    with your "native" GCC compiler.
2. Remove $CFEINSTALL/bin/*. This ensures that any old "gcc" or "g++"
    CFE executables won't get found while we rebuild.
3. Remove shell aliases for "llvmgcc" and "llvmgxx" or change them to
    invoke llvm-gcc and llvm-gxx. These aliases are not needed any more
    since the tools built by CFE will be named llvm-gcc and llvm-g++
4. update your tree to latest CVS
5. make "tools-only' to get the latest gccas. When llvmgcc gets
    reconfigured, it will expect, for some reason, that gccas can handle
   the --traditional-format option. This support has been put into gccas
   but you need to rebuild gccas before rebuilding the CFE.
6. reconfigure your CFE as usual, but make sure you add the option
   --program-prefix=llvm- (note the trailing dash) to the end of the
   configure command. This is CRITICAL!
7. rebuild the CFE with "make all ; make install"
8. rebuild llvm with "make all"
9. run "make check" to make sure everything is working. You should get:
    # of expected passes 940
    # of expected failures 30

What Happened:
1. CFE should now be configured with --program-prefix=llvm- (note the
   trailing dash). This causes the $CFEINSTALL/bin directory to get
   populated with llvm-gcc and llvm-g++ instead of just gcc and g++
2. The LLVM configure script was changed to just locate llvm-gcc and
   llvm-g++ in the path.
3. The LLVMGCCDIR variable is now set to the path based on llvm-gcc
    being found and working correctly. Its not an error to not find
   llvm-gcc but you can't build the runtime libs in that case.
4. The --with-llvmgccdir= for LLVM's configure is now removed as its
   not needed. It is inferred by where llvm-gcc is found.
5. The various LLVM makefiles were adjusted to accommodate this.

Yet To Be Done:
The CFEBuildInstrs.html and GettingStarted.html documents need to be
updated to account for this.

Impact:
1. All the nightly testers will fail until the CFE they use is
    brought up to date.

2. Configuring LLVM will succeed but LLVMGCCDIR won't be set and
   consequently the runtime directory build will fail. "make tools-only"
   will still work though.

3. The changes have passed on Linux. Testing is underway on Solaris
    and Cygwin. It would be good if someone could pitch in and validate
    PPC and FreeBSD too.

Starting a FreeBSD build now...

Reid Spencer wrote:

I successfully build CFE frontend at FreeBSD 5.3.

Next nighttest run show more detail information :slight_smile:

Vladimir

I successfully build CFE frontend at FreeBSD 5.3.

Next nighttest run show more detail information :slight_smile:

After last 2 nighttest runs i see stable failure result:

llvm[2]: Compiling dummylib.c for Debug build (bytecode)
llvm-g++: installation problem, cannot exec `gccas': No such file or directory
gmake[3]: *** [/usr/home/wanderer/pkg/build/llvm/night/build/llvm/runtime/GCCLibraries/crtend/Debug/Exception.bc] Error 1
gmake[3]: Leaving directory `/usr/home/wanderer/pkg/build/llvm/night/build/llvm/runtime/GCCLibraries/crtend'
gmake[2]: *** [crtend/.makeall] Error 2
gmake[2]: Leaving directory `/usr/home/wanderer/pkg/build/llvm/night/build/llvm/runtime/GCCLibraries'
gmake[1]: *** [GCCLibraries/.makeall] Error 2
gmake[1]: *** Waiting for unfinished jobs....

At this moment i doesn't have installed LLVM at tester machine (only installed CFE)
and then doesn't have in path gccas.

But at monent build llvm/runtime/GCCLibraries we are have builded LLVM tools (including gccas) in my case
in build/llvm/Debug/bin.

Vladimir

Sloppy me. I fixed the path for llvm-gcc but not for llvm-g++. My last
patch to Makefile.rules fixes that so it should start working again.

Reid.

Next problem detected by nighttest:

LLVM build fail with errors:

gmake[4]: Entering directory `/usr/home/wanderer/pkg/build/llvm/night/build/llvm/projects/Stacker/lib/runtime'
llvm[4]: Compiling stacker_rt.c for Debug build (bytecode)
default/bin/llvm-gcc: not found
gmake[4]: *** [/usr/home/wanderer/pkg/build/llvm/night/build/llvm/projects/Stacker/lib/runtime/Debug/stacker_rt.bc] Error 1
gmake[4]: Leaving directory `/usr/home/wanderer/pkg/build/llvm/night/build/llvm/projects/Stacker/lib/runtime'

Vladimir

There was a logic error in configure.ac pertaining to finding the
LLVMGCCDIR. That's been fixed now. Next run should find both llvm-gcc
and llvm-g++ either via the --with-llvmgccdir= option or in the PATH
variable.

Reid.