[Mesa-dev] [PATCH] gallium/dri-targets: hide all symbols except for __driDriverExtensions

Marek Olšák maraeo at gmail.com
Fri Aug 9 13:16:26 PDT 2013


Most importantly, this hides all LLVM symbols. They shouldn't clash
with a different LLVM version used by apps (at least in theory).

$ nm -g --defined-only radeonsi_dri.so
01148f30 D __driDriverExtensions

We could do something similar for the other targets.

v2: add the EXTRA_ prefix so as not to break automatic dependency tracking
---
 src/gallium/targets/dri-freedreno/Makefile.am | 5 ++++-
 src/gallium/targets/dri-i915/Makefile.am      | 5 ++++-
 src/gallium/targets/dri-ilo/Makefile.am       | 5 ++++-
 src/gallium/targets/dri-nouveau/Makefile.am   | 5 ++++-
 src/gallium/targets/dri-r300/Makefile.am      | 5 ++++-
 src/gallium/targets/dri-r600/Makefile.am      | 5 ++++-
 src/gallium/targets/dri-radeonsi/Makefile.am  | 5 ++++-
 src/gallium/targets/dri-swrast/Makefile.am    | 5 ++++-
 src/gallium/targets/dri-vmwgfx/Makefile.am    | 5 ++++-
 src/gallium/targets/dri.version               | 5 +++++
 10 files changed, 41 insertions(+), 9 deletions(-)
 create mode 100644 src/gallium/targets/dri.version

diff --git a/src/gallium/targets/dri-freedreno/Makefile.am b/src/gallium/targets/dri-freedreno/Makefile.am
index cfa1f37..effba8f 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -46,7 +46,10 @@ kgsl_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-kgsl_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+kgsl_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_kgsl_dri_la_DEPENDENCIES = ../dri.version
 
 kgsl_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-i915/Makefile.am b/src/gallium/targets/dri-i915/Makefile.am
index ce6be78..6d074c7 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -46,7 +46,10 @@ i915_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-i915_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+i915_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_i915_dri_la_DEPENDENCIES = ../dri.version
 
 i915_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am b/src/gallium/targets/dri-ilo/Makefile.am
index 7761f33..3d1959f 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -47,7 +47,10 @@ ilo_dri_la_SOURCES = \
 
 # need -rpath to create a noinst shared library
 ilo_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
-		     -rpath $(abs_builddir)
+		     -rpath $(abs_builddir) \
+		     -Wl,--version-script=../dri.version
+
+EXTRA_ilo_dri_la_DEPENDENCIES = ../dri.version
 
 ilo_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am b/src/gallium/targets/dri-nouveau/Makefile.am
index 69ccf32..3589e93 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -45,7 +45,10 @@ nouveau_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-nouveau_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+nouveau_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_nouveau_dri_la_DEPENDENCIES = ../dri.version
 
 nouveau_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-r300/Makefile.am b/src/gallium/targets/dri-r300/Makefile.am
index 8c0215d..7de5fa4 100644
--- a/src/gallium/targets/dri-r300/Makefile.am
+++ b/src/gallium/targets/dri-r300/Makefile.am
@@ -46,7 +46,10 @@ r300_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-r300_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+r300_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_r300_dri_la_DEPENDENCIES = ../dri.version
 
 r300_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-r600/Makefile.am b/src/gallium/targets/dri-r600/Makefile.am
index 2b3524b..c931ffe 100644
--- a/src/gallium/targets/dri-r600/Makefile.am
+++ b/src/gallium/targets/dri-r600/Makefile.am
@@ -45,7 +45,10 @@ r600_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-r600_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+r600_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_r600_dri_la_DEPENDENCIES = ../dri.version
 
 r600_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-radeonsi/Makefile.am b/src/gallium/targets/dri-radeonsi/Makefile.am
index f7d87a6..91812ea 100644
--- a/src/gallium/targets/dri-radeonsi/Makefile.am
+++ b/src/gallium/targets/dri-radeonsi/Makefile.am
@@ -46,7 +46,10 @@ radeonsi_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-radeonsi_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+radeonsi_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	 -Wl,--version-script=../dri.version
+
+EXTRA_radeonsi_dri_la_DEPENDENCIES = ../dri.version
 
 radeonsi_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-swrast/Makefile.am b/src/gallium/targets/dri-swrast/Makefile.am
index 1104379..6523568 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -46,7 +46,10 @@ swrast_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/drisw_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-swrast_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+swrast_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_swrast_dri_la_DEPENDENCIES = ../dri.version
 
 swrast_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri-vmwgfx/Makefile.am b/src/gallium/targets/dri-vmwgfx/Makefile.am
index ca7df65..4e914bf 100644
--- a/src/gallium/targets/dri-vmwgfx/Makefile.am
+++ b/src/gallium/targets/dri-vmwgfx/Makefile.am
@@ -45,7 +45,10 @@ vmwgfx_dri_la_SOURCES = \
 	$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \
 	$(top_srcdir)/src/mesa/drivers/dri/common/xmlconfig.c
 
-vmwgfx_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined
+vmwgfx_dri_la_LDFLAGS = -module -avoid-version -shared -no-undefined \
+	-Wl,--version-script=../dri.version
+
+EXTRA_vmwgfx_dri_la_DEPENDENCIES = ../dri.version
 
 vmwgfx_dri_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesagallium.la \
diff --git a/src/gallium/targets/dri.version b/src/gallium/targets/dri.version
new file mode 100644
index 0000000..d1038a2
--- /dev/null
+++ b/src/gallium/targets/dri.version
@@ -0,0 +1,5 @@
+{
+  global:
+    __driDriverExtensions;
+  local: *;
+};
-- 
1.8.1.2



More information about the mesa-dev mailing list