public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
@ 2014-03-27 19:57 fabian@ritter-vogt.de
  2014-03-27 21:01 ` [Bug c++/60691] " fabian@ritter-vogt.de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: fabian@ritter-vogt.de @ 2014-03-27 19:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

            Bug ID: 60691
           Summary: Build fails in libstdc++ with --enable-sjlj-exceptions
                    on ARM
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fabian@ritter-vogt.de

Created attachment 32468
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32468&action=edit
Assembly produced if gcc invoked manually

I try to compile gcc with sjlj exceptions enabled, however, the build fails at
libstdc++. It's probably a gcc bug but it triggers an assertion in gas as well.

GCC command:

/opt/nspire/Ndless/ndless-sdk/toolchain/build/./gcc/xgcc -shared-libgcc
-B/opt/nspire/Ndless/ndless-sdk/toolchain/build/./gcc -nostdinc++
-L/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/src
-L/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/src/.libs
-B/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/bin/
-B/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/lib/ -isystem
/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/include -isystem
/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/sys-include
-I/opt/nspire/Ndless/ndless-sdk/toolchain/gcc-4.8.2/libstdc++-v3/../libgcc
-I/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/include/arm-none-eabi
-I/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/include
-I/opt/nspire/Ndless/ndless-sdk/toolchain/gcc-4.8.2/libstdc++-v3/libsupc++
-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-frandom-seed=eh_alloc.lo -mcpu=arm926ej-s -fpic -mlong-calls -c
../../../../gcc-4.8.2/libstdc++-v3/libsupc++/eh_alloc.cc -o eh_alloc.o

Output:

/tmp/cc6EsAB0.s: Assembler messages:
/tmp/cc6EsAB0.s:320: Error: missing .fnstart before unwinding directive
/tmp/cc6EsAB0.s:320: Error: duplicate .personality directive
/tmp/cc6EsAB0.s:321: Error: missing .fnstart before unwinding directive
/tmp/cc6EsAB0.s:321: Internal error!
Assertion failure in create_unwind_entry at
../../binutils-2.24/gas/config/tc-arm.c line 20915.
Please report this bug.

Sadly I can't give the commands gcc executes as this doesn't happen if I
execute the command manually. Probably other environment vars set in the GCC
Makefile. I attached the .s file gcc gives me with -s if I execute it manually,
maybe it's helpful.

GCC configure options:

--target=arm-none-eabi --prefix=$PREFIX --enable-interwork --disable-multilib
--enable-languages="c,c++" --enable-sjlj-exceptions --with-system-zlib
--with-newlib --disable-shared --with-gnu-as --with-gnu-ld --with-float=soft
--disable-werror

binutils configure options:

--target=arm-none-eabi --prefix=$PREFIX --enable-interwork --disable-multilib
--with-system-zlib --with-gnu-as --with-gnu-ld --disable-nls --with-float=soft
--disable-werror

I run make with CXXFLAGS_FOR_TARGET="-mcpu=arm926ej-s -fpic -mlong-calls"


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
@ 2014-03-27 21:01 ` fabian@ritter-vogt.de
  2014-03-27 21:10 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fabian@ritter-vogt.de @ 2014-03-27 21:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #2 from Fabian Vogt <fabian@ritter-vogt.de> ---
It crashes and produces weird results if linked to bFLT.
If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still exist?


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
  2014-03-27 21:01 ` [Bug c++/60691] " fabian@ritter-vogt.de
@ 2014-03-27 21:10 ` pinskia at gcc dot gnu.org
  2014-04-02 16:55 ` fabian@ritter-vogt.de
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-03-27 21:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Fabian Vogt from comment #2)
> It crashes and produces weird results if linked to bFLT.

Yes because EABI is an elf only abi, if it does not have a place for the unwind
tables, then it is incompatible with the ABI :).

>If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still exist?

Because it is supported for some other targets, mainly windows based ones.


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
  2014-03-27 21:01 ` [Bug c++/60691] " fabian@ritter-vogt.de
  2014-03-27 21:10 ` pinskia at gcc dot gnu.org
@ 2014-04-02 16:55 ` fabian@ritter-vogt.de
  2014-12-12 15:19 ` ramana at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fabian@ritter-vogt.de @ 2014-04-02 16:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #4 from Fabian Vogt <fabian@ritter-vogt.de> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Fabian Vogt from comment #2)
> > It crashes and produces weird results if linked to bFLT.
> 
> Yes because EABI is an elf only abi, if it does not have a place for the
> unwind tables, then it is incompatible with the ABI :).
Is it enough to put it (sorted/ordered) anywhere in the binary and point
__exidx_start (IIRC) and __exidx_end to the correct positions?

> >If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still exist?
> 
> Because it is supported for some other targets, mainly windows based ones.

Hmm.. Windows RT? :P

Anyway, I had also reported the bug on binutils' bugzilla and the gas internal
error has been fixed. Nick even made a patch for gcc so it doesn't generate bad
asm anymore :-)

Bug report on gas: https://sourceware.org/bugzilla/show_bug.cgi?id=16765
Proposed patch: https://sourceware.org/bugzilla/attachment.cgi?id=7520


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
                   ` (2 preceding siblings ...)
  2014-04-02 16:55 ` fabian@ritter-vogt.de
@ 2014-12-12 15:19 ` ramana at gcc dot gnu.org
  2014-12-12 15:30 ` fabian@ritter-vogt.de
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-12-12 15:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ramana at gcc dot gnu.org
         Resolution|---                         |WONTFIX

--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
(In reply to Fabian Vogt from comment #4)
> (In reply to Andrew Pinski from comment #3)
> > (In reply to Fabian Vogt from comment #2)
> > > It crashes and produces weird results if linked to bFLT.
> > 
> > Yes because EABI is an elf only abi, if it does not have a place for the
> > unwind tables, then it is incompatible with the ABI :).
> Is it enough to put it (sorted/ordered) anywhere in the binary and point
> __exidx_start (IIRC) and __exidx_end to the correct positions?
> 
> > >If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still exist?
> > 
> > Because it is supported for some other targets, mainly windows based ones.
> 
> Hmm.. Windows RT? :P
> 
> Anyway, I had also reported the bug on binutils' bugzilla and the gas
> internal error has been fixed. Nick even made a patch for gcc so it doesn't
> generate bad asm anymore :-)
> 
> Bug report on gas: https://sourceware.org/bugzilla/show_bug.cgi?id=16765
> Proposed patch: https://sourceware.org/bugzilla/attachment.cgi?id=7520


On ARM EABI, Linux GNUEABI the standard unwind tables are part of the ABI, sjlj
exceptions are not used and are likely to be completely bit rotten. There is
not much chance that this will work by default on ARM and neither is it going
to be standard configuration. Given this situation and that there is no
interest in this option on ARM I'm going to reject this bug.


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
                   ` (3 preceding siblings ...)
  2014-12-12 15:19 ` ramana at gcc dot gnu.org
@ 2014-12-12 15:30 ` fabian@ritter-vogt.de
  2014-12-12 15:35 ` redi at gcc dot gnu.org
  2014-12-12 16:13 ` ramana at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fabian@ritter-vogt.de @ 2014-12-12 15:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #6 from Fabian Vogt <fabian@ritter-vogt.de> ---
If sjlj exceptions are not supported for ARM, shouldn't the configure option be
invalid for ARM or at least print a warning?
If an option does exist and it simply crashes the compiler during make, it's
definitely broken and must be removed.


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
                   ` (4 preceding siblings ...)
  2014-12-12 15:30 ` fabian@ritter-vogt.de
@ 2014-12-12 15:35 ` redi at gcc dot gnu.org
  2014-12-12 16:13 ` ramana at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-12 15:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Just don't do silly things.

Just because an option exists doesn't mean you need to use it.


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

* [Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM
  2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
                   ` (5 preceding siblings ...)
  2014-12-12 15:35 ` redi at gcc dot gnu.org
@ 2014-12-12 16:13 ` ramana at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-12-12 16:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #8 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
(In reply to Fabian Vogt from comment #6)
> If sjlj exceptions are not supported for ARM, shouldn't the configure option
> be invalid for ARM or at least print a warning?
> If an option does exist and it simply crashes the compiler during make, it's
> definitely broken and must be removed.

If that were a user option then yes, I agree.

If folks are building their own toolchains, they should know what they are
doing and not just use options because they think it may just work willy-nilly.


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

end of thread, other threads:[~2014-12-12 16:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-27 19:57 [Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM fabian@ritter-vogt.de
2014-03-27 21:01 ` [Bug c++/60691] " fabian@ritter-vogt.de
2014-03-27 21:10 ` pinskia at gcc dot gnu.org
2014-04-02 16:55 ` fabian@ritter-vogt.de
2014-12-12 15:19 ` ramana at gcc dot gnu.org
2014-12-12 15:30 ` fabian@ritter-vogt.de
2014-12-12 15:35 ` redi at gcc dot gnu.org
2014-12-12 16:13 ` ramana at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).