Open Bug 1240379 Opened 9 years ago Updated 2 years ago

firefox-44.0b* redefinition of 'class mozilla::gl::GLContextProviderEGL'

Categories

(Core :: Graphics: Layers, defect, P3)

defect

Tracking

()

People

(Reporter: anarchy, Unassigned)

Details

(Whiteboard: [gfx-noted])

In file included from <command-line>:0:0:
./../../mozilla-config.h:122:25: error: redefinition of 'class mozilla::gl::GLContextProviderEGL'
 #define MOZ_GL_PROVIDER GLContextProviderEGL
                         ^
/var/tmp/portage/www-client/firefox-44.0_beta4/work/firefox-44.0b4/gfx/gl/GLContextProvider.h:66:36: note: in expansion of macro 'MOZ_GL_PROVIDER'
   #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
                                    ^
/var/tmp/portage/www-client/firefox-44.0_beta4/work/firefox-44.0b4/gfx/gl/GLContextProviderImpl.h:17:7: note: in expansion of macro 'GL_CONTEXT_PROVIDER_NAME'
 class GL_CONTEXT_PROVIDER_NAME
       ^
In file included from /var/tmp/portage/www-client/firefox-44.0_beta4/work/firefox-44.0b4/gfx/gl/GLContext.cpp:21:0,
                 from /var/tmp/portage/www-client/firefox-44.0_beta4/work/firefox-44.0b4/ff/gfx/gl/Unified_cpp_gfx_gl0.cpp:47:
/var/tmp/portage/www-client/firefox-44.0_beta4/work/firefox-44.0b4/gfx/gl/GLContextProvider.h:49:34: error: previous definition of 'class mozilla::gl::GLContextProviderEGL'
 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
                                  ^
/var/tmp/portage/www-client/firefox-44.0_beta4/work/firefox-44.0b4/gfx/gl/GLContextProviderImpl.h:17:7: note: in expansion of macro 'GL_CONTEXT_PROVIDER_NAME'
 class GL_CONTEXT_PROVIDER_NAME
Seems to be introduced by http://hg.mozilla.org/mozilla-central/rev/0cecdec0f6e1

If MOZ_GL_PROVIDER is defined to GLContextProviderEGL, then GLContextProviderEGL is defined twice by the explicit GLContextProviderEGL case and by the MOZ_GL_PROVIDER case.

MOZ_GL_PROVIDER is set to GLContextProviderEGL by (ac_add_options) --with-gl-provider=EGL. Probably configure should prevent that from happening as EGL is default now anyway?
Whiteboard: [gfx-noted]
Inspecting the code, it looks like the EGL provider is always built but it's very rarely used (or at least, very rarely set as default) -- only on 'android' and 'gonk', it looks like.

The issue here is definitely that GLContextProviderImpl.h is being included twice with GL_CONTEXT_PROVIDER_NAME being set to GLContextProviderEGL , when MOZ_GL_PROVIDER is set to that.  Likewise this issue looks like it would occur if MOZ_GL_PROVIDER is set to GLContextProviderGLX or any of the others too, when they are default-enabled.

I can't say what the solution is to resolve this, though.  Ideally we only want MOZ_GL_PROVIDER to include the GLContextProviderImpl.h when it hasn't already been done, but since AFAIK there's no nice way to do string comparisons in preprocessor conditionals this would end up being a mess pretty quickly.

MOZ_GL_PROVIDER being set does still seem to be valid when wanting to force the default to be, say, EGL instead of GLX, too..  unfortunately i'm not seeing a simple solution here.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.