error: cannot use typeid with -fno-rtti when building with gcc 4.4

RESOLVED FIXED in mozilla6

Status

()

Core
Build Config
RESOLVED FIXED
6 years ago
a year ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

Trunk
mozilla6
All
Linux
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 529755 [details] [diff] [review]
Detect gcc c++0x headers brokenness and don't use -std=gnu++0x then

As reported by bsmedberg on irc:

c++ -o crashreporter.o -c  -I../../../dist/system_wrappers -include ../../../../src/config/gcc_hidden.h -DOSTYPE=\"Linux2.6.34.7-61.fc13\" -DOSARCH=Linux -I../../../../src/toolkit/crashreporter/client/../google-breakpad/src -I../../../../src/toolkit/crashreporter/client -I../../../../src/toolkit/crashreporter/client -I. -I../../../dist/include -I../../../dist/include/nsprpub  -I/builds/mozilla-central/ff-debug/dist/include/nspr -I/builds/mozilla-central/ff-debug/dist/include/nss       -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -std=gnu++0x -pthread -pipe -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-unix-print-2.0   -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include    -DDEBUG -D_DEBUG -DTRACING -g   -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MF .deps/crashreporter.pp /builds/mozilla-central/src/toolkit/crashreporter/client/crashreporter.cpp
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/memory:84,
                 from ../../../dist/system_wrappers/memory:4,
                 from /builds/mozilla-central/src/toolkit/crashreporter/client/crashreporter.cpp:50:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h: In member function ‘virtual void* std::_Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp>::_M_get_deleter(const std::type_info&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h: In member function ‘virtual void* std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_get_deleter(const std::type_info&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h:204: error: cannot use typeid with -fno-rtti
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/memory:84,
                 from ../../../dist/system_wrappers/memory:4,
                 from /builds/mozilla-central/src/toolkit/crashreporter/client/crashreporter.cpp:50:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h: In constructor ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, _Alloc, _Args&& ...)’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h:861: error: cannot use typeid with -fno-rtti
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h: In function ‘_Del* std::get_deleter(const std::__shared_ptr<_Tp2, _Lp>&)’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/bits/shared_ptr.h:1005: error: cannot use typeid with -fno-rtti
make[1]: *** [crashreporter.o] Error 1
make[1]: Leaving directory `/builds/mozilla-central/ff-debug/toolkit/crashreporter/client'
make: *** [libs] Error 2

gcc 4.4 c++0x headers are actually broken in that they require rtti. It's not the case on gcc 4.5.
Attachment #529755 - Flags: review?(benjamin)
(Assignee)

Updated

6 years ago
Blocks: 650304
Thanks for the fix; fwiw I then also get another compilation error with gcc 4.4:

In file included from /home/bjacob/mozilla-central/xpcom/string/src/nsSubstring.cpp:55:
../../../dist/include/nsStaticAtom.h:48: error: ‘char16_t’ does not name a type
In file included from /home/bjacob/mozilla-central/xpcom/string/src/nsSubstring.cpp:55:
../../../dist/include/nsStaticAtom.h:76: error: ‘nsStaticAtomStringType’ does not name a type
(Assignee)

Comment 2

6 years ago
(In reply to comment #1)
> Thanks for the fix; fwiw I then also get another compilation error with gcc
> 4.4:
> 
> In file included from
> /home/bjacob/mozilla-central/xpcom/string/src/nsSubstring.cpp:55:
> ../../../dist/include/nsStaticAtom.h:48: error: ‘char16_t’ does not name a type
> In file included from
> /home/bjacob/mozilla-central/xpcom/string/src/nsSubstring.cpp:55:
> ../../../dist/include/nsStaticAtom.h:76: error: ‘nsStaticAtomStringType’ does
> not name a type

try removing config.cache before running configure.
Comment on attachment 529755 [details] [diff] [review]
Detect gcc c++0x headers brokenness and don't use -std=gnu++0x then

This works locally and appears to be correct.
Attachment #529755 - Flags: review?(benjamin) → review+
(In reply to comment #2)
> (In reply to comment #1)
> try removing config.cache before running configure.

Thanks, this worked.
I too hit this problem.  The patch fixed it for me, thanks Mike.
http://hg.mozilla.org/mozilla-central/rev/790f42440904
Assignee: nobody → mh+mozilla
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla6

Comment 7

6 years ago
Hi, 

I just did an update to both my firefox and seamonkey beta-src directories and both have failed with this GCC flag "-fno-rtti" in /beta-src/toolkit/crashreporter/client/crashreporter.cpp. GCC versions are "gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3" AND "gcc (GCC) 4.7.0 20120110 (experimental)".

I would have thought that the patch would be integrated by now. Am I doing something wrong?

Is there a command to query what version/revision/trunk I'm using?

Thanks,

George...

Comment 8

5 years ago
Hi,

I'm still getting this error so it looks like the bug is NOT fixed.

Is anyone working on this? Looking at this?

George...
(Assignee)

Updated

a year ago
Blocks: 1261263
You need to log in before you can comment on or make changes to this bug.