egl: Do not export private symbols
authorChad Versace <chad.versace@linux.intel.com>
Thu, 1 Aug 2013 15:10:31 +0000 (08:10 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Thu, 8 Aug 2013 22:17:51 +0000 (15:17 -0700)
libEGL was incorrectly exporting *all* symbols, public and private.
This patch adds -fvisibility=hidden to libEGL's linker flags to ensure
that only symbols annotated with __attribute__((visibility("default")))
get exported.

Sanity-checked with libEGL's builtin DRI2 driver and the i965 DRI driver
by running Piglit on X/EGL and by running weston-gears on Weston as an
X client.

Sanity-checked with libEGL's Gallium driver (which is not built-in) and
the swrast Gallium driver by running es2gears_x11.

Kristian reviewed the symbol diff in `nm libEGL.so`.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: Ian Romanick <idr@freedesktop.org>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/egl/drivers/dri2/Makefile.am
src/egl/drivers/glx/Makefile.am
src/egl/main/Makefile.am
src/egl/wayland/wayland-drm/Makefile.am
src/egl/wayland/wayland-egl/Makefile.am

index 45f7dfa4b02d93bbf8f5259ed6befd8b2b0c6e68..823ef5e369ae379ff273f9e77f09d574a106ae38 100644 (file)
@@ -28,6 +28,7 @@ AM_CFLAGS = \
        -I$(top_srcdir)/src/egl/wayland/wayland-drm \
        -I$(top_builddir)/src/egl/wayland/wayland-drm \
        $(DEFINES) \
+       $(VISIBILITY_CFLAGS) \
        $(LIBDRM_CFLAGS) \
        $(LIBUDEV_CFLAGS) \
        $(LIBKMS_CFLAGS) \
index 6bf67eaebbe362a77c6b1c9cf8ff6322e713cdad..6db95b40cd4e9ee4220a10c1bf177acec6715861 100644 (file)
@@ -22,6 +22,7 @@
 AM_CFLAGS = \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/src/egl/main \
+       $(VISIBILITY_CFLAGS) \
        $(X11_CFLAGS) \
        $(DEFINES)
 
index 1cfdce26b563fdeea1f7a1984ac5d0649868b30b..2e438601544762cf807d6c24a219f9f95feb694f 100644 (file)
@@ -27,6 +27,7 @@ AM_CFLAGS = \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/src/gbm/main \
        $(DEFINES) \
+       $(VISIBILITY_CFLAGS) \
        $(EGL_CFLAGS) \
        -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
        -D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
index 4b2aeb32f2d2c783fe7e4b66c3878b139bca7135..08ee4974ec36ebef1551a685aeab19d377129a06 100644 (file)
@@ -1,6 +1,7 @@
 AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
            -I$(top_srcdir)/include \
            $(DEFINES) \
+           $(VISIBILITY_CFLAGS) \
            $(WAYLAND_CFLAGS) 
 
 noinst_LTLIBRARIES = libwayland-drm.la
index 7d20a1a2d9464cf08809b24fab4a2179b18192d2..138c170df4ed0f847a8529f7dbc81c5d98e41385 100644 (file)
@@ -2,6 +2,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = wayland-egl.pc
 
 AM_CFLAGS = $(DEFINES) \
+           $(VISIBILITY_CFLAGS) \
            $(WAYLAND_CFLAGS)
 
 lib_LTLIBRARIES = libwayland-egl.la