Re: [Libvir] The fist problem to compile libvirt in a Debian etch.

Hello list, I changed the libvirt version and now I'm a one step forward ;-) So, I installed these debian packages and I runned the commands above: ------ # apt-get install gcc make g++ autogen gettext autoconf automake libncurses5-dev libxml2 libxml2-dev libreadline5-dev # cd /usr/src # wget http://libvirt.org/sources/libvirt-0.2.2.tar.gz # tar -xzvf libvirt-0.2.2.tar.gz && cd libvirt-0.2.2 # ./configure -with-libxml=/usr # make In this step the make command retur a error: [...] gcc -g -O2 -o .libs/virsh virsh-virsh.o virsh-console.o ./.libs/libvirt.so -L/usr/lib /usr/lib/libxml2.so -lcurses -lreadline -Wl,--rpath -Wl,/usr/local/lib virsh-virsh.o: In function `cmdVcpuinfo': /usr/src/libvirt-0.2.2/src/virsh.c:1230: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1294: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1294: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdDominfo': /usr/src/libvirt-0.2.2/src/virsh.c:1153: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1211: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1211: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdNetworkUuid': /usr/src/libvirt-0.2.2/src/virsh.c:2227: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:2244: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:2244: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdNetworkDefine': /usr/src/libvirt-0.2.2/src/virsh.c:1854: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1890: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1890: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdNetworkCreate': /usr/src/libvirt-0.2.2/src/virsh.c:1798: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1834: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1834: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdDomuuid': /usr/src/libvirt-0.2.2/src/virsh.c:1712: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1728: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1728: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdNodeinfo': /usr/src/libvirt-0.2.2/src/virsh.c:1542: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1562: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1562: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdDefine': /usr/src/libvirt-0.2.2/src/virsh.c:733: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:769: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:769: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdCreate': /usr/src/libvirt-0.2.2/src/virsh.c:678: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:714: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:714: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `vshCmddefHelp': /usr/src/libvirt-0.2.2/src/virsh.c:2563: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:2609: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:2609: undefined reference to `__stack_chk_fail' virsh-virsh.o: In function `cmdVcpupin': /usr/src/libvirt-0.2.2/src/virsh.c:1315: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1384: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/virsh.c:1384: undefined reference to `__stack_chk_fail' virsh-console.o: In function `vshRunConsole': /usr/src/libvirt-0.2.2/src/console.c:45: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/console.c:179: undefined reference to `__stack_chk_guard' /usr/src/libvirt-0.2.2/src/console.c:179: undefined reference to `__stack_chk_fail' ./.libs/libvirt.so: undefined reference to `__stack_chk_fail_local' collect2: ld returned 1 exit status make[2]: ** [virsh] Erro 1 make[2]: Saindo do diretório `/usr/src/libvirt-0.2.2/src' make[1]: ** [all-recursive] Erro 1 make[1]: Saindo do diretório `/usr/src/libvirt-0.2.2' make: ** [all] Erro 2 # ------------------------- I don't know why this error. Ideas? regards, Marco Sinhoreli

Marco Sinhoreli wrote:
In this step the make command retur a error: [...] gcc -g -O2 -o .libs/virsh virsh-virsh.o virsh-console.o ./.libs/libvirt.so -L/usr/lib /usr/lib/libxml2.so -lcurses -lreadline -Wl,--rpath -Wl,/usr/local/lib virsh-virsh.o: In function `cmdVcpuinfo': /usr/src/libvirt-0.2.2/src/virsh.c:1230: undefined reference to `__stack_chk_guard'
This looks like it has something to do with the gcc built-in stack protector. Possibly Debian doesn't have this in their gcc; I'm not sure. You can try to work around it by passing CFLAGS="-fno-stack-protector" to ./configure, which makes it less secure, but might get it to compile for you. Better would be to find out if Debian has the stack protector, and how to enable it properly. Chris Lalancette

Hello Chris, Thanks! With this option in CFLAGS this problem is solve. Firstly, sorry for extensives posts. But I beleave that it will help others people about these problems. So, the world isn't made only by flowers ;-), I have other problem in compilation described below: # make [...] then mv -f ".deps/xencapstest.Tpo" ".deps/xencapstest.Po"; else rm -f ".deps/xencapstest.Tpo"; exit 1; fi /bin/sh ../libtool --tag=CC --mode=link gcc -fno-stack-protector -o xencapstest xencapstest.o testutils.o -L/usr/lib -lxml2 ../src/.libs/libvirt_la-conf.o ../src/.libs/libvirt_la-hash.o../src/.libs/libvirt_la- libvirt.o ../src/.libs/libvirt_la-proxy_internal.o ../src/.libs/libvirt_la-qemu_internal.o ../src/.libs/libvirt_la-sexpr.o../src/.libs/libvirt_la- test.o ../src/.libs/libvirt_la-virterror.o../src/.libs/libvirt_la-xend_internal.o ../src/.libs/libvirt_la-xen_internal.o ../src/.libs/libvirt_la-xen_unified.o ../src/.libs/libvirt_la-xm_internal.o ../src/.libs/libvirt_la-xml.o../src/.libs/libvirt_la-xs_internal.o gcc -fno-stack-protector -o xencapstest xencapstest.o testutils.o../src/.libs/libvirt_la- conf.o ../src/.libs/libvirt_la-hash.o ../src/.libs/libvirt_la-libvirt.o../src/.libs/libvirt_la-proxy_internal.o ../src/.libs/libvirt_la-qemu_internal.o ../src/.libs/libvirt_la-sexpr.o../src/.libs/libvirt_la- test.o ../src/.libs/libvirt_la-virterror.o../src/.libs/libvirt_la-xend_internal.o ../src/.libs/libvirt_la-xen_internal.o ../src/.libs/libvirt_la-xen_unified.o ../src/.libs/libvirt_la-xm_internal.o ../src/.libs/libvirt_la-xml.o../src/.libs/libvirt_la-xs_internal.o -L/usr/lib /usr/lib/libxml2.so xencapstest.o: In function `testCompareFiles': xencapstest.c:(.text+0xb4): undefined reference to `xenHypervisorMakeCapabilitiesXML' collect2: ld returned 1 exit status make[3]: ** [xencapstest] Erro 1 make[3]: Saindo do diretório `/usr/src/libvirt-0.2.2/tests' make[2]: ** [all-recursive] Erro 1 make[2]: Saindo do diretório `/usr/src/libvirt-0.2.2/tests' make[1]: ** [all-recursive] Erro 1 make[1]: Saindo do diretório `/usr/src/libvirt-0.2.2' make: ** [all] Erro 2 Again, thanks to all for help. regards On 5/4/07, Chris Lalancette <clalance@redhat.com> wrote:
Marco Sinhoreli wrote:
In this step the make command retur a error: [...] gcc -g -O2 -o .libs/virsh virsh-virsh.o virsh-console.o ./.libs/libvirt.so -L/usr/lib /usr/lib/libxml2.so -lcurses -lreadline -Wl,--rpath -Wl,/usr/local/lib virsh-virsh.o: In function `cmdVcpuinfo': /usr/src/libvirt-0.2.2/src/virsh.c:1230: undefined reference to `__stack_chk_guard'
This looks like it has something to do with the gcc built-in stack protector. Possibly Debian doesn't have this in their gcc; I'm not sure. You can try to work around it by passing CFLAGS="-fno-stack-protector" to ./configure, which makes it less secure, but might get it to compile for you. Better would be to find out if Debian has the stack protector, and how to enable it properly.
Chris Lalancette
participants (2)
-
Chris Lalancette
-
Marco Sinhoreli