[PATCH xorg-gtest] Add symbol version scripts

Chase Douglas chase.douglas at canonical.com
Sat Feb 4 12:05:23 PST 2012


It would be nice to explicitly list each class method, but there's no
documentation on how to do it, and everything I try fails. At least this
ensures we don't ship visible symbols that are really part of GTest.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 src/Makefile.am            |    8 ++++++--
 src/libxorg-gtest.ver      |   15 +++++++++++++++
 src/libxorg-gtest_main.ver |    7 +++++++
 3 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 src/libxorg-gtest.ver
 create mode 100644 src/libxorg-gtest_main.ver

diff --git a/src/Makefile.am b/src/Makefile.am
index d1b5995..176a7fd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,7 +26,11 @@ libxorg_gtest_main_la_CPPFLAGS = \
 	$(GTEST_CPPFLAGS) \
 	-DDUMMY_CONF_PATH="\"$(library_datadir)/dummy.conf\""
 
-libxorg_gtest_la_LDFLAGS = $(X11_LIBS)
-libxorg_gtest_main_la_LDFLAGS = $(X11_LIBS)
+libxorg_gtest_la_LDFLAGS = $(X11_LIBS) -Wl,--version-script=libxorg-gtest.ver
+libxorg_gtest_main_la_LDFLAGS = \
+	$(X11_LIBS) \
+	-Wl,--version-script=libxorg-gtest_main.ver
 
 AM_CXXFLAGS = -I$(top_srcdir)/include
+
+EXTRA_DIST = libxorg-gtest.ver libxorg-gtest_main.ver
diff --git a/src/libxorg-gtest.ver b/src/libxorg-gtest.ver
new file mode 100644
index 0000000..e66c83a
--- /dev/null
+++ b/src/libxorg-gtest.ver
@@ -0,0 +1,15 @@
+XORG_GTEST_1.0 {
+    global:
+        extern "C++" {
+            xorg::testing::*;
+            "typeinfo for xorg::testing::Environment";
+            "typeinfo for xorg::testing::Test";
+            "typeinfo name for xorg::testing::Environment";
+            "typeinfo name for xorg::testing::Test";
+            "vtable for xorg::testing::Environment";
+            "vtable for xorg::testing::Test";
+        };
+
+    local:
+        *;
+};
diff --git a/src/libxorg-gtest_main.ver b/src/libxorg-gtest_main.ver
new file mode 100644
index 0000000..001ce91
--- /dev/null
+++ b/src/libxorg-gtest_main.ver
@@ -0,0 +1,7 @@
+XORG_GTEST_1.0 {
+    global:
+        main;
+
+    local:
+        *;
+};
-- 
1.7.8.3



More information about the xorg-devel mailing list