public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] epilogue count exceeds number of nested prologues
@ 2002-04-08  0:17 Randolph Chung
  2002-04-08 15:52 ` David Mosberger
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Randolph Chung @ 2002-04-08  0:17 UTC (permalink / raw)
  To: linux-ia64

Hi all,

While trying to compile mozilla with libffi, the configure phase dies
with a message:

Error: Epilogue count of 4294967296 exceeds number of nested prologues
(0)

I see that this message comes from a patch submitted by David in
February. Is libffi broken? What is needed to fix it?

The offending assembly code is attached. it's the ".restore sp" near
the end that is triggering the error.

thanks
randolph

	.file	"conftest.i"
	.pred.safe_across_calls p1-p5,p16-p63
	.text
	.align 16
	.global main#
	.proc main#
main:
	.prologue 2, 2
	.vframe r2
	mov r2 = r12
	.body
	;;
#APP
	     .data
     .align 8
1:   data8 @fptr(ffi_closure_UNIX)
     data8 1b
     data8 0
     data8 bar
     data8 @fptr(baz)
     data8 quux
     .text
     .global foo
     .proc foo
foo:
     addl r16 = @ltoff(1b), gp;;
     ld8  gp = [r16];;
     ld8  r17 = [gp];;
     ld8  r19 = [r17],8;
	 adds r18 = 16,gp;;
     ld8  r20 = [r17];;
     st8  [r18]=r20;
     mov b6 = r19
     br.cond.sptk.many b6
     .endp

#NO_APP
	;;
	mov r8 = r0
	.restore sp
	mov r12 = r2
	br.ret.sptk.many b0
	.endp main#
	.ident	"GCC: (GNU) 3.0.4"



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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
@ 2002-04-08 15:52 ` David Mosberger
  2002-04-08 17:25 ` David Mosberger
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: David Mosberger @ 2002-04-08 15:52 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Sun, 7 Apr 2002 17:17:14 -0700, Randolph Chung <randolph@tausq.org> said:

  Randolph> Hi all, While trying to compile mozilla with libffi, the
  Randolph> configure phase dies with a message:

  Randolph> Error: Epilogue count of 4294967296 exceeds number of
  Randolph> nested prologues (0)

  Randolph> I see that this message comes from a patch submitted by
  Randolph> David in February. Is libffi broken? What is needed to fix
  Randolph> it?

  Randolph> The offending assembly code is attached. it's the
  Randolph> ".restore sp" near the end that is triggering the error.

This is a bug in the assembler that was fixed on Feb 22nd.  I think
it should be in binutils-2.12, though I didn't not verify.

	--david


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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
  2002-04-08 15:52 ` David Mosberger
@ 2002-04-08 17:25 ` David Mosberger
  2002-04-09  4:46 ` David Mosberger
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: David Mosberger @ 2002-04-08 17:25 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Sun, 7 Apr 2002 17:17:14 -0700, Randolph Chung <randolph@tausq.org> said:

  Randolph> Hi all, While trying to compile mozilla with libffi, the
  Randolph> configure phase dies with a message:

  Randolph> Error: Epilogue count of 4294967296 exceeds number of
  Randolph> nested prologues (0)

  Randolph> I see that this message comes from a patch submitted by
  Randolph> David in February. Is libffi broken? What is needed to fix
  Randolph> it?

I now realize that you must have been using the latest binutils, as the
old one silently generated bad unwind info.

As Richard pointed out in his mail, the offending code really is
broken.  I was planning to update the mozilla libffi anyhow, both to
sync up with Hans's recent unwind fixes and to look into whether we
could use the assembler directives added for C++ vtables to simplify
the generation of static closures.  Let me take a look at it.

	--david


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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
  2002-04-08 15:52 ` David Mosberger
  2002-04-08 17:25 ` David Mosberger
@ 2002-04-09  4:46 ` David Mosberger
  2002-04-09  5:00 ` David Mosberger
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: David Mosberger @ 2002-04-09  4:46 UTC (permalink / raw)
  To: linux-ia64

Hi Randolph,

>>>>> On Sun, 7 Apr 2002 17:17:14 -0700, Randolph Chung <randolph@tausq.org> said:

  Randolph> Hi all,
  Randolph> While trying to compile mozilla with libffi, the configure phase
  Randolph> dies with a message:

  Randolph> Error: Epilogue count of 4294967296 exceeds number of nested prologues
  Randolph> (0)

  Randolph> I see that this message comes from a patch submitted by David in
  Randolph> February. Is libffi broken? What is needed to fix it?


  Randolph> The offending assembly code is attached. it's the ".restore sp"
  Randolph> near the end that is triggering the error.

I'm unable to reproduce this.  If I'm understanding you right, the
problem occurred during the configure phase of mozilla (not libffi).
I just rebuilt Mozilla from the current CVS tree with gcc3.1
pre-release and the current CVS binutils.  It built just fine and the
resulting binary seems to work flawlessly.

From the assembly code you provided, it looks as if conftest.c tried
to call FFI_STATIC_CLOSURE() from within a function, which can't
possibly work.

Can you provide a more precise pointer where this conftest.c is being
generated?

Thanks,

	--david

  Randolph> .file	"conftest.i"
  Randolph> .pred.safe_across_calls p1-p5,p16-p63
  Randolph> .text
  Randolph> .align 16
  Randolph> .global main#
  Randolph> .proc main#
  Randolph> main:
  Randolph> .prologue 2, 2
  Randolph> .vframe r2
  Randolph> mov r2 = r12
  Randolph> .body
  Randolph> ;;
  Randolph> #APP
  Randolph> .data
  Randolph> .align 8
  Randolph> 1:   data8 @fptr(ffi_closure_UNIX)
  Randolph> data8 1b
  Randolph> data8 0
  Randolph> data8 bar
  Randolph> data8 @fptr(baz)
  Randolph> data8 quux
  Randolph> .text
  Randolph> .global foo
  Randolph> .proc foo
  Randolph> foo:
  Randolph> addl r16 = @ltoff(1b), gp;;
  Randolph> ld8  gp = [r16];;
  Randolph> ld8  r17 = [gp];;
  Randolph> ld8  r19 = [r17],8;
  Randolph> adds r18 = 16,gp;;
  Randolph> ld8  r20 = [r17];;
  Randolph> st8  [r18]=r20;
  Randolph> mov b6 = r19
  Randolph> br.cond.sptk.many b6
  Randolph> .endp

  Randolph> #NO_APP
  Randolph> ;;
  Randolph> mov r8 = r0
  Randolph> .restore sp
  Randolph> mov r12 = r2
  Randolph> br.ret.sptk.many b0
  Randolph> .endp main#
  Randolph> .ident	"GCC: (GNU) 3.0.4"


  Randolph> _______________________________________________
  Randolph> Linux-IA64 mailing list
  Randolph> Linux-IA64@linuxia64.org
  Randolph> http://lists.linuxia64.org/lists/listinfo/linux-ia64


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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
                   ` (2 preceding siblings ...)
  2002-04-09  4:46 ` David Mosberger
@ 2002-04-09  5:00 ` David Mosberger
  2002-04-09  5:09 ` Randolph Chung
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: David Mosberger @ 2002-04-09  5:00 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Mon, 8 Apr 2002 22:09:53 -0700, Randolph Chung <tausq@debian.org> said:

  Randolph> indeed, mozilla's configure.in says:

  Randolph> if test "$LIBFFI_FOUND" = "yes"; then
  Randolph> AC_MSG_CHECKING("for FFI_STATIC_CLOSURE in libffi")
  Randolph> AC_TRY_COMPILE([#include "ffi.h"],
  Randolph> [ FFI_STATIC_CLOSURE(foo, bar, baz, quux); ],
  Randolph> [ LIBFFI_HAS_STATIC_CLOSURE=yes ])
  Randolph> AC_MSG_RESULT("$result")
  Randolph> fi

  Randolph> which generates (from config.log):

  Randolph> configure:13494: checking for FFI_STATIC_CLOSURE in libffi
  Randolph> configure:13503: gcc-3.0 -c -I/home/randolph/debian/mozilla-0.9.9/build-tree/libffi-install/include  -fshort-wchar -pthread -pipe   -I/usr/X11R6/include conftest.c 1>&5
  Randolph> {standard input}: Assembler messages:
  Randolph> {standard input}:40: Error: Epilogue count of 4294967296 exceeds number of nested prologues (0)
  Randolph> configure: failed program was:
  Randolph> #line 13496 "configure"
  Randolph> #include "confdefs.h"
  Randolph> #include "ffi.h"
  Randolph> int main() {
  Randolph> FFI_STATIC_CLOSURE(foo, bar, baz, quux);
  Randolph> ; return 0; }

For some reason, I don't see this in my configure.in.  Was this added
by the Debian patch?  In principle, it's a good idea to check for this
macro, but I the check needs to be different.  To get it to compile,
FFI_STATIC_CLOSURE() would have to be declared at the outermost level.
Alternatively, perhaps you can just grep for this macro in ffi.h (I
think autoconf has support for doing this).

	--david

PS: I dropped binutils from the cc list, as it's clearly not a binutils
    issue.


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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
                   ` (3 preceding siblings ...)
  2002-04-09  5:00 ` David Mosberger
@ 2002-04-09  5:09 ` Randolph Chung
  2002-04-09  5:23 ` Randolph Chung
  2002-04-09  5:56 ` Jeff Licquia
  6 siblings, 0 replies; 8+ messages in thread
From: Randolph Chung @ 2002-04-09  5:09 UTC (permalink / raw)
  To: linux-ia64

> I'm unable to reproduce this.  If I'm understanding you right, the
> problem occurred during the configure phase of mozilla (not libffi).

that's right

> I just rebuilt Mozilla from the current CVS tree with gcc3.1
> pre-release and the current CVS binutils.  It built just fine and the
> resulting binary seems to work flawlessly.

I'm building from Debian sources. It's possible that it's simply out of
date (I'm building version 0.9.9).

> >From the assembly code you provided, it looks as if conftest.c tried
> to call FFI_STATIC_CLOSURE() from within a function, which can't
> possibly work.

indeed, mozilla's configure.in says:

    if test "$LIBFFI_FOUND" = "yes"; then
        AC_MSG_CHECKING("for FFI_STATIC_CLOSURE in libffi")
        AC_TRY_COMPILE([#include "ffi.h"],
                        [ FFI_STATIC_CLOSURE(foo, bar, baz, quux); ],
                        [ LIBFFI_HAS_STATIC_CLOSURE=yes ])
        AC_MSG_RESULT("$result")
    fi

which generates (from config.log):

configure:13494: checking for FFI_STATIC_CLOSURE in libffi
configure:13503: gcc-3.0 -c -I/home/randolph/debian/mozilla-0.9.9/build-tree/libffi-install/include  -fshort-wchar -pthread -pipe   -I/usr/X11R6/include conftest.c 1>&5
{standard input}: Assembler messages:
{standard input}:40: Error: Epilogue count of 4294967296 exceeds number of nested prologues (0)
configure: failed program was:
#line 13496 "configure"
#include "confdefs.h"
#include "ffi.h"
int main() {
 FFI_STATIC_CLOSURE(foo, bar, baz, quux);
; return 0; }

randolph


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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
                   ` (4 preceding siblings ...)
  2002-04-09  5:09 ` Randolph Chung
@ 2002-04-09  5:23 ` Randolph Chung
  2002-04-09  5:56 ` Jeff Licquia
  6 siblings, 0 replies; 8+ messages in thread
From: Randolph Chung @ 2002-04-09  5:23 UTC (permalink / raw)
  To: linux-ia64

> For some reason, I don't see this in my configure.in.  Was this added
> by the Debian patch?  In principle, it's a good idea to check for this
> macro, but I the check needs to be different.  To get it to compile,
> FFI_STATIC_CLOSURE() would have to be declared at the outermost level.
> Alternatively, perhaps you can just grep for this macro in ffi.h (I
> think autoconf has support for doing this).

<sigh> you are right, i will go poke the Debian maintainer about this
now. Sorry for the diversion.

randolph



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

* Re: [Linux-ia64] epilogue count exceeds number of nested prologues
  2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
                   ` (5 preceding siblings ...)
  2002-04-09  5:23 ` Randolph Chung
@ 2002-04-09  5:56 ` Jeff Licquia
  6 siblings, 0 replies; 8+ messages in thread
From: Jeff Licquia @ 2002-04-09  5:56 UTC (permalink / raw)
  To: linux-ia64

On Tue, 2002-04-09 at 00:09, Randolph Chung wrote:
> > I'm unable to reproduce this.  If I'm understanding you right, the
> > problem occurred during the configure phase of mozilla (not libffi).
> 
> that's right
> 
> > I just rebuilt Mozilla from the current CVS tree with gcc3.1
> > pre-release and the current CVS binutils.  It built just fine and the
> > resulting binary seems to work flawlessly.
> 
> I'm building from Debian sources. It's possible that it's simply out of
> date (I'm building version 0.9.9).
> 
> > >From the assembly code you provided, it looks as if conftest.c tried
> > to call FFI_STATIC_CLOSURE() from within a function, which can't
> > possibly work.
> 
> indeed, mozilla's configure.in says:
> 
>     if test "$LIBFFI_FOUND" = "yes"; then
>         AC_MSG_CHECKING("for FFI_STATIC_CLOSURE in libffi")
>         AC_TRY_COMPILE([#include "ffi.h"],
>                         [ FFI_STATIC_CLOSURE(foo, bar, baz, quux); ],
>                         [ LIBFFI_HAS_STATIC_CLOSURE=yes ])
>         AC_MSG_RESULT("$result")
>     fi
> 
> which generates (from config.log):
> 
> configure:13494: checking for FFI_STATIC_CLOSURE in libffi
> configure:13503: gcc-3.0 -c -I/home/randolph/debian/mozilla-0.9.9/build-tree/libffi-install/include  -fshort-wchar -pthread -pipe   -I/usr/X11R6/include conftest.c 1>&5
> {standard input}: Assembler messages:
> {standard input}:40: Error: Epilogue count of 4294967296 exceeds number of nested prologues (0)
> configure: failed program was:
> #line 13496 "configure"
> #include "confdefs.h"
> #include "ffi.h"
> int main() {
>  FFI_STATIC_CLOSURE(foo, bar, baz, quux);
> ; return 0; }

I claim responsibility for this code.  For some reason, it worked in
older revisions.

But yes, I can see how that's incorrect, and should be changed.  I can
whip up a patch if no one else is tomorrow.



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

end of thread, other threads:[~2002-04-09  5:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-08  0:17 [Linux-ia64] epilogue count exceeds number of nested prologues Randolph Chung
2002-04-08 15:52 ` David Mosberger
2002-04-08 17:25 ` David Mosberger
2002-04-09  4:46 ` David Mosberger
2002-04-09  5:00 ` David Mosberger
2002-04-09  5:09 ` Randolph Chung
2002-04-09  5:23 ` Randolph Chung
2002-04-09  5:56 ` Jeff Licquia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox