qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Configuring qemu on Solaris
@ 2008-01-08  0:40 Andreas Färber
  2008-01-08  7:01 ` Ben Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2008-01-08  0:40 UTC (permalink / raw)
  To: qemu-devel

Hi,

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.

Andreas

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

* Re: [Qemu-devel] Configuring qemu on Solaris
  2008-01-08  0:40 Andreas Färber
@ 2008-01-08  7:01 ` Ben Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Taylor @ 2008-01-08  7:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber


---- "Andreas Färber" <andreas.faerber@web.de> wrote: 
> Hi,
> 
> 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.

Early in Solaris 10 (perhaps pre-FCS, I don't recall it's been so long),
/usr/sfw/bin/gcc on Solaris would not properly compile QEMU.

The problem either was silently fixed (though I doubt that since I can't
find any reference to a fix), or something in the QEMU source that
was causing the error stopped causing the error.

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

I'd be ok with that.   I'll submit another patch with an updated 
README for Solaris, since there are multiple issues around
the gcc's available for Solaris (sfw, blastwave, sunfreeware)

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

Let's take out the exit.  I would prefer to make Solaris depend on
/usr/sfw/bin/gcc since blastwave can only compile 32-bit (and
not 64-bit because that wasn't enabled), and sunfreeware can't
even compile it (I think it's configured to use Solaris as, and not
gas).

Ben
> 
> Andreas
> 
> 

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

* Re: [Qemu-devel] Configuring qemu on Solaris
@ 2008-01-08 10:39 Juergen Keil
  2008-01-08 21:59 ` Andreas Färber
  2008-01-09  2:50 ` Ben Taylor
  0 siblings, 2 replies; 5+ messages in thread
From: Juergen Keil @ 2008-01-08 10:39 UTC (permalink / raw)
  To: qemu-devel


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.

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

* Re: [Qemu-devel] Configuring qemu on Solaris
  2008-01-08 10:39 [Qemu-devel] Configuring qemu on Solaris Juergen Keil
@ 2008-01-08 21:59 ` Andreas Färber
  2008-01-09  2:50 ` Ben Taylor
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2008-01-08 21:59 UTC (permalink / raw)
  To: qemu-devel


Am 08.01.2008 um 11:39 schrieb Juergen Keil:

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

Solaris 10 8/07 has exactly that gcc --version string and exhibits the  
behavior described above, so it does seem there is no patch to apply.  
Thanks for providing these detailed steps.

Unfortunately QEMU unconditionally attempts to compile with -m64 on  
amd64, and the alternative CSW and SFW GCC versions didn't allow that  
last time I checked.

The behavior I'm seeing is that sparc-softmmu boots Linux fine until  
just before the login prompt and then hangs there, i386-softmmu  
doesn't even get to the BIOS (no crashes).

Andreas

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

* Re: [Qemu-devel] Configuring qemu on Solaris
  2008-01-08 10:39 [Qemu-devel] Configuring qemu on Solaris Juergen Keil
  2008-01-08 21:59 ` Andreas Färber
@ 2008-01-09  2:50 ` Ben Taylor
  1 sibling, 0 replies; 5+ messages in thread
From: Ben Taylor @ 2008-01-09  2:50 UTC (permalink / raw)
  To: Juergen Keil, qemu-devel


---- Juergen Keil <jk@tools.de> wrote: 
> 
> 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.

I'll  look at writing the code to handle this.  I will need someone to
test for me since I'm on S10U4 and Solaris Express B80...

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

end of thread, other threads:[~2008-01-09  2:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-08 10:39 [Qemu-devel] Configuring qemu on Solaris Juergen Keil
2008-01-08 21:59 ` 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

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