Closed Bug 1023156 Opened 10 years ago Closed 10 years ago

Cannot build Qt with errors in gfxQtPlatforms (with Qt 5.3)

Categories

(Core Graveyard :: Widget: Qt, defect)

x86_64
Linux
defect
Not set
blocker

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: masayuki, Assigned: tatiana)

Details

Attachments

(1 file, 6 obsolete files)

I'm trying to build Linux-Qt build for testing. However, I cannot build Qt-build with following errors.

> 7:54.70 In file included from ../../dist/include/GLContextTypes.h:9:0,
>  7:54.70                  from ../../dist/include/GLXLibrary.h:9,
>  7:54.70                  from /home/toybox/mozilla/src/gfx/thebes/gfxXlibSurface.h:15,
>  7:54.70                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:36:
>  7:54.70 ../../dist/include/GLTypes.h:70:63: error: conflicting declaration ‘typedef void (* GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar*, const GLvoid*)’
>  7:54.70                                         const GLvoid* userParam);
>  7:54.70                                                                ^
>  7:54.70 In file included from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopengl.h:111:0,
>  7:54.70                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopenglcontext.h:62,
>  7:54.70                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/5.3.0/QtGui/qpa/qplatformintegration.h:57,
>  7:54.70                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:10:
>  7:54.70 /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopenglext.h:6300:17: error: ‘GLDEBUGPROC’ has a previous declaration as ‘typedef void (* GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar*, GLvoid*)’
>  7:54.70  typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
>  7:54.70                  ^
>  7:54.70 In file included from /home/toybox/mozilla/src/gfx/thebes/gfxXlibSurface.h:15:0,
>  7:54.70                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:36:
>  7:54.70 ../../dist/include/GLXLibrary.h:10:23: error: conflicting declaration ‘typedef realGLboolean GLboolean’
>  7:54.71  typedef realGLboolean GLboolean;
>  7:54.71                        ^
>  7:54.71 In file included from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopengl.h:110:0,
>  7:54.71                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopenglcontext.h:62,
>  7:54.71                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/5.3.0/QtGui/qpa/qplatformintegration.h:57,
>  7:54.71                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:10:
>  7:54.71 /usr/include/GL/gl.h:126:23: error: ‘GLboolean’ has a previous declaration as ‘typedef unsigned char GLboolean’
>  7:54.71  typedef unsigned char GLboolean;

I'm not sure what version of Qt should be used, though.

I tried with/without ccache and/or unified-compilation but they won't solve this bug.
Attached patch Possible workaround (obsolete) — Splinter Review
Weird, I though that issue gone already..
I'm using debian-testing + 
libgl1-mesa-dev 10.1.4-1  (nouveau-gallium)
qtbase5-dev 5.2.1+dfsg-3

And it compiles ok for me.
Also I tested it on desktop with Nvidia drivers and headers and no issues there.

Try this patch, and let me know if it helps for you?
Attachment #8437688 - Flags: feedback?(masayuki)
Comment on attachment 8437688 [details] [diff] [review]
Possible workaround

Unfortunately, this does not fix the bustage. I tested after clobber.

>  2:11.52 In file included from ../../dist/include/GLDefs.h:8:0,
>  2:11.52                  from ../../dist/include/GLContext.h:28,
>  2:11.52                  from ../../dist/include/GLXLibrary.h:9,
>  2:11.52                  from /home/toybox/mozilla/src/gfx/thebes/gfxXlibSurface.h:15,
>  2:11.52                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:36:
>  2:11.52 ../../dist/include/GLTypes.h:71:63: error: conflicting declaration ‘typedef void (* GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar*, const GLvoid*)’
>  2:11.52                                         const GLvoid* userParam);
>  2:11.52                                                                ^
>  2:11.52 In file included from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopengl.h:111:0,
>  2:11.52                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopenglcontext.h:62,
>  2:11.52                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/5.3.0/QtGui/qpa/qplatformintegration.h:57,
>  2:11.52                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:10:
>  2:11.52 /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopenglext.h:6300:17: error: ‘GLDEBUGPROC’ has a previous declaration as ‘typedef void (* GLDEBUGPROC)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar*, GLvoid*)’
>  2:11.52  typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
>  2:11.52                  ^
>  2:11.52 In file included from /home/toybox/mozilla/src/gfx/thebes/gfxXlibSurface.h:15:0,
>  2:11.52                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:36:
>  2:11.52 ../../dist/include/GLXLibrary.h:12:23: error: conflicting declaration ‘typedef realGLboolean GLboolean’
>  2:11.52  typedef realGLboolean GLboolean;
>  2:11.52                        ^
>  2:11.52 In file included from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopengl.h:110:0,
>  2:11.52                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/qopenglcontext.h:62,
>  2:11.52                  from /home/toybox/Qt/5.3/gcc_64//include/QtGui/5.3.0/QtGui/qpa/qplatformintegration.h:57,
>  2:11.52                  from /home/toybox/mozilla/src/gfx/thebes/gfxQtPlatform.cpp:10:
>  2:11.52 /usr/include/GL/gl.h:126:23: error: ‘GLboolean’ has a previous declaration as ‘typedef unsigned char GLboolean’
>  2:11.52  typedef unsigned char GLboolean;
>  2:11.52                        ^
Attachment #8437688 - Flags: feedback?(masayuki) → feedback-
Attached file My mozconfig file (obsolete) —
My mozconfig file is here.

I'm using Ubuntu 14.04 (x64). I installed the Qt5.3 from the installer downloaded from Qt's website.
https://qt-project.org/downloads

I tried with other versions, 5.1.1 and 5.2.1. However, while prepering the build environment, it fails with strange message:

>  0:36.27 creating ./config.status
>  0:36.43 Reticulating splines...
>  0:46.71 Finished reading 1093 moz.build files in 0.92s
>  0:46.71 Processed into 6176 build config descriptors in 5.31s
>  0:46.71 Backend executed in 3.76s
>  0:46.71 2382 total backend files; 2382 created; 0 updated; 0 unchanged; 0 deleted; 235 -> 972 Makefile
>  0:46.71 Total wall time: 10.28s; CPU time: 9.87s; Efficiency: 96%; Untracked: 0.28s
>  0:46.81 config/autoconf.mk:209: *** 分離記号を欠いています.  中止.
>  0:46.81 make[1]: *** [realbuild] エラー 2
>  0:46.81 make: *** [build] エラー 2
>  0:46.83 0 compiler warnings present.

The erroe message meant that "There is no separator, stopped."
Oops, the comment 3's bustage is at building with Qt 5.3, although, the attached mozconfig file enables Qt 5.2.1.
As far I can see Ubuntu 14 has Qt 5.2.1 in distribution
http://packages.ubuntu.com/search?keywords=qtbase&searchon=names&suite=trusty&section=all
I'll check what is going on with "--with-qtdir" option, but could you try do next
https://github.com/tmeshkova/xulrunner-package/blob/master/dependencies

apt-get install make libtool autotools-dev autoconf2.13 g++ zip zlib1g-dev pkg-config libpango1.0-dev yasm libasound2-dev qt5-default qtbase5-private-dev qtdeclarative5-dev qtquick1-5-dev qtscript5-dev qtdeclarative5-test-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-private-dev

and build it without --with-qtdir option, so it will take system installed libraries.
Distribution package may have that issue workarounded as package patch
Awesome! Succeeded to compile gfxQtPlatform now. I'll keep to watch whether it can build it.

If you don't think this should be fixed, please mark this as INVA or WONTFIX. Thanks! I'll test Qt's keyboard event's behavior if the build will succeed.
I completely succeeded to build the Qt-build of m-c. Thank you.
> If you don't think this should be fixed, please mark this as INVA or
> WONTFIX. Thanks! I'll test Qt's keyboard event's behavior if the build will
> succeed.

so what helped at the end? using system Qt5 ?
(In reply to Oleg Romashin (:romaxa) from comment #8)
> > If you don't think this should be fixed, please mark this as INVA or
> > WONTFIX. Thanks! I'll test Qt's keyboard event's behavior if the build will
> > succeed.
> 
> so what helped at the end? using system Qt5 ?

Yes.
Attached patch removed problematic line (obsolete) — Splinter Review
I had the same problem. Not including qplatformintegration fixed it.
Attached patch Fix for latest Qt Firefox (obsolete) — Splinter Review
export MOZ_DEBUG_SYMBOLS=1
mk_add_options MOZ_MAKE_FLAGS="-j8"
ac_add_options --enable-application=browser
ac_add_options --enable-default-toolkit=cairo-qt
mk_add_options MOZ_MAKE_FLAGS="-j9"
mk_add_options MOZ_OBJDIR="@TOPSRCDIR@/../objdir-desktop-qt"
mk_add_options AUTOCLOBBER=1

Here is my config file.
Attachment #8437688 - Attachment is obsolete: true
Attachment #8437706 - Attachment is obsolete: true
Attachment #8515467 - Attachment is obsolete: true
Attachment #8515568 - Flags: review?(masayuki)
Attached patch Fix for latest Qt Firefox (obsolete) — Splinter Review
1) convolverSSE2.cpp - don't build without skia
2) move QCoreApplication outside of unified build, to avoid qt include issues
3) remove non existing base/lazy_instance.h
4) removed qpa/qplatformintegration.h
5) move nsMIMEInfo Qt outside of unified sources
6) minor widget qt fixes
Attachment #8515568 - Attachment is obsolete: true
Attachment #8515568 - Flags: review?(masayuki)
Attachment #8515569 - Flags: review?(masayuki)
If static assertion is gone, size of those arrays won't be QPrinter::NPageSize anymore.
Please add this change to the patch.
Comment on attachment 8515569 [details] [diff] [review]
Fix for latest Qt Firefox

Adding Mike for some moz.build files changes related to Qt includes in UNIFIED mode. Also double check if CONFIG['MOZ_ENABLE_SKIA']: conditions
Attachment #8515569 - Flags: review?(mh+mozilla)
Attachment #8515569 - Flags: review?(mh+mozilla) → review+
Sorry for the delay. I'll try to check the patch soon.
Comment on attachment 8515569 [details] [diff] [review]
Fix for latest Qt Firefox

I succeeded to build and launch Qt build.

However, this breaks GTK build:

> diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
> index 1f2f4db..13c18ed 100644
> --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
> +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
> @@ -24,21 +21,16 @@
>  #ifdef MOZ_ENABLE_DBUS
>  #include "nsDBusHandlerApp.h"
>  #endif
> +#include "nsMIMEInfoQt.h"
>  
>  nsresult
>  nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
>  {
>    nsresult rv = nsGNOMERegistry::LoadURL(aURI);
>  
> -#ifdef MOZ_WIDGET_QT
>    if (NS_FAILED(rv)) {
> -    nsAutoCString spec;
> -    aURI->GetAsciiSpec(spec);
> -    if (QDesktopServices::openUrl(QUrl(spec.get()))) {
> -      rv = NS_OK;
> -    }
> +    rv = nsMIMEInfoQt::LoadUriInternal(aURI);
>    }
> -#endif
>  
>    return rv;
>  }

I think that you shouldn't remove this #ifdef.

And unfortunately, I cannot give r+ for any part of this patch due to no permission. But feel free to ask me anything.
Attachment #8515569 - Flags: review?(masayuki) → feedback-
Oops, this is what the build error of GTK build is:

>  1:00.48 /usr/bin/ld.gold.real: error: /media/toybox/sub/mozilla/fx-gtk2-dbg/toolkit/library/../../uriloader/exthandler/Unified_cpp_uriloader_exthandler0.o: requires dynamic R_X86_64_PC32 reloc against 'nsMIMEInfoQt::LoadUriInternal(nsIURI*)' which may overflow at runtime; recompile with -fPIC
>  1:00.48 /usr/bin/ld.gold.real: error: read-only segment has dynamic relocations
>  1:00.48 /media/toybox/sub/mozilla/src/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp:32: error: undefined reference to 'nsMIMEInfoQt::LoadUriInternal(nsIURI*)'
>  1:00.48 collect2: ld returned 1 exit status
This should fix gtk build. I didn't test it though.
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -71,7 +71,10 @@
         osdir + '/nsOSHelperAppService.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_GTK']:
+    SOURCES += [
+        'unix/nsMIMEInfoQt.cpp',
+    ]
     UNIFIED_SOURCES += [
         'unix/nsGNOMERegistry.cpp',
         'unix/nsMIMEInfoUnix.cpp',
I builded Firefox with Qt and got problems with context menus. 
Screenshot: http://i.imgur.com/WipW4GK.png
This is normal at this point?
I need to create a new issue or wait until the situation with Firefox build via Qt is stabilized?

Env: kUbuntu 14.10, 64-bit, GCC 4.9.1
Context menus it is some style issue, I believe adding custom FF (css style based) theme will fix the issue
Assignee: nobody → tanya.meshkova
Attachment #8515569 - Attachment is obsolete: true
Attachment #8515665 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8518220 - Flags: review?(masayuki)
Comment on attachment 8518220 [details] [diff] [review]
Fix for latest Qt Firefox

Thanks. I can build both GTK2 and Qt builds. However, I cannot mark r+ for this because I don't have permission any files changed by this patch.

The plugin part could be reviewed by Josh Aas? I'm not sure around uri loader. The qt widget must be able to be reviewed by romaxa.
Attachment #8518220 - Flags: review?(masayuki) → feedback+
Attachment #8518220 - Flags: review?(romaxa)
Attachment #8518220 - Flags: review?(joshmoz)
Comment on attachment 8518220 [details] [diff] [review]
Fix for latest Qt Firefox

Review of attachment 8518220 [details] [diff] [review]:
-----------------------------------------------------------------

All in QT ifdefs, so fine with me.
Attachment #8518220 - Flags: review?(joshmoz) → review+
Attachment #8518220 - Flags: review?(romaxa) → review+
https://hg.mozilla.org/mozilla-central/rev/88315012b6cc
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.