* [Qemu-devel] [PATCH] fix warning in syscall.c
@ 2008-07-03 0:57 Robert Reif
2008-07-03 3:49 ` [Qemu-devel] problem when building arm host Cai Qiang
0 siblings, 1 reply; 3+ messages in thread
From: Robert Reif @ 2008-07-03 0:57 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
/home/wine/qemu/linux-user/syscall.c: In function `do_fork':
/home/wine/qemu/linux-user/syscall.c:2790: warning: implicit declaration
of function `qemu_mallocz'
/home/wine/qemu/linux-user/syscall.c:2790: warning: assignment makes
pointer from integer without a cast
[-- Attachment #2: syscall.diff.txt --]
[-- Type: text/plain, Size: 222 bytes --]
--- linux-user/syscall.c (revision 4830)
+++ linux-user/syscall.c (working copy)
@@ -72,6 +72,7 @@
#include "linux_loop.h"
#include "qemu.h"
+#include "qemu-common.h"
#if defined(USE_NPTL)
#include <linux/futex.h>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] problem when building arm host
2008-07-03 0:57 [Qemu-devel] [PATCH] fix warning in syscall.c Robert Reif
@ 2008-07-03 3:49 ` Cai Qiang
2008-07-03 6:02 ` Cai Qiang
0 siblings, 1 reply; 3+ messages in thread
From: Cai Qiang @ 2008-07-03 3:49 UTC (permalink / raw)
To: qemu-devel
Hi,
I am trying to build qemu for arm host. I got below error:
......
make -C i386-linux-user all
make[1]: Entering directory `/media/system/u/SW/src/qemu-arm-host/i386-linux-user'
arm-linux-gcc -g -Wl,-T,/u/SW/src/qemu-arm-host/arm.ld -o qemu-i386 main.o syscall.o strace.o mmap.o signal.o path.o thunk.o elfload.o linuxload.o uaccess.o vm86.o gdbstub.o libqemu.a ../libqemu_user.a -lm -lrt -lpthread
libqemu.a(cpu-exec.o): In function `cpu_x86_exec':
/u/SW/src/qemu-arm-host/cpu-exec.c:615: relocation truncated to fit: R_ARM_PC24 against symbol `code_gen_prologue' defined in COMMON section in libqemu.a(exec.o)
/media/system/u/SW/usr/local/arm/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin/../lib/gcc/arm-unknown-linux-gnu/4.0.2/../../../../arm-unknown-linux-gnu/bin/ld: warning: .preinit_array section has zero size
/media/system/u/SW/usr/local/arm/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin/../lib/gcc/arm-unknown-linux-gnu/4.0.2/../../../../arm-unknown-linux-gnu/bin/ld: warning: .init_array section has zero size
/media/system/u/SW/usr/local/arm/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin/../lib/gcc/arm-unknown-linux-gnu/4.0.2/../../../../arm-unknown-linux-gnu/bin/ld: warning: .fini_array section has zero size
collect2: ld returned 1 exit status
make[1]: *** [qemu-i386] Error 1
make[1]: Leaving directory `/media/system/u/SW/src/qemu-arm-host/i386-linux-user'
make: *** [subdir-i386-linux-user] Error 2
in old post of andrzej zaborowski, he said
"Yes, arm-linux-user fails with the same error because gcc doesn't
manage to make the call to code_gen_prologue. One solution is to wrap
the #define tcg_qemu_tb_exec in tcg/tcg.h in an #ifndef, and override
it tcg/arm/tcg-target.h with the same kind of call as was used before
introduction of prologue/epilogue which was possibly more optimal."
but I don't understand above clearly. What I did is
in tcg/tcg.h
#ifdef __powerpc__
#define tcg_qemu_tb_exec(tb_ptr) \
((long REGPARM __attribute__ ((longcall)) (*)(void *))code_gen_prologue)(tb_ptr)
#else
#ifndef tcg_qemu_tb_exec
#define tcg_qemu_tb_exec(tb_ptr) ((long REGPARM (*)(void *))code_gen_prologue)(tb_ptr)
#endif
#endif
and add
#ifndef tcg_qemu_tb_exec
#define tcg_qemu_tb_exec(tb_ptr) ((long REGPARM (*)(void *))code_gen_prologue)(tb_ptr)
#endif
in the end of tcg/arm/tcg-target.h
But seems no effect. Did I mis-understand?
In old post Paul also pointed out:
"Or tweak the linker script to place code_gen_prologue near to the code
segment."
Can anyone teach me how to do this?
Best Regards!
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Qemu-devel] problem when building arm host
2008-07-03 3:49 ` [Qemu-devel] problem when building arm host Cai Qiang
@ 2008-07-03 6:02 ` Cai Qiang
0 siblings, 0 replies; 3+ messages in thread
From: Cai Qiang @ 2008-07-03 6:02 UTC (permalink / raw)
To: qemu-devel
I got it. I added below line
code_gen_prologue = .;
after the
.text :
{
*(.text)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} =0x47ff041f
----- Original Message -----
From: "Cai Qiang" <caiqiang@ustc.edu>
To: <qemu-devel@nongnu.org>
Sent: Thursday, July 03, 2008 11:49 AM
Subject: [Qemu-devel] problem when building arm host
> Hi,
> I am trying to build qemu for arm host. I got below error:
>
> ......
> make -C i386-linux-user all
> make[1]: Entering directory `/media/system/u/SW/src/qemu-arm-host/i386-linux-user'
> arm-linux-gcc -g -Wl,-T,/u/SW/src/qemu-arm-host/arm.ld -o qemu-i386 main.o syscall.o strace.o mmap.o signal.o path.o thunk.o elfload.o linuxload.o uaccess.o vm86.o gdbstub.o libqemu.a ../libqemu_user.a -lm -lrt -lpthread
> libqemu.a(cpu-exec.o): In function `cpu_x86_exec':
> /u/SW/src/qemu-arm-host/cpu-exec.c:615: relocation truncated to fit: R_ARM_PC24 against symbol `code_gen_prologue' defined in COMMON section in libqemu.a(exec.o)
> /media/system/u/SW/usr/local/arm/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin/../lib/gcc/arm-unknown-linux-gnu/4.0.2/../../../../arm-unknown-linux-gnu/bin/ld: warning: .preinit_array section has zero size
> /media/system/u/SW/usr/local/arm/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin/../lib/gcc/arm-unknown-linux-gnu/4.0.2/../../../../arm-unknown-linux-gnu/bin/ld: warning: .init_array section has zero size
> /media/system/u/SW/usr/local/arm/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin/../lib/gcc/arm-unknown-linux-gnu/4.0.2/../../../../arm-unknown-linux-gnu/bin/ld: warning: .fini_array section has zero size
> collect2: ld returned 1 exit status
> make[1]: *** [qemu-i386] Error 1
> make[1]: Leaving directory `/media/system/u/SW/src/qemu-arm-host/i386-linux-user'
> make: *** [subdir-i386-linux-user] Error 2
>
> in old post of andrzej zaborowski, he said
>
> "Yes, arm-linux-user fails with the same error because gcc doesn't
> manage to make the call to code_gen_prologue. One solution is to wrap
> the #define tcg_qemu_tb_exec in tcg/tcg.h in an #ifndef, and override
> it tcg/arm/tcg-target.h with the same kind of call as was used before
> introduction of prologue/epilogue which was possibly more optimal."
>
> but I don't understand above clearly. What I did is
>
> in tcg/tcg.h
>
> #ifdef __powerpc__
> #define tcg_qemu_tb_exec(tb_ptr) \
> ((long REGPARM __attribute__ ((longcall)) (*)(void *))code_gen_prologue)(tb_ptr)
> #else
> #ifndef tcg_qemu_tb_exec
> #define tcg_qemu_tb_exec(tb_ptr) ((long REGPARM (*)(void *))code_gen_prologue)(tb_ptr)
> #endif
> #endif
>
> and add
> #ifndef tcg_qemu_tb_exec
> #define tcg_qemu_tb_exec(tb_ptr) ((long REGPARM (*)(void *))code_gen_prologue)(tb_ptr)
> #endif
>
> in the end of tcg/arm/tcg-target.h
>
> But seems no effect. Did I mis-understand?
>
> In old post Paul also pointed out:
>
> "Or tweak the linker script to place code_gen_prologue near to the code
> segment."
>
> Can anyone teach me how to do this?
>
> Best Regards!
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-03 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03 0:57 [Qemu-devel] [PATCH] fix warning in syscall.c Robert Reif
2008-07-03 3:49 ` [Qemu-devel] problem when building arm host Cai Qiang
2008-07-03 6:02 ` Cai Qiang
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).