* [Qemu-devel] [PATCH] Set SO_REUSEADDR at the right time
@ 2006-03-04 2:18 Nickolai Zeldovich
2006-03-04 10:39 ` [Qemu-devel] PPC linking error Fausto Saporito
0 siblings, 1 reply; 3+ messages in thread
From: Nickolai Zeldovich @ 2006-03-04 2:18 UTC (permalink / raw)
To: qemu-devel; +Cc: nickolai
I sent this a while back, but I just ran into this problem on a second
machine myself, so following John Hogerhuis's advice, I'm resubmitting
this patch with a [PATCH] prefix in the subject line..
-- kolya
---------- Forwarded message ----------
Date: Mon, 16 Jan 2006 16:03:32 -0800 (PST)
From: Nickolai Zeldovich <nickolai@cs.stanford.edu>
To: qemu-devel@nongnu.org
Cc: nickolai@cs.stanford.edu
Subject: Set SO_REUSEADDR at the right time
It looks like qemu (at least version 0.7.2, which is what I'm running
here) doesn't set SO_REUSEADDR before calling bind(), which makes that
fairly useless. This obvious patch moves up setting SO_REUSEADDR to the
right place, just before bind().
Apologies if this is already fixed in 0.8.0.
-- kolya
--- slirp/socket.c.orig 2006-01-16 15:54:40.993024000 -0800
+++ slirp/socket.c 2006-01-16 15:55:06.049849000 -0800
@@ -573,6 +573,7 @@
addr.sin_port = port;
if (((s = socket(AF_INET,SOCK_STREAM,0)) < 0) ||
+ (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) ||
(bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) ||
(listen(s,1) < 0)) {
int tmperrno = errno; /* Don't clobber the real reason we failed */
@@ -587,7 +588,6 @@
#endif
return NULL;
}
- setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));
setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int));
getsockname(s,(struct sockaddr *)&addr,&addrlen);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] PPC linking error
2006-03-04 2:18 [Qemu-devel] [PATCH] Set SO_REUSEADDR at the right time Nickolai Zeldovich
@ 2006-03-04 10:39 ` Fausto Saporito
2006-03-05 10:53 ` Mulyadi Santosa
0 siblings, 1 reply; 3+ messages in thread
From: Fausto Saporito @ 2006-03-04 10:39 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]
Hello all,
I have this problem during linking qemu under Ubuntu 5.10 (linux-ppc).
The system is up to date, and I'm using the gcc-3.4 as you can see.
gcc-3.4 -g -Wl,-T,/home/fausap/qemu/ppc.ld -o qemu-i386 elfload.o main.o
syscall.o mmap.o signal.o path.o osdep.o thunk.o vm86.o libqemu.a
gdbstub.o -lm
/usr/bin/ld: qemu-i386: Not enough room for program headers (allocated
8, need 9)
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [qemu-i386] Error 1
make[1]: Leaving directory `/home/fausap/qemu/i386-user'
make: *** [all] Error 1
The problem is in ppd.ld with SIZEOF_HEADERS variable. I fixed it
copying the standard linker script elfppc32.x from /usr/lib/ldscripts in
the qemu directory renaming it as ppc.ld
Now the link is ok.
After, I have a problem with an ASM instruction:
make[1]: Entering directory `/home/fausap/qemu/arm-user'
gcc-3.4 -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I.
-I/home/fausap/qemu/target-arm -I/home/fausap/qemu
-I/home/fausap/qemu/linux-user -I/home/fausap/qemu/linux-user/arm
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/home/fausap/qemu/fpu -I/home/fausap/qemu/slirp -c -o
elfload.o /home/fausap/qemu/linux-user/elfload.c
/home/fausap/qemu/linux-user/elfload.c: In function `load_elf_binary':
/home/fausap/qemu/cpu-all.h:253: error: inconsistent operand constraints
in an `asm'
/home/fausap/qemu/cpu-all.h:253: error: inconsistent operand constraints
in an `asm'
make[1]: *** [elfload.o] Error 1
Now, finding in other sources the occurence of stwbrx asm operand, I saw
there's no need of "=m" operand in the __asm__ call.
Also, in the qemu code, the function is declared return void in the
cpu-all.h file.
So i changed the line in :
__asm__ __volatile__ ("stwbrx %0,0,%1" : : "r" (v), "r" (ptr));
The same I did for the 16bit version:
__asm__ __volatile__ ("sthbrx %0,0,%1" : : "r" (v), "r" (ptr));
and all has gone fine.
Then there's a missing include in exec.h in target-mips directory,
otherwise there's no way to recognize int32_t type.
In file included from /home/fausap/qemu/target-mips/op_helper.c:21:
/home/fausap/qemu/target-mips/exec.h:15: error: parse error before
"host_int_t"
I added in target-mips/exec.h the line:
#include <stdint.h>
After that I had no further errors... all went fine :-)
thanks in advance,
Fausto
[-- Attachment #2: Type: text/html, Size: 2922 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] PPC linking error
2006-03-04 10:39 ` [Qemu-devel] PPC linking error Fausto Saporito
@ 2006-03-05 10:53 ` Mulyadi Santosa
0 siblings, 0 replies; 3+ messages in thread
From: Mulyadi Santosa @ 2006-03-05 10:53 UTC (permalink / raw)
To: qemu-devel, Fausto Saporito
Hi Fausto
> I have this problem during linking qemu under Ubuntu 5.10
> (linux-ppc). The system is up to date, and I'm using the gcc-3.4 as
> you can see.
Personally, I suggest to put your hint on the Qemu forum
(qemu.dad-answers.com). That way, it will be archieved and people will
easily search it and possibly give comments about it :)
Just my 2 cents ...
regards
Mulyadi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-05 5:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-04 2:18 [Qemu-devel] [PATCH] Set SO_REUSEADDR at the right time Nickolai Zeldovich
2006-03-04 10:39 ` [Qemu-devel] PPC linking error Fausto Saporito
2006-03-05 10:53 ` Mulyadi Santosa
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).