[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
sricketts at maxentric.com
Wed May 6 12:22:24 PDT 2009
On Tue, May 5, 2009 at 11:33 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Scott,
>> On Tue, May 5, 2009 at 12:26 PM, Duncan Sands <baldrick at free.fr> wrote:
>> > this is indeed a miscompilation by your system compiler. However so many
>> > compilers miscompiled this that a workaround was committed to svn. So you
>> > may want to check out llvm and llvm-gcc from svn. Alternatively, maybe
>> > the patch applies to llvm 2.5 too. I've attached it.
>> I will try the latest from svn... but quick follow up question: If it
>> looks like a miscompilation by my system compiler (gcc 4.1.2), why
>> wasn't gcc-4.2.4 used? Did I make a mistake in configuration? Maybe I
>> am misunderstanding the build process.
> some versions of gcc 4.2 also miscompile this on 64 bit platforms...
> By the way, I attached the wrong patch. Try this new one instead!
Thanks, I am making some progress. The latest from svn (for llvm and
llvm-gcc) built successfully. I built everything without adjusting the
PATH, so I guess I used gcc 4.1.2.
However, I then went back to attempt a build with ENABLE_OPTIMIZED=1
(this is just a test installation, once I get things working I will be
installing on another machine with the same OS). The optimized build
of llvm failed:
make: Entering directory `/pkg/build/llvm-svn2/llvm-obj/lib/VMCore'
llvm: Building Intrinsics.gen.tmp from Intrinsics.td
llvm: Compiling AsmWriter.cpp for Release build
llvm: Compiling Attributes.cpp for Release build
llvm: Compiling AutoUpgrade.cpp for Release build
llvm: Compiling BasicBlock.cpp for Release build
llvm: Compiling ConstantFold.cpp for Release build
llvm: Compiling Constants.cpp for Release build
llvm: Compiling Core.cpp for Release build
llvm: Compiling Dominators.cpp for Release build
llvm: Compiling Function.cpp for Release build
g++: Internal error: Segmentation fault (program cc1plus)
So then I did make clean. No big deal, I can live without the
optimized build. But originally I just built with "make tools-only"
because I had not yet built llvm-gcc. But now I have a built version
of llvm-gcc, so I re-configured with:
and then did "make" in the llvm-obj directory. But this build failed:
make: Entering directory `/pkg/build/llvm-svn2/llvm-obj/tools/bugpoint'
llvm: Compiling BugDriver.cpp for Debug build
llvm: Compiling CrashDebugger.cpp for Debug build
llvm: Compiling ExecutionDriver.cpp for Debug build
llvm: Compiling ExtractFunction.cpp for Debug build
llvm: Compiling FindBugs.cpp for Debug build
In member function ‘std::basic_ostream<_CharT, _Traits>&
internal compiler error: Segmentation fault
Now I am thoroughly confused. Can someone check my installation
process? Here is what I think I am supposed to do:
1) configure llvm without pointing to llvm-gcc, "make tools-only"
2) configure llvm-gcc pointing to the llvm build from step (1)
3) re-configure llvm to point to llvm-gcc from step (2), "make"
FYI, I tried the first patch Duncan sent (applied to llvm-2.5), which
did not fix the problem. I have not yet tried the second patch. I am
assuming that checking out the latest from svn is at least as good?
More information about the llvm-dev