[LLVMdev] Problems building cfrontend 4 source on SUSE 10.1

Reid Spencer rspencer at reidspencer.com
Mon Nov 6 11:17:14 PST 2006


This is an libpath problem.  When xgcc runs it wants to dynamically link
the libgcc.so. When you run it from the command line it will find your
system libgcc.so (which works) and so you don't see the segfault.  When
you run xgcc from the Makefile, it will have set LD_LIBRARY_PATH to get
your <cfebuilddir>/gcc directory which will find the libgcc.so that it
just built, which is the one that is segfaulting.  To fix this, do the
following:

LD_LIBRARY_PATH=<cfebuilddir>/gcc <insert xgcc command line here>

Then it will run xgcc so that it will find the new (buggy) libgcc.so

Hopefully that will reproduce the problem and you can then get a stack
trace from cc1

Reid.

On Mon, 2006-11-06 at 10:45 -0800, Robert Mykland wrote:
> Reid,
> 
> I followed the steps but got stuck as described below:
> 
> Reid Spencer wrote: 
> > Hi Robert,
> > 
> > Please make sure that you:
> > 
> > 1. Completely rebuild LLVM (make clean; make reconfigure; make
> > tools-only)
> >   
> This all worked great.
> > 2. Completely rebuild llvm-gcc (wipe out the build dir with rm -rf,
> > configure llvm-gcc 
> >    and rebuild it)
> >   
> Okay, got the same error as before.
> > If you've done that, then please enter the debugger and get a stack
> > trace for us. 
> > You will need to:
> > 
> > 1. Capture the xgcc compile command that failed
> >   
> I captured this command and it is:
> 
> /home/mykland/llvm-gcc/obj/gcc/xgcc -B/home/mykland/llvm-gcc/obj/gcc/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/bin/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/lib/
> -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/include -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/sys-include -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc4-1.8-source/gcc -I../../llvm-gcc4-1.8-source/gcc/. -I../../llvm-gcc4-1.8-source/gcc/../include -I../../llvm-gcc4-1.8-source/gcc/../libcpp/include  -I/home/mykland/llvm/include -I/home/mykland/llvm/include -DL_muldi3 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc4-1.8-source/gcc/libgcc2.c -o libgcc/./_muldi3.o
> 
> My problem is that when I rerun the command it doesn't fail in the
> same way.  Several things can't be found anymore.  The first time the
> command runs inside the makefile environment the messages look like
> this:
> 
> /home/mykland/llvm-gcc/obj/gcc/xgcc -B/home/mykland/llvm-gcc/obj/gcc/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/bin/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/lib/
> -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/include -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/sys-include -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc4-1.8-source/gcc -I../../llvm-gcc4-1.8-source/gcc/. -I../../llvm-gcc4-1.8-source/gcc/../include -I../../llvm-gcc4-1.8-source/gcc/../libcpp/include  -I/home/mykland/llvm/include -I/home/mykland/llvm/include -DL_muldi3 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc4-1.8-source/gcc/libgcc2.c -o libgcc/./_muldi3.o
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:541: internal compiler error:
> Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://llvm.org/bugs> for instructions.
> make[2]: *** [libgcc/./_muldi3.o] Error 1
> make[2]: Leaving directory `/home/mykland/llvm-gcc/obj/gcc'
> make[1]: *** [libgcc.a] Error 2
> make[1]: Leaving directory `/home/mykland/llvm-gcc/obj/gcc'
> make: *** [all-gcc] Error 2
> 
> Afterwards, when I run it on the command line after the make has
> failed the error messages look like this:
> 
> mykland at ascenium:~/llvm-gcc/obj> /home/mykland/llvm-gcc/obj/gcc/xgcc
> -B/home/mykland/llvm-gcc/obj/gcc/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/bin/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/lib/
> -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/include -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/sys-include -O2  -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc4-1.8-source/gcc -I../../llvm-gcc4-1.8-source/gcc/. -I../../llvm-gcc4-1.8-source/gcc/../include -I../../llvm-gcc4-1.8-source/gcc/../libcpp/include  -I/home/mykland/llvm/include -I/home/mykland/llvm/include -DL_muldi3 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc4-1.8-source/gcc/libgcc2.c -o libgcc/./_muldi3.o
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:35:23: error: auto-host.h: No
> such file or directory
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:40:21: error: tconfig.h: No
> such file or directory
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:43:16: error: tm.h: No such
> file or directory
> In file included from ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:64:
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.h:214:3: error: #error "expand
> the table"../../llvm-gcc4-1.8-source/gcc/libgcc2.c: In function
> ‘__mulhi3’:
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:535: error: ‘BITS_PER_UNIT’
> undeclared (first use in this function)
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:535: error: (Each undeclared
> identifier is reported only once
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:535: error: for each function
> it appears in.)
> 
> ...or with the -v command added they look like this:
> 
> mykland at ascenium:~/llvm-gcc/obj> /home/mykland/llvm-gcc/obj/gcc/xgcc
> -B/home/mykland/llvm-gcc/obj/gcc/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/bin/
> -B/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/lib/
> -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/include -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/sys-include -O2  -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../llvm-gcc4-1.8-source/gcc -I../../llvm-gcc4-1.8-source/gcc/. -I../../llvm-gcc4-1.8-source/gcc/../include -I../../llvm-gcc4-1.8-source/gcc/../libcpp/include  -I/home/mykland/llvm/include -I/home/mykland/llvm/include -DL_muldi3 -fvisibility=hidden -DHIDE_EXPORTS -c ../../llvm-gcc4-1.8-source/gcc/libgcc2.c -o libgcc/./_muldi3.o -v
> Reading specs from /home/mykland/llvm-gcc/obj/gcc/specs
> Target: i686-pc-linux-gnu
> Configured with: ../llvm-gcc4-1.8-source/configure
> --prefix=/home/mykland/llvm-gcc/obj/../install/
> --enable-llvm=/home/mykland/llvm --enable-languages=c,c++
> --disable-threads
> Thread model: single
> gcc version 4.0.1 LLVM (Apple Computer, Inc. build 5400)
>  /home/mykland/llvm-gcc/obj/gcc/cc1 -quiet -v -I. -I.
> -I../../llvm-gcc4-1.8-source/gcc -I../../llvm-gcc4-1.8-source/gcc/.
> -I../../llvm-gcc4-1.8-source/gcc/../include
> -I../../llvm-gcc4-1.8-source/gcc/../libcpp/include
> -I/home/mykland/llvm/include -I/home/mykland/llvm/include
> -iprefix /home/mykland/llvm-gcc/obj/gcc/../lib/gcc/i686-pc-linux-gnu/4.0.1/ -isystem /home/mykland/llvm-gcc/obj/gcc/include -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -DL_muldi3 -DHIDE_EXPORTS -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/include -isystem /home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/sys-include -isystem ./include ../../llvm-gcc4-1.8-source/gcc/libgcc2.c -quiet -dumpbase libgcc2.c -mtune=pentiumpro -auxbase-strip libgcc/./_muldi3.o -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -fPIC -fvisibility=hidden -o /tmp/ccsulgFx.s
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/include"
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/../install//i686-pc-linux-gnu/sys-include"
> ignoring nonexistent directory "./include"
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/gcc/../lib/gcc/i686-pc-linux-gnu/4.0.1/include"
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/gcc/../lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../i686-pc-linux-gnu/include"
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/../install//include"
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/../install//lib/gcc/i686-pc-linux-gnu/4.0.1/include"
> ignoring nonexistent directory
> "/home/mykland/llvm-gcc/obj/../install//lib/gcc/i686-pc-linux-gnu/4.0.1/../../../../i686-pc-linux-gnu/include"
> ignoring duplicate directory "."
> ignoring duplicate directory "../../llvm-gcc4-1.8-source/gcc/."
> ignoring duplicate directory "/home/mykland/llvm/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  .
>  ../../llvm-gcc4-1.8-source/gcc
>  ../../llvm-gcc4-1.8-source/gcc/../include
>  ../../llvm-gcc4-1.8-source/gcc/../libcpp/include
>  /home/mykland/llvm/include
>  /home/mykland/llvm-gcc/obj/gcc/include
>  /usr/local/include
>  /usr/include
> End of search list.
> GNU C version 4.0.1 LLVM (Apple Computer, Inc. build 5400)
> (i686-pc-linux-gnu)
>         compiled by GNU C version 4.1.0 (SUSE Linux).
> GGC heuristics: --param ggc-min-expand=99 --param
> ggc-min-heapsize=129349
> Compiler executable checksum: b890601e6422e9101b52d960e6263283
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:35:23: error: auto-host.h: No
> such file or directory
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:40:21: error: tconfig.h: No
> such file or directory
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:43:16: error: tm.h: No such
> file or directory
> In file included from ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:64:
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.h:214:3: error: #error "expand
> the table"../../llvm-gcc4-1.8-source/gcc/libgcc2.c: In function
> ‘__mulhi3’:
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:535: error: ‘BITS_PER_UNIT’
> undeclared (first use in this function)
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:535: error: (Each undeclared
> identifier is reported only once
> ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:535: error: for each function
> it appears in.)
> 
> What now?
> 
> Regards,
> 
> -- Robert.
> > 2. Run that command manually with the -v option to print out the
> > commands it is running
> > 3. Debug gcc/cc1 and run it with the arguments shown in step 2
> > 4. Get a stack trace with "where"
> > 
> > Reid.
> > 
> > On Sun, 2006-11-05 at 20:15 -0800, Robert Mykland wrote:
> >   
> > > I was having video problems, so upgraded my Linux box from SUSE 9.3, 
> > > where LLVM frontend 4 source built fine, to SUSE 10.1, where I got the 
> > > error message:
> > > 
> > > ../../llvm-gcc4-1.8-source/gcc/libgcc2.c:541: internal compiler error: 
> > > Segmentation fault
> > > Please submit a full bug report,
> > > with preprocessed source if appropriate.
> > > See <URL:http://llvm.org/bugs> for instructions.
> > > 
> > > This version of SUSE uses version 4.1.0 of the gcc compiler.
> > > 
> > > What now?
> > > 
> > > -- Robert.
> > > 
> > > _______________________________________________
> > > LLVM Developers mailing list
> > > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> > >     
> > 
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> > 
> > 
> >   
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list