qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Use Clang to compile Qemu?
@ 2011-12-23 12:00 陳韋任
  2011-12-23 13:07 ` David Turner
  0 siblings, 1 reply; 3+ messages in thread
From: 陳韋任 @ 2011-12-23 12:00 UTC (permalink / raw)
  To: qemu-devel

Hi all,

  I am trying to build QEMU by using clang, but get error message below.

---
In file included from /z/tmp/chenwj/qemu-1.0/user-exec.c:21:
/z/tmp/chenwj/qemu-1.0/dyngen-exec.h:64:20: error: global register variables are not supported
register CPUState *env asm(AREG0);
                   ^
1 warning and 1 error generated.
---

  Any idea on how to work around this? Thanks! :)

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

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

* Re: [Qemu-devel] Use Clang to compile Qemu?
  2011-12-23 12:00 [Qemu-devel] Use Clang to compile Qemu? 陳韋任
@ 2011-12-23 13:07 ` David Turner
  2011-12-24  1:48   ` 陳韋任
  0 siblings, 1 reply; 3+ messages in thread
From: David Turner @ 2011-12-23 13:07 UTC (permalink / raw)
  To: 陳韋任; +Cc: qemu-devel

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

Some parts of QEMU (the JIT) require the use of a global register variable
to point to the "env" CPU state variable.

This feature is not supported by Clang (which is not very surprising given
that it uses LLVM as its backend, and LLVM explicitely doesn't support this)

Until the JIT is modified to not require this anymore, it is very unlikely
that Clang will be able to build QEMU.

There were previous discussions about such a change on this mailing list,
but I believe nobody started working on that change because many feared it
was a lot of work that would have a negative impact on performance (though
I think it was all conjecture, i.e. no one really tried it and got any real
data).

Please correct me if I'm wrong.

On Fri, Dec 23, 2011 at 1:00 PM, 陳韋任 <chenwj@iis.sinica.edu.tw> wrote:

> Hi all,
>
>  I am trying to build QEMU by using clang, but get error message below.
>
> ---
> In file included from /z/tmp/chenwj/qemu-1.0/user-exec.c:21:
> /z/tmp/chenwj/qemu-1.0/dyngen-exec.h:64:20: error: global register
> variables are not supported
> register CPUState *env asm(AREG0);
>                   ^
> 1 warning and 1 error generated.
> ---
>
>  Any idea on how to work around this? Thanks! :)
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> Homepage: http://people.cs.nctu.edu.tw/~chenwj
>
>

[-- Attachment #2: Type: text/html, Size: 2031 bytes --]

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

* Re: [Qemu-devel] Use Clang to compile Qemu?
  2011-12-23 13:07 ` David Turner
@ 2011-12-24  1:48   ` 陳韋任
  0 siblings, 0 replies; 3+ messages in thread
From: 陳韋任 @ 2011-12-24  1:48 UTC (permalink / raw)
  To: qemu-devel

On Fri, Dec 23, 2011 at 02:07:53PM +0100, David Turner wrote:
> Some parts of QEMU (the JIT) require the use of a global register variable
> to point to the "env" CPU state variable.
> 
> This feature is not supported by Clang (which is not very surprising given
> that it uses LLVM as its backend, and LLVM explicitely doesn't support this)
> 
> Until the JIT is modified to not require this anymore, it is very unlikely
> that Clang will be able to build QEMU.
> 
> There were previous discussions about such a change on this mailing list,
> but I believe nobody started working on that change because many feared it
> was a lot of work that would have a negative impact on performance (though
> I think it was all conjecture, i.e. no one really tried it and got any real
> data).

  You're right. Here is the discussion,
  http://lists.gnu.org/archive/html/qemu-devel/2011-05/msg01116.html

  Since TCI (Tiny Code Interpreter) doesn't need AREG0, I configure QEMU to use
TCI and try it out. Here's my flow.

---
# apply patches under /usr/ports/emulators/qemu-devel/files/ first
$ ../configure --prefix=$INSTALL --target-list=i386-bsd-user \
  --enable-tcg-interpreter \
  --cc=clang
$ gmake install
---

  So far so good (perhaps freebsd guys should upstream those patches?). But I am
stuck at the error below,

---
$ qemu-i386 -bsd freebsd hello
Unable to load interpreter
---

  Any thoughts? Thanks! :)

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

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

end of thread, other threads:[~2011-12-24  1:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 12:00 [Qemu-devel] Use Clang to compile Qemu? 陳韋任
2011-12-23 13:07 ` David Turner
2011-12-24  1:48   ` 陳韋任

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).