qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] problem when building arm host


From: Cai Qiang
Subject: [Qemu-devel] problem when building arm host
Date: Thu, 3 Jul 2008 11:49:55 +0800

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!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]