qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cai Qiang" <caiqiang@ustc.edu>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] problem when building arm host
Date: Thu, 3 Jul 2008 14:02:39 +0800	[thread overview]
Message-ID: <00ec01c8dcd2$675621c0$8057a8c0@cf5b832aa5fa480> (raw)
In-Reply-To: 00d501c8dcbf$dbdf7c20$8057a8c0@cf5b832aa5fa480

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!
> 
> 
> 
> 
>

      reply	other threads:[~2008-07-03  6:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00ec01c8dcd2$675621c0$8057a8c0@cf5b832aa5fa480' \
    --to=caiqiang@ustc.edu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).