Scott Ricketts
2009-May-06 19:22 UTC
[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
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! > > Ciao, > > Duncan. >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[1]: Entering directory `/pkg/build/llvm-svn2/llvm-obj/lib/VMCore' llvm[1]: Building Intrinsics.gen.tmp from Intrinsics.td llvm[1]: Compiling AsmWriter.cpp for Release build llvm[1]: Compiling Attributes.cpp for Release build llvm[1]: Compiling AutoUpgrade.cpp for Release build llvm[1]: Compiling BasicBlock.cpp for Release build llvm[1]: Compiling ConstantFold.cpp for Release build llvm[1]: Compiling Constants.cpp for Release build llvm[1]: Compiling Core.cpp for Release build llvm[1]: Compiling Dominators.cpp for Release build llvm[1]: 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: ../llvm/configure --prefix=/pkg/bin/llvm --with-llvmgccdir=/pkg/build/llvm-svn2/install/ and then did "make" in the llvm-obj directory. But this build failed: make[2]: Entering directory `/pkg/build/llvm-svn2/llvm-obj/tools/bugpoint' llvm[2]: Compiling BugDriver.cpp for Debug build llvm[2]: Compiling CrashDebugger.cpp for Debug build llvm[2]: Compiling ExecutionDriver.cpp for Debug build llvm[2]: Compiling ExtractFunction.cpp for Debug build llvm[2]: Compiling FindBugs.cpp for Debug build /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc: In member function ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(double)’: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ostream.tcc:374: 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? Scott
Anton Korobeynikov
2009-May-06 19:51 UTC
[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
Hello, Scott> 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.Even if you'll succeed, most probably LLVM will be miscompiled. gcc 4.1.2 is known buggy: http://llvm.org/docs/GettingStarted.html#brokengcc --- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.
Scott Ricketts
2009-May-06 20:26 UTC
[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
On Wed, May 6, 2009 at 12:51 PM, Anton Korobeynikov <anton at korobeynikov.info> wrote:> Even if you'll succeed, most probably LLVM will be miscompiled. gcc > 4.1.2 is known buggy: http://llvm.org/docs/GettingStarted.html#brokengcc >Yes, so I have read -- which is why I initially installed gcc-4.2.4. My original post was looking for help on how to use gcc-4.2.4. Some suggestions were made, but I was not able to get everything built. It seems that despite attempting to configure with everything pointing to gcc-4.2.4 (and not the system gcc 4.1.2), at some point in the build, something would look for a file or use a file from the system gcc 4.1.2. I would love to get this built using gcc-4.2.4, but I think I could use some help. If someone could point me to the relevant config variables, I might be able to debug this.
Maybe Matching Threads
- [LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
- [LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
- [LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
- [LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
- [LLVMdev] Building llvm using non-system gcc/binutils