Last Comment Bug 645469 - [gcc 4.6] Build process is broken while working on embedding/browser/gtk/src/EmbedPrivate.cpp
: [gcc 4.6] Build process is broken while working on embedding/browser/gtk/src/...
Status: RESOLVED DUPLICATE of bug 623126
Product: Core
Classification: Components
Component: General (show other bugs)
: unspecified
: x86_64 Linux
-- critical with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2011-03-27 02:33 PDT by Frederic Bezies
Modified: 2011-04-30 02:35 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Frederic Bezies 2011-03-27 02:33:26 PDT
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20100101 Firefox/4.2a1pre
Build Identifier: 

As of today, archlinux (using testing repository) give access to gcc 4.6

Build process goes well until embedding/browser/gtk/src/EmbedPrivate.cpp is processed.

An uninitialized const ‘kDirectoryProvider’ stops building process immediately.

Reproducible: Always

Steps to Reproduce:
1.Have a clean and up to date source code
2.Build it using gcc 4.6
3.wait until embedding/browser/gtk/src/EmbedPrivate.cpp is processed
Actual Results:  
Build process is broken.

Expected Results:  
Going on and finish build process ?

.mozconfig used :

# See for build instructions.

export AUTOCONF=autoconf-2.13

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir-fx
mk_add_options MOZ_MAKE_FLAGS=-j4

# Options for ‘configure’ (same as command-line options).
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --disable-tests
ac_add_options --disable-crashreporter
ac_add_options --with-ccache

Will add error log asap.
Comment 1 User image Frederic Bezies 2011-03-27 02:34:05 PDT
Error log :

/home/fred/logs/fox/src/embedding/browser/gtk/src/EmbedPrivate.cpp:107:40: erreur: uninitialized const ‘kDirectoryProvider’ [-fpermissive]
/home/fred/logs/fox/src/embedding/browser/gtk/src/EmbedPrivate.cpp:99:7: note: ‘const class GTKEmbedDirectoryProvider’ has no user-provided default constructor

In the directory  /home/fred/logs/fox/objdir-fx/embedding/browser/gtk/src
The following command failed to execute properly:
/usr/bin/ccache c++ -o EmbedPrivate.o -c -I../../../../dist/stl_wrappers -I../../../../dist/system_wrappers -include /home/fred/logs/fox/src/config/gcc_hidden.h -DIMPL_XREAPI -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DOSTYPE="Linux2.6" -DOSARCH=Linux -D_IMPL_GTKMOZEMBED -I. -I/home/fred/logs/fox/src/embedding/browser/gtk/src -I. -I../../../../dist/include -I../../../../dist/include/nsprpub -I/home/fred/logs/fox/objdir-fx/dist/include/nspr -I/home/fred/logs/fox/objdir-fx/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 -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fomit-frame-pointer -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/gtk-unix-print-2.0 -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -MD -MF .deps/EmbedPrivate.pp /home/fred/logs/fox/src/embedding/browser/gtk/src/EmbedPrivate.cpp
Comment 2 User image Ionut Biru 2011-03-27 03:10:51 PDT
there are more places that are affected. i got it in:

c++ -o nsIInterfaceRequestorUtils.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /build/src/mozilla-2.0/config/gcc_hidden.h -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -DTARGET_XPCOM_ABI=\"x86_64-gcc3\" -I/build/src/mozilla-2.0/xpcom/glue/../build  -I/build/src/mozilla-2.0/xpcom/glue -I. -I../../dist/include -I../../dist/include/nsprpub  -I/usr/include/nspr -I/usr/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 -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer    -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/nsIInterfaceRequestorUtils.pp /build/src/mozilla-2.0/xpcom/glue/nsIInterfaceRequestorUtils.cpp
/build/src/mozilla-2.0/xpcom/glue/nsEnumeratorUtils.cpp:115:27: error: uninitialized const 'EmptyEnumeratorImpl::kInstance' [-fpermissive]
/build/src/mozilla-2.0/xpcom/glue/nsEnumeratorUtils.cpp:50:7: note: 'const class EmptyEnumeratorImpl' has no user-provided default constructor
Comment 3 User image Frederic Bezies 2011-03-27 03:50:36 PDT
On archlinux bugtracker, Rémy Oudompheng give an idea to workaround this (I'm testing this right now) :

"Probably related to "G++ no longer allows objects of const-qualified type to be default initialized unless the type has a user-declared default constructor." in latest GCC changes. g++ has become more strict in its checking, add -fpermissive to your CXXFLAGS to work around this."

Added this to .mozconfig :

export CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fpermissive"

I will see if it could go well or not.
Comment 4 User image Frederic Bezies 2011-03-27 04:56:51 PDT
It worked, but it is a workaround. The real answer will be to fix source code, or am I wrong ?
Comment 5 User image Jonathan Wakely 2011-04-01 11:06:55 PDT
You are correct. Fixing the code is simple:

const EmptyEnumeratorImpl EmptyEnumeratorImpl::kInstance = EmptyEnumeratorImpl();
Comment 6 User image Jonathan Wakely 2011-04-01 11:10:20 PDT
and for the first failure:

static const GTKEmbedDirectoryProvider kDirectoryProvider
    = GTKEmbedDirectoryProvider();
Comment 7 User image Mike Hommey [:glandium] 2011-04-30 02:35:11 PDT

*** This bug has been marked as a duplicate of bug 623126 ***

Note You need to log in before you can comment on or make changes to this bug.