Merge ~mir-team/protobuf/+git/protobuf-xenial:hide-unnecessary-symbols into ~mir-team/protobuf/+git/protobuf-xenial:bileto

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: d17cc50c0f821eaefe7aea211fbb13026cdd9b42
Merged at revision: 8549aee5102a7613ba0ab2b8262a9d6ea8aa3304
Proposed branch: ~mir-team/protobuf/+git/protobuf-xenial:hide-unnecessary-symbols
Merge into: ~mir-team/protobuf/+git/protobuf-xenial:bileto
Diff against target: 143 lines (+123/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/Hide-unnecessary-exported-library-symbols.patch (+114/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+320176@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 3d1951c..01d2515 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1protobuf (2.6.1-1.3ubuntu1) UNRELEASED; urgency=medium
2
3 * debian/patches/Hide-unnecessary-exported-library-symbols.patch:
4 - Backport upstream fix to hide unnecessary exported symbols
5 (LP: #1667352)
6
7 -- Alexandros Frantzis <alexandros.frantzis@canonical.com> Thu, 16 Mar 2017 14:06:01 +0200
8
1protobuf (2.6.1-1.3) unstable; urgency=medium9protobuf (2.6.1-1.3) unstable; urgency=medium
210
3 * Non-maintainer upload.11 * Non-maintainer upload.
diff --git a/debian/patches/Hide-unnecessary-exported-library-symbols.patch b/debian/patches/Hide-unnecessary-exported-library-symbols.patch
4new file mode 10064412new file mode 100644
index 0000000..49e9d17
--- /dev/null
+++ b/debian/patches/Hide-unnecessary-exported-library-symbols.patch
@@ -0,0 +1,114 @@
1Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/protobuf/+bug/1667352
2Origin: backport, https://github.com/google/protobuf/commit/c57c77b4b7b065a0f14c757f5b8983e136511067
3Author: Alexandros Frantzis <alexandros.frantzis@canonical.com>
4Description: Hide unnecessary exported library symbols
5
6--- a/configure.ac
7+++ b/configure.ac
8@@ -74,6 +74,25 @@ ACX_CHECK_SUNCC
9 # to the link
10 AC_PROG_LIBTOOL
11
12+# Check whether the linker supports version scripts
13+AC_MSG_CHECKING([whether the linker supports version scripts])
14+save_LDFLAGS=$LDFLAGS
15+LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
16+cat > conftest.map <<EOF
17+{
18+ global:
19+ main;
20+ local:
21+ *;
22+};
23+EOF
24+AC_LINK_IFELSE(
25+ [AC_LANG_SOURCE([int main() { return 0; }])],
26+ [have_ld_version_script=yes; AC_MSG_RESULT(yes)],
27+ [have_ld_version_script=no; AC_MSG_RESULT(no)])
28+LDFLAGS=$save_LDFLAGS
29+AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test "$have_ld_version_script" == "yes"])
30+
31 # Checks for header files.
32 AC_HEADER_STDC
33 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
34--- a/src/Makefile.am
35+++ b/src/Makefile.am
36@@ -97,6 +97,10 @@ lib_LTLIBRARIES = libprotobuf-lite.la li
37
38 libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
39 libprotobuf_lite_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
40+if HAVE_LD_VERSION_SCRIPT
41+libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
42+EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
43+endif
44 libprotobuf_lite_la_SOURCES = \
45 google/protobuf/stubs/atomicops_internals_x86_gcc.cc \
46 google/protobuf/stubs/atomicops_internals_x86_msvc.cc \
47@@ -119,6 +123,10 @@ libprotobuf_lite_la_SOURCES =
48
49 libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
50 libprotobuf_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
51+if HAVE_LD_VERSION_SCRIPT
52+libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
53+EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
54+endif
55 libprotobuf_la_SOURCES = \
56 $(libprotobuf_lite_la_SOURCES) \
57 google/protobuf/stubs/strutil.cc \
58@@ -148,6 +156,10 @@ libprotobuf_la_SOURCES =
59
60 libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
61 libprotoc_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
62+if HAVE_LD_VERSION_SCRIPT
63+libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
64+EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
65+endif
66 libprotoc_la_SOURCES = \
67 google/protobuf/compiler/code_generator.cc \
68 google/protobuf/compiler/command_line_interface.cc \
69@@ -259,6 +271,9 @@ EXTRA_DIST =
70 google/protobuf/io/package_info.h \
71 google/protobuf/compiler/package_info.h \
72 google/protobuf/compiler/zip_output_unittest.sh \
73+ libprotobuf-lite.map \
74+ libprotobuf.map \
75+ libprotoc.map \
76 google/protobuf/unittest_enormous_descriptor.proto
77
78 protoc_lite_outputs = \
79--- /dev/null
80+++ b/src/libprotobuf-lite.map
81@@ -0,0 +1,9 @@
82+{
83+ global:
84+ extern "C++" {
85+ *google*;
86+ };
87+
88+ local:
89+ *;
90+};
91--- /dev/null
92+++ b/src/libprotobuf.map
93@@ -0,0 +1,9 @@
94+{
95+ global:
96+ extern "C++" {
97+ *google*;
98+ };
99+
100+ local:
101+ *;
102+};
103--- /dev/null
104+++ b/src/libprotoc.map
105@@ -0,0 +1,9 @@
106+{
107+ global:
108+ extern "C++" {
109+ *google*;
110+ };
111+
112+ local:
113+ *;
114+};
diff --git a/debian/patches/series b/debian/patches/series
index 7bb8252..f4d82ca 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
1debian-changes1debian-changes
2Hide-unnecessary-exported-library-symbols.patch

Subscribers

People subscribed via source and target branches

to all changes: