Scott Ricketts
2009-May-05 18:15 UTC
[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
Thanks for the suggestions. It looks like Duncan's suggestion got me a step closer, but I still can't build llvm-gcc... On Tue, May 5, 2009 at 12:56 AM, Christian Sayer <Christian.Sayer at dibcom.fr> wrote:> did you try a simple > > $ ../llvm-2.5/configure --prefix=/pkg/bin/llvm/ > CC=/pkg/bin/gcc-4.2.4/bin/gcc CXX=/pkg/bin/gcc-4.2.4/bin/g++Tried that, same error. 2009/5/5 Duncan Sands <baldrick at free.fr>:> how about: > > export PATH=/pkg/bin/:$PATH > ../llvm-2.5/configure --prefix=/pkg/bin/llvm/ > > instead?I did that, and then "make tools-only" -- which resulted in a successful build of llvm-2.5. Then I went to build llvm-gcc: ../llvm-gcc4.2-2.5.source/configure --prefix=/pkg/build/llvm/llvm-gcc/install --program-prefix=llvm- --enable-llvm=/pkg/build/llvm/llvm-obj/ --enable-languages=c,c++ make LLVM_VERSION_INFO=2.5 and I get this error (which, according to http://www.mail-archive.com/llvmbugs at cs.uiuc.edu/msg02575.html might mean I am using a bad version of gcc)... /pkg/build/llvm/llvm-gcc/obj/./gcc/xgcc -B/pkg/build/llvm/llvm-gcc/obj/./gcc/ -B/pkg/build/llvm/llvm-gcc/install/x86_64-unknown-linux-gnu/bin/ -B/pkg/build/llvm/llvm-gcc/install/x86_64-unknown-linux-gnu/lib/ -isystem /pkg/build/llvm/llvm-gcc/install/x86_64-unknown-linux-gnu/include -isystem /pkg/build/llvm/llvm-gcc/install/x86_64-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc4.2-2.5.source/gcc -I../../llvm-gcc4.2-2.5.source/gcc/. -I../../llvm-gcc4.2-2.5.source/gcc/../include -I../../llvm-gcc4.2-2.5.source/gcc/../libcpp/include -I../../llvm-gcc4.2-2.5.source/gcc/../libdecnumber -I../libdecnumber -I/pkg/build/llvm/llvm-obj//include -I/pkg/build/llvm/llvm-2.5/include -DL_gcov -c ../../llvm-gcc4.2-2.5.source/gcc/libgcov.c -o libgcc/./_gcov.o cc1: /pkg/build/llvm/llvm-2.5/include/llvm/Transforms/Utils/InlineCost.h:44: llvm::InlineCost::InlineCost(int, int): Assertion `Cost == C && "Cost exceeds InlineCost precision"' failed. ../../llvm-gcc4.2-2.5.source/gcc/libgcov.c:644: internal compiler error: Aborted So I tried this config for llvm-gcc: $ ../llvm-gcc4.2-2.5.source/configure --prefix=/pkg/build/llvm/llvm-gcc/install --program-prefix=llvm- --enable-llvm=/pkg/build/llvm/llvm-obj/ --enable-languages=c,c++ CC=/pkg/bin/gcc-4.2.4/bin/gcc CXX=/pkg/bin/gcc-4.2.4/bin/g++ but got: configure: warning: CC=/pkg/bin/gcc-4.2.4/bin/gcc: invalid host type configure: warning: CXX=/pkg/bin/gcc-4.2.4/bin/g++: invalid host type configure: error: can only configure for one host and one target at a time How do I tell llvm-gcc config to use the right version of gcc? /pkg/bin/ is in my path thanks to the suggestion from Duncan. $ echo $PATH /pkg/bin/:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/user_homes/sricketts/bin
Duncan Sands
2009-May-05 19:26 UTC
[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
Hi,> cc1: /pkg/build/llvm/llvm-2.5/include/llvm/Transforms/Utils/InlineCost.h:44: > llvm::InlineCost::InlineCost(int, int): Assertion `Cost == C && "Cost > exceeds InlineCost precision"' failed. > ../../llvm-gcc4.2-2.5.source/gcc/libgcov.c:644: internal compiler error: Abortedthis 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. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: r69515.diff Type: text/x-patch Size: 2685 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090505/9bd657ee/attachment.bin>
Scott Ricketts
2009-May-05 20:24 UTC
[LLVMdev] Using non-system compiler to build llvm and llvm-gcc front end
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. Scott
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] Using non-system compiler to build llvm and llvm-gcc front end