[Meego] GLDefs.h GLsizeiptr, GLintptr gl types definition conflicts with khronos gl types

RESOLVED FIXED

Status

()

Core
Graphics
--
major
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: Lokesh Goel, Assigned: romaxa)

Tracking

Trunk
Other
MeeGo
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8
Build Identifier: mozilla-central 75d2145d1bd3 + mobile-browser 078449f88da5

Build fails on Meego armel platform.

Reproducible: Always

Steps to Reproduce:
I am trying to build mozilla-central 75d2145d1bd3 + mobile-browser 078449f88da5 over Meego(rpmbuild) platform for armel architecture. Build fails with the following error : 

c++ -o GLContextProviderEGL.o -c   -fvisibility=hidden -DIMPL_THEBES -DWOFF_MOZILLA_CLIENT  -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.31.12-0\"  -DOSARCH=Linux -DEXCLUDE_SKIA_DEPENDENCIES -DCHROMIUM_MOZILLA_BUILD  -DOS_LINUX=1 -DOS_POSIX=1  -I/home/abuild/rpmbuild/BUILD/mozilla-central/ipc/chromium/src  -I/home/abuild/rpmbuild/BUILD/mozilla-central/ipc/glue  -I../../ipc/ipdl/_ipdlheaders   -I/home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes -I.  -I../../dist/include -I../../dist/include/nsprpub   -I/home/abuild/rpmbuild/BUILD/release/dist/include/nspr  -I/home/abuild/rpmbuild/BUILD/release/dist/include/nss       -fPIC  -fno-exceptions -frtti -fexceptions -Wall -Wpointer-arith  -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy  -Wno-non-virtual-dtor -Wno-invalid-offsetof -Wno-variadic-macros  -Werror=return-type -Wno-long-long -O2 -g -pipe -Wall  -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector -fno-omit-frame-pointer  --param=ssp-buffer-size=4 -fmessage-length=0 -march=armv7-a  -mtune=cortex-a8 -mlittle-endian -mfpu=vfpv3 -mfloat-abi=softfp  -D__SOFTFP__ -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG  -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer -finline-limit=50  -I/home/abuild/rpmbuild/BUILD/release/dist/include/cairo -DQT_SHARED  -I/usr/include/meegotouch -I/usr/include/qt4 -I/usr/include/qt4/QtGui  -I/usr/include/qt4/QtCore   -DQT_SHARED -I/usr/include/qt4  -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtCore  -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtOpenGL    -I/usr/include/freetype2 -pthread -I/usr/include/pango-1.0  -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -I/usr/include/freetype2    -fno-exceptions -DMOZILLA_CLIENT -include  ../../mozilla-config.h -MD -MF .deps/GLContextProviderEGL.pp  /home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes/GLContextProviderEGL.cpp
In file included from /home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes/GLContext.h:50:0,
                 from /home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes/GLContextProvider.h:40,
                 from /home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes/GLContextProviderEGL.cpp:143:
/home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes/GLDefs.h:68:19:  error: conflicting declaration 'typedef ptrdiff_t GLsizeiptr'
//usr/include/GLES2/gl2.h:39:26: error: 'GLsizeiptr' has a previous declaration as 'typedef khronos_ssize_t GLsizeiptr'
/home/abuild/rpmbuild/BUILD/mozilla-central/gfx/thebes/GLDefs.h:70:19:  error: conflicting declaration 'typedef ptrdiff_t GLintptr'
//usr/include/GLES2/gl2.h:38:26: error: 'GLintptr' has a previous declaration as 'typedef khronos_intptr_t GLintptr'
make[5]: *** [GLContextProviderEGL.o] Error 1
make[5]: Leaving directory `/home/abuild/rpmbuild/BUILD/release/gfx/thebes'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/home/abuild/rpmbuild/BUILD/release/gfx'
make[3]: *** [libs_tier_platform] Error 2
make[3]: Leaving directory `/home/abuild/rpmbuild/BUILD/release'
make[2]: *** [tier_platform] Error 2
make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/release'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/abuild/rpmbuild/BUILD/release'
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.xWaD7g (%build)


All gl and gles related version libraries and dev packages in the build: libqtopengl4-4.7.0~rc1-3.1
mesa-dri-i965-driver-7.8.99.1~gitb018ea19a3-3.2
mesa-libGLESv2-7.8.99.1~gitb018ea19a3-3.2
mesa-libEGL-7.8.99.1~gitb018ea19a3-3.2
mesa-libEGL-devel-7.8.99.1~gitb018ea19a3-3.2
mesa-libGLESv2-compat-7.8.99.1~gitb018ea19a3-3.2
mesa-libGLESv2-devel-7.8.99.1~gitb018ea19a3-3.2

Also find the full build log attached, which has details of the other package versions and build options.

Also find the mozconfig file attached.

I tried this but didn't work, still fails:
diff --git a/gfx/thebes/GLDefs.h b/gfx/thebes/GLDefs.h
--- a/gfx/thebes/GLDefs.h
+++ b/gfx/thebes/GLDefs.h
@@ -59,18 +59,22 @@ typedef float GLfloat;
 typedef float GLclampf;
 #ifndef GLdouble_defined
 typedef double GLdouble;
 #endif
 typedef double GLclampd;
 typedef void GLvoid;

 typedef char GLchar;
+#ifndef GLsizeiptr_defined
 typedef ptrdiff_t GLsizeiptr;
+#endif
+#ifndef GLintptr_defined
 typedef ptrdiff_t GLintptr;
+#endif

 #ifndef GLAPIENTRY
 # ifdef WIN32
 #  define GLAPIENTRY APIENTRY
 #  define GLAPI
 # else
 #  define GLAPIENTRY
 #  define GLAPI
(Reporter)

Updated

7 years ago
OS: Linux → MeeGo
Version: unspecified → Trunk
(Reporter)

Comment 1

7 years ago
Created attachment 473085 [details]
Build Log

Attaching build log.
(Reporter)

Comment 2

7 years ago
Created attachment 473091 [details]
Mozconfig file

Attaching mozconfig file.Other changes added to this file can be seen in my next attachment. fennec-qt.spec
(Reporter)

Comment 3

7 years ago
Created attachment 473092 [details]
Spec file used to build the rpm
Component: Build Config → Graphics
QA Contact: build-config → thebes
Attachment #473091 - Attachment mime type: application/octet-stream → text/plain
(Assignee)

Comment 4

7 years ago
this stuff compiling on N900, HArmattan, ... and I guess something wrong with meego headers...

could you try to compare harmattan and meego EGL headers? and find the difference?
(Reporter)

Comment 5

7 years ago
By applying the following two patches, arm build succeeds in Meego:
1) 
diff --git a/gfx/thebes/GLDefs.h b/gfx/thebes/GLDefs.h
--- a/gfx/thebes/GLDefs.h
+++ b/gfx/thebes/GLDefs.h
@@ -59,18 +59,20 @@ typedef float GLfloat;
 typedef float GLclampf;
 #ifndef GLdouble_defined
 typedef double GLdouble;
 #endif
 typedef double GLclampd;
 typedef void GLvoid;

 typedef char GLchar;
+#ifndef GLdouble_defined
 typedef ptrdiff_t GLsizeiptr;
 typedef ptrdiff_t GLintptr;
+#endif

 #ifndef GLAPIENTRY
 # ifdef WIN32
 #  define GLAPIENTRY APIENTRY
 #  define GLAPI
 # else
 #  define GLAPIENTRY
 #  define GLAPI

2) 
--- a/layout/generic/nsFrame.h.orig     2010-06-22 17:13:17.000000000 +0300
+++ b/layout/generic/nsFrame.h  2010-06-22 17:13:33.000000000 +0300
@@ -151,7 +151,7 @@
   // Left undefined; nsFrame objects are never allocated from the heap.
   void* operator new(size_t sz) CPP_THROW_NEW;

-protected:
+public:
   // Overridden to prevent the global delete from being called, since
   // the memory came out of an arena instead of the heap.
   //

But if we don't apply the (2) patch, then the build fails with the error :
"
config.h -MD -MF .deps/nsBlockFrame.pp /home/abuild/rpmbuild/BUILD/mozilla-central/layout/generic/nsBlockFrame.cpp
/home/abuild/rpmbuild/BUILD/mozilla-central/layout/generic/nsBlockFrame.cpp:  In member function 'nsresult  nsBlockFrame::SplitFloat(nsBlockReflowState&, nsIFrame*,  nsReflowStatus)':
/home/abuild/rpmbuild/BUILD/mozilla-central/layout/generic/nsBlockFrame.cpp:3919:14: warning: unused variable 'rv'
/home/abuild/rpmbuild/BUILD/mozilla-central/layout/generic/nsFrame.h: In  member function 'virtual nsresult  nsBlockFrame::SetInitialChildList(nsIAtom*, nsFrameList&)':
/home/abuild/rpmbuild/BUILD/mozilla-central/layout/generic/nsFrame.h:165:8:  error: 'static void nsFrame::operator delete(void*, size_t)' is  protected
/home/abuild/rpmbuild/BUILD/mozilla-central/layout/generic/nsBlockFrame.cpp:6431:62: error: within this context
make[5]: *** [nsBlockFrame.o] Error 1
make[5]: Leaving directory `/home/abuild/rpmbuild/BUILD/release/layout/generic'
make[4]: *** [generic_libs] Error 2
make[4]: Leaving directory `/home/abuild/rpmbuild/BUILD/release/layout'
make[3]: *** [libs_tier_platform] Error 2
make[3]: Leaving directory `/home/abuild/rpmbuild/BUILD/release'
make[2]: *** [tier_platform] Error 2
make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/release'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/abuild/rpmbuild/BUILD/release'
make: *** [build] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.dgKeGv (%build)
"
The first patch looks fine, but I can't comment on the second... what compiler version are we talking about here?
(Reporter)

Comment 7

7 years ago
(In reply to comment #6)
> The first patch looks fine, but I can't comment on the second... what compiler
> version are we talking about here?

gcc-c++-4.5.0-4.8

More details on the compiler and versions of other libraries, please see the attached build log.
(Reporter)

Comment 8

7 years ago
(In reply to comment #4)
> this stuff compiling on N900, HArmattan, ... and I guess something wrong with
> meego headers...
> 
> could you try to compare harmattan and meego EGL headers? and find the
> difference?

Harmattan EGL headers:(opengles-sgx-img-common-dev)
gl.h:typedef int GLsizeiptr;

Meego EGL headers:(mesa-libEGL-devel)
gl.h:typedef khronos_ssize_t  GLsizeiptr;;
(Reporter)

Comment 9

7 years ago
Created attachment 476818 [details] [diff] [review]
Patch that fixes the problem

Please review this. If this is not proper, please fix this ASAP, as it is a blocker for fennec deliveries on Meego platform.
Attachment #476818 - Flags: review?(vladimir)
(Reporter)

Comment 10

7 years ago
(In reply to comment #6)
> The first patch looks fine, but I can't comment on the second... what compiler
> version are we talking about here?

If (2) is bad, doesn't that mean that (1) is not correct ?
(Reporter)

Updated

6 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Updated

6 years ago
Summary: Mozilla Central fails to build over Meego Platform(rpmbuild) for armel architecture → GLDefs.h GLsizeiptr, GLintptr gl types definition conflicts with khronos gl types
(Assignee)

Comment 11

6 years ago
Created attachment 537460 [details] [diff] [review]
don't typedef GLsizeintptr GLintptr if gl2.h included

http://www.khronos.org/registry/gles/api/2.0/gl2.h, defines 
/* GL types for handling large vertex buffer objects */
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t  GLsizeiptr;
Assignee: nobody → romaxa
Attachment #476818 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #537460 - Flags: review?(bjacob)
Attachment #476818 - Flags: review?(vladimir)
(Assignee)

Updated

6 years ago
Summary: GLDefs.h GLsizeiptr, GLintptr gl types definition conflicts with khronos gl types → [Meego] GLDefs.h GLsizeiptr, GLintptr gl types definition conflicts with khronos gl types
Comment on attachment 537460 [details] [diff] [review]
don't typedef GLsizeintptr GLintptr if gl2.h included

OK to push this change, but I'm not sure how safe the #ifndef __gl2_h_ check is (what if some platform uses a different include guard for that).

I think the much safer solution would be to use different names for the GL typedefs, e.g. local_GLintptr, just like we do for the constants (e.g. LOCAL_GL_TEXTURE).
Attachment #537460 - Flags: review?(bjacob) → review+
...or, why not put all that in namespace mozilla::gl.
(Assignee)

Comment 14

6 years ago
(In reply to comment #13)
> ...or, why not put all that in namespace mozilla::gl.

Then we need to change bunch of other things..., I would like to do it in separate bug.
(Assignee)

Comment 15

6 years ago
Ok, current version seems to build and works fine, Maemo/Android also good
http://tbpl.mozilla.org/?tree=Try&rev=7d6ca01aab56
Keywords: checkin-needed
(Assignee)

Comment 16

6 years ago
http://hg.mozilla.org/mozilla-central/rev/d076126a9325
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED

Comment 17

5 years ago
I am still facing this issue 
http://pastebin.com/NfTejaMt

Comment 18

5 years ago
I cloned mozilla latest and building for mer platform for Qt .
Maybe we need to namespace our types in namespace mozilla?

Comment 20

5 years ago
@Beniot: Requesting for a temporary work around as of now.
(Assignee)

Comment 21

5 years ago
Take patch from bug 779726, it practically isolates qgl includes out of GLDefs.h scope
You need to log in before you can comment on or make changes to this bug.