qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Gentoo & qemu & non-static build
@ 2004-04-04 20:11 rutger
  2004-04-04 20:27 ` Jim C. Brown
  0 siblings, 1 reply; 7+ messages in thread
From: rutger @ 2004-04-04 20:11 UTC (permalink / raw)
  To: qemu-devel

Hi,

I cannot get qemu to build on Gentoo ~x86. Is has to do with the known
problem that alsa-lib is not build staticly, and therefore libsdl.a
cannot be linked to, and therefore qemu cannot be build staticly also.

Output in that case:

...
gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a  -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil
/usr/lib/libSDL.a(SDL_x11gl.o)(.text+0x90a): In function `X11_GL_LoadLibrary':
: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lasound
collect2: ld returned 1 exit status
make[1]: *** [qemu-fast] Error 1
make[1]: Leaving directory `/home/rutger/download/qemu-0.5.3/i386'


The problem on the qemu side is that I cannot get qemu to build
non-staticly. I tried './configure --no-static', which gives 'static
build no' (but then again, that's no different from when I remove the
--no-static), but the build command still fails. It ends different
however, with:

...
gcc -Wall -O2 -g -fomit-frame-pointer  -g -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386.ld i386 ../dyngen.c   -o ../dyngen
gcc: i386: No such file or directory
make: *** [../dyngen] Error 1
make: Leaving directory `/home/rutger/download/qemu-0.5.3/i386'


Anyone any idea on how to build qemu dynamically?

Regards,
Rutger.

-- 
Rutger Nijlunsing ---------------------------- rutger ed tux tmfweb nl
never attribute to a conspiracy which can be explained by incompetence
----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Gentoo & qemu & non-static build
  2004-04-04 20:11 [Qemu-devel] Gentoo & qemu & non-static build rutger
@ 2004-04-04 20:27 ` Jim C. Brown
  2004-04-05 18:19   ` Carlos Valiente
  2004-04-06 20:23   ` [Qemu-devel] Gentoo & qemu & non-static build rutger
  0 siblings, 2 replies; 7+ messages in thread
From: Jim C. Brown @ 2004-04-04 20:27 UTC (permalink / raw)
  To: qemu-devel, qemu-devel

On Sun, Apr 04, 2004 at 10:11:19PM +0200, rutger@mail.com wrote:
> Hi,
> 
> I cannot get qemu to build on Gentoo ~x86. Is has to do with the known
> problem that alsa-lib is not build staticly, and therefore libsdl.a
> cannot be linked to, and therefore qemu cannot be build staticly also.
> 
> Output in that case:
> 
> ...
> gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a  -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil

Try using this command instead:

gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a -shared -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil

It worked for me.

> /usr/lib/libSDL.a(SDL_x11gl.o)(.text+0x90a): In function `X11_GL_LoadLibrary':
> : warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lasound
> collect2: ld returned 1 exit status
> make[1]: *** [qemu-fast] Error 1
> make[1]: Leaving directory `/home/rutger/download/qemu-0.5.3/i386'
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Gentoo & qemu & non-static build
  2004-04-04 20:27 ` Jim C. Brown
@ 2004-04-05 18:19   ` Carlos Valiente
  2004-04-07 18:04     ` [Qemu-devel] SIGSEGV on start of qemu-fast under gentoo Grzegorz Kulewski
  2004-04-06 20:23   ` [Qemu-devel] Gentoo & qemu & non-static build rutger
  1 sibling, 1 reply; 7+ messages in thread
From: Carlos Valiente @ 2004-04-05 18:19 UTC (permalink / raw)
  To: qemu-devel

On Sun, 2004-04-04 at 21:27, Jim C. Brown wrote:
> On Sun, Apr 04, 2004 at 10:11:19PM +0200, rutger@mail.com wrote:
> > Hi,
> > 
> > I cannot get qemu to build on Gentoo ~x86. Is has to do with the known
> > problem that alsa-lib is not build staticly, and therefore libsdl.a
> > cannot be linked to, and therefore qemu cannot be build staticly also.
> > 
> > Output in that case:
> > 
> > ...
> > gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a  -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil
> 
> Try using this command instead:
> 
> gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a -shared -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil
> 
> [..]

Doing a "gcc -shared [..]" ans then the rest as per the original gcc
invocation worked for me, as well

Carlos

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Gentoo & qemu & non-static build
  2004-04-04 20:27 ` Jim C. Brown
  2004-04-05 18:19   ` Carlos Valiente
@ 2004-04-06 20:23   ` rutger
  2004-04-15 19:21     ` [Qemu-devel] [PATCH] /dev/tun support (was: Re: Gentoo & qemu & non-static build) Gabriel Ebner
  1 sibling, 1 reply; 7+ messages in thread
From: rutger @ 2004-04-06 20:23 UTC (permalink / raw)
  To: Jim C. Brown; +Cc: qemu-devel

On Sun, Apr 04, 2004 at 04:27:05PM -0400, Jim C. Brown wrote:
> On Sun, Apr 04, 2004 at 10:11:19PM +0200, rutger@mail.com wrote:
> > Hi,
> > 
> > I cannot get qemu to build on Gentoo ~x86. Is has to do with the known
> > problem that alsa-lib is not build staticly, and therefore libsdl.a
> > cannot be linked to, and therefore qemu cannot be build staticly also.
> > 
> > Output in that case:
> > 
> > ...
> > gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a  -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil
> 
> Try using this command instead:
> 
> gcc  -static -Wl,-T,/home/rutger/download/qemu-0.5.3/i386-vl.ld  -o qemu-fast vl.o osdep.o block.o monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a -shared -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil
> 
> It worked for me.

Works for me too, thanks!

Now trying to let qemu use /dev/tun (default of udev) instead of
/dev/net/tun ...

-- 
Rutger Nijlunsing ---------------------------- rutger ed tux tmfweb nl
never attribute to a conspiracy which can be explained by incompetence
----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] SIGSEGV on start of qemu-fast under gentoo
  2004-04-05 18:19   ` Carlos Valiente
@ 2004-04-07 18:04     ` Grzegorz Kulewski
  2004-04-07 20:13       ` Fabrice Bellard
  0 siblings, 1 reply; 7+ messages in thread
From: Grzegorz Kulewski @ 2004-04-07 18:04 UTC (permalink / raw)
  To: qemu-devel

Hi,

I managed to compile QEMU under gentoo using qemu-cvs-1.3.ebuild with this 
command at the end:

gcc  -static -Wl,-T,../i386-vl.ld  -o qemu-fast vl.o osdep.o block.o 
monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o 
mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a 
-shared -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl 
-lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib 
-laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil

And I get immendiate SIGSEGV when trying to launch such created qemu-fast.

What I am doing wrong???


thanks in advance

Grzegorz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] SIGSEGV on start of qemu-fast under gentoo
  2004-04-07 18:04     ` [Qemu-devel] SIGSEGV on start of qemu-fast under gentoo Grzegorz Kulewski
@ 2004-04-07 20:13       ` Fabrice Bellard
  0 siblings, 0 replies; 7+ messages in thread
From: Fabrice Bellard @ 2004-04-07 20:13 UTC (permalink / raw)
  To: qemu-devel

Hi,

It is totally _wrong_ to compile qemu-fast with a -shared option. If I 
used a static build there was certainly a reason :-) So you should 
better not compile qemu-fast if your distribution has not the right 
packages, as it it said in the (new) QEMU FAQ...

Fabrice.

Grzegorz Kulewski wrote:
> Hi,
> 
> I managed to compile QEMU under gentoo using qemu-cvs-1.3.ebuild with this 
> command at the end:
> 
> gcc  -static -Wl,-T,../i386-vl.ld  -o qemu-fast vl.o osdep.o block.o 
> monitor.o ide.o ne2000.o pckbd.o vga.o sb16.o dma.o oss.o fdc.o 
> mc146818rtc.o serial.o i8259.o i8254.o pc.o gdbstub.o sdl.o libqemu.a 
> -shared -lm -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -ldl 
> -lasound -L/usr/X11R6/lib -lX11 -lXext -laa -L/usr/lib -Wl,-rpath,/usr/lib 
> -laa -lm -L/usr/X11R6/lib -lX11 -lncurses -lutil
> 
> And I get immendiate SIGSEGV when trying to launch such created qemu-fast.
> 
> What I am doing wrong???
> 
> 
> thanks in advance
> 
> Grzegorz
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://mail.nongnu.org/mailman/listinfo/qemu-devel
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH] /dev/tun support (was: Re: Gentoo & qemu & non-static build)
  2004-04-06 20:23   ` [Qemu-devel] Gentoo & qemu & non-static build rutger
@ 2004-04-15 19:21     ` Gabriel Ebner
  0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Ebner @ 2004-04-15 19:21 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

Hello

rutger@mail.com wrote:
> Now trying to let qemu use /dev/tun (default of udev) instead of
> /dev/net/tun ...

With this patch against current CVS if qemu can't open /dev/net/tun, it will
try /dev/tun.  Documentation and error strings adjusted.

        Gabriel. 

-- 
Gabriel Ebner - reverse "ta.renbeleirbag@eg"

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: qemu-udev-tun-r2.patch --]
[-- Type: text/x-diff; name="qemu-udev-tun-r2.patch", Size: 2164 bytes --]

Index: vl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.c,v
retrieving revision 1.59
diff -u -r1.59 vl.c
--- vl.c	12 Apr 2004 20:39:28 -0000	1.59
+++ vl.c	15 Apr 2004 19:10:13 -0000
@@ -765,22 +765,29 @@
 
 #else
 
+#define MAX_TUNDEV_LEN 13
+
 static int tun_open(char *ifname, int ifname_size)
 {
     struct ifreq ifr;
     int fd, ret;
+    char tundev[MAX_TUNDEV_LEN];
     
-    fd = open("/dev/net/tun", O_RDWR);
-    if (fd < 0) {
-        fprintf(stderr, "warning: could not open /dev/net/tun: no virtual network emulation\n");
+    if ((fd = open("/dev/net/tun", O_RDWR)) >= 0) {
+        strncpy(tundev, "/dev/net/tun", MAX_TUNDEV_LEN);
+    } else if ((fd = open("/dev/tun", O_RDWR)) >= 0) {
+        strncpy(tundev, "/dev/tun", MAX_TUNDEV_LEN);
+    } else {
+        fprintf(stderr, "warning: could not open either /dev/net/tun or /dev/tun: no virtual network emulation\n");
         return -1;
     }
+
     memset(&ifr, 0, sizeof(ifr));
     ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
     pstrcpy(ifr.ifr_name, IFNAMSIZ, "tun%d");
     ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
     if (ret != 0) {
-        fprintf(stderr, "warning: could not configure /dev/net/tun: no virtual network emulation\n");
+        fprintf(stderr, "warning: could not configure %s: no virtual network emulation\n", tundev);
         close(fd);
         return -1;
     }
Index: qemu-doc.texi
===================================================================
RCS file: /cvsroot/qemu/qemu/qemu-doc.texi,v
retrieving revision 1.25
diff -u -r1.25 qemu-doc.texi
--- qemu-doc.texi	4 Apr 2004 15:21:17 -0000	1.25
+++ qemu-doc.texi	15 Apr 2004 19:10:13 -0000
@@ -552,7 +552,7 @@
 properly @code{sudo} so that the command @code{ifconfig} contained in
 @file{qemu-ifup} can be executed as root. You must verify that your host
 kernel supports the TUN/TAP network interfaces: the device
-@file{/dev/net/tun} must be present.
+@file{/dev/net/tun} or @file{/dev/tun} must be present.
 
 When network is enabled, there is a virtual network connection between
 the host kernel and the emulated kernel. The emulated kernel is seen

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-04-15 19:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-04 20:11 [Qemu-devel] Gentoo & qemu & non-static build rutger
2004-04-04 20:27 ` Jim C. Brown
2004-04-05 18:19   ` Carlos Valiente
2004-04-07 18:04     ` [Qemu-devel] SIGSEGV on start of qemu-fast under gentoo Grzegorz Kulewski
2004-04-07 20:13       ` Fabrice Bellard
2004-04-06 20:23   ` [Qemu-devel] Gentoo & qemu & non-static build rutger
2004-04-15 19:21     ` [Qemu-devel] [PATCH] /dev/tun support (was: Re: Gentoo & qemu & non-static build) Gabriel Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).