qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Keil <jk@tools.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Configuring qemu on Solaris
Date: Tue, 8 Jan 2008 11:39:09 +0100 (CET)	[thread overview]
Message-ID: <200801081039.m08AdAbi026333@imap.tools.intra> (raw)


Andreas Färber <andreas.faerber@web.de> wrote:

> The following part of configure is triggered on a fully-updated  
> Solaris 10 8/07 amd64:
> 
> #
> # Solaris specific configure tool chain decisions
> #
> if test "$solaris" = "yes" ; then
>    #
>    # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu  
> correctly
>    # override the check with --disable-gcc-check
>    #
>    if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
>      solgcc=`which $cc`
>      if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
>        echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu  
> correctly."
>        echo "please get gcc-3.4.3 or later, from www.blastwave.org  
> using pkg-get -i gcc3"
>        echo "or get the latest patch from SunSolve for gcc"
>        exit 1
>      fi
>    fi
> 
> Depending on the path of gcc, configure bails out. The text appears to  
> indicate that "the latest patch [...] for gcc", whichever that may be,  
> fixes some compilation issue.
> Since the script does not try to detect the presence of such a patch,  
> can we remove the exit and keep the text as a warning only?
> Or can someone comment on what the corresponding Solaris patch id or  
> gcc version is in order to make this conditional? The system gcc  
> version is 3.4.3 here and it appears to compile fine.

IIRC, problem was a code generation issue with the specific version of
gcc 3.4.3 (includes some patches from Sun; /usr/sfw/bin/gcc) that is
included with Solaris 10 x86.  qemu would compile just fine (32-bit x86
binary), but would crash at run time.


The problematic version of gcc refused to eliminate the frame pointer
for a function like this:

==============================================
#include <setjmp.h>

jmp_buf env;

void
func(void)
{
        longjmp(env, 1);
}
==============================================

% /usr/sfw/bin/gcc -O2 -fomit-frame-pointer -S xx.c
% cat xx.s
        .file   "xx.c"
        .text
        .p2align 2,,3
.globl func
        .type   func, @function
func:
        pushl   %ebp                       <<<<<<<<<<<<<<<<<<<<<<<
        movl    %esp, %ebp                 <<<<<<<<<<<<<<<<<<<<<<<
        subl    $16, %esp
        pushl   $1
        pushl   $env
        call    longjmp
        .size   func, .-func
        .comm   env,40,32
        .ident  "GCC: (GNU) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)"

==============================================


I'm not sure if there is actually a patch id that we could check for
in "showrev -p" output.


But maybe the configure script could look at "gcc --version" output;
I guess if it finds "(csl-sol210-3_4-branch+sol_rpath)", configure should
complain.  

Current opensolaris comes with "gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802)",
and this version eliminates the frame pointer in the above sample code,
and is able to compile a working qemu 32-bit x86 binary.

             reply	other threads:[~2008-01-08 10:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08 10:39 Juergen Keil [this message]
2008-01-08 21:59 ` [Qemu-devel] Configuring qemu on Solaris Andreas Färber
2008-01-09  2:50 ` Ben Taylor
  -- strict thread matches above, loose matches on Subject: below --
2008-01-08  0:40 Andreas Färber
2008-01-08  7:01 ` Ben Taylor

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=200801081039.m08AdAbi026333@imap.tools.intra \
    --to=jk@tools.de \
    --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).