Skip to content

Inconsistent ABIs depending on backend GLEW uses #430

Description

@jengelh

The ABI of libGLEW.so.2.2 changes between GLEW_EGL=ON and OFF:

22:04 a4:../glew/glew-2.2.0 $ cd build/cmake/
22:04 a4:../build/cmake $ cmake .
CMake Warning (dev) at CMakeLists.txt:5 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 15.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:415 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib64/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:43 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: ~/build/cmake
~ = for brevity

22:05 a4:../build/cmake $ make -j32
[ 12%] Building C object CMakeFiles/glew_s.dir~/src/glew.c.o
[ 25%] Building C object CMakeFiles/glew.dir~/src/glew.c.o
[ 37%] Linking C static library lib/libGLEW.a
[ 37%] Built target glew_s
[ 50%] Linking C shared library lib/libGLEW.so
[ 50%] Built target glew
[ 62%] Building C object CMakeFiles/glewinfo.dir~/src/glewinfo.c.o
[ 75%] Building C object CMakeFiles/visualinfo.dir~/src/visualinfo.c.o
[ 87%] Linking C executable bin/visualinfo
[ 87%] Built target visualinfo
[100%] Linking C executable bin/glewinfo
[100%] Built target glewinfo
22:05 a4:../build/cmake $ nm -D lib/libGLEW.so | grep SGIX_fbconfig
00000000000bf04d B __GLXEW_SGIX_fbconfig
22:05 a4:../build/cmake $ cmake . -DGLEW_EGL=ON
CMake Warning (dev) at CMakeLists.txt:5 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:415 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib64/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:43 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: ~/build/cmake
22:05 a4:../build/cmake $ make -j32
[ 12%] Building C object CMakeFiles/glew_s.dir~/src/glew.c.o
[ 25%] Building C object CMakeFiles/glew.dir~/src/glew.c.o
In file included from ~/src/glew.c:43:
~/build/cmake/../../include/GL/eglew.h:2649:80: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2649 | typedef EGLBoolean ( * PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                ^~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2650:80: warning: ‘struct wl_resource’ declared inside parameter list will not be visible outside of this definition or declaration
 2650 | typedef EGLBoolean ( * PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource* buffer, EGLint attribute, EGLint* value);
      |                                                                                ^~~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2651:82: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2651 | typedef EGLBoolean ( * PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                  ^~~~~~~~~~
In file included from ~/src/glew.c:43:
~/build/cmake/../../include/GL/eglew.h:2649:80: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2649 | typedef EGLBoolean ( * PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                ^~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2650:80: warning: ‘struct wl_resource’ declared inside parameter list will not be visible outside of this definition or declaration
 2650 | typedef EGLBoolean ( * PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource* buffer, EGLint attribute, EGLint* value);
      |                                                                                ^~~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2651:82: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2651 | typedef EGLBoolean ( * PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                  ^~~~~~~~~~
[ 37%] Linking C static library lib/libGLEW.a
[ 37%] Built target glew_s
[ 50%] Linking C shared library lib/libGLEW.so
[ 50%] Built target glew
[ 62%] Building C object CMakeFiles/glewinfo.dir~/src/glewinfo.c.o
[ 75%] Building C object CMakeFiles/visualinfo.dir~/src/visualinfo.c.o
In file included from ~/src/visualinfo.c:41:
~/build/cmake/../../include/GL/eglew.h:2649:80: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2649 | typedef EGLBoolean ( * PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                ^~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2650:80: warning: ‘struct wl_resource’ declared inside parameter list will not be visible outside of this definition or declaration
 2650 | typedef EGLBoolean ( * PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource* buffer, EGLint attribute, EGLint* value);
      |                                                                                ^~~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2651:82: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2651 | typedef EGLBoolean ( * PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                  ^~~~~~~~~~
In file included from ~/src/glewinfo.c:38:
~/build/cmake/../../include/GL/eglew.h:2649:80: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2649 | typedef EGLBoolean ( * PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                ^~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2650:80: warning: ‘struct wl_resource’ declared inside parameter list will not be visible outside of this definition or declaration
 2650 | typedef EGLBoolean ( * PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource* buffer, EGLint attribute, EGLint* value);
      |                                                                                ^~~~~~~~~~~
~/build/cmake/../../include/GL/eglew.h:2651:82: warning: ‘struct wl_display’ declared inside parameter list will not be visible outside of this definition or declaration
 2651 | typedef EGLBoolean ( * PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display* display);
      |                                                                                  ^~~~~~~~~~
[ 87%] Linking C executable bin/visualinfo
[ 87%] Built target visualinfo
[100%] Linking C executable bin/glewinfo
[100%] Built target glewinfo
22:05 a4:../build/cmake $ nm -D lib/libGLEW.so | grep SGIX_fbconfig

This is problematic because programs previously built no longer startup:

openscad: symbol lookup error: openscad: undefined symbol: __GLXEW_SGIX_fbconfig

Remedy: if it the ABI change is unavoidable, consider changing the filename produced by make/cmake to something else, e.g. libGLEW-egl.so.2.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions