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

Proposed by Alexandros Frantzis
Status: Needs review
Proposed branch: ~afrantzis/protobuf/+git/protobuf-xenial:hide-unnecessary-symbols
Merge into: ~afrantzis/protobuf/+git/protobuf-xenial:bileto
Diff against target: 882 lines (+763/-0)
15 files modified
.pc/Hide-unnecessary-exported-library-symbols.patch/.timestamp (+0/-0)
.pc/Hide-unnecessary-exported-library-symbols.patch/configure.ac (+159/-0)
.pc/Hide-unnecessary-exported-library-symbols.patch/src/Makefile.am (+419/-0)
.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf-lite.map (+0/-0)
.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf.map (+0/-0)
.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotoc.map (+0/-0)
.pc/applied-patches (+1/-0)
configure.ac (+19/-0)
debian/changelog (+8/-0)
debian/patches/Hide-unnecessary-exported-library-symbols.patch (+114/-0)
debian/patches/series (+1/-0)
src/Makefile.am (+15/-0)
src/libprotobuf-lite.map (+9/-0)
src/libprotobuf.map (+9/-0)
src/libprotoc.map (+9/-0)
Reviewer Review Type Date Requested Status
Alexandros Frantzis Pending
Review via email: mp+320146@code.launchpad.net
To post a comment you must log in.

Unmerged commits

2aad1e8... by Alexandros Frantzis

Hide-unnecessary-exported-library-symbols.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.pc/Hide-unnecessary-exported-library-symbols.patch/.timestamp b/.pc/Hide-unnecessary-exported-library-symbols.patch/.timestamp
0new file mode 1006440new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.pc/Hide-unnecessary-exported-library-symbols.patch/.timestamp
diff --git a/.pc/Hide-unnecessary-exported-library-symbols.patch/configure.ac b/.pc/Hide-unnecessary-exported-library-symbols.patch/configure.ac
1new file mode 1006441new file mode 100644
index 0000000..c07067c
--- /dev/null
+++ b/.pc/Hide-unnecessary-exported-library-symbols.patch/configure.ac
@@ -0,0 +1,159 @@
1## Process this file with autoconf to produce configure.
2## In general, the safest way to proceed is to run ./autogen.sh
3
4AC_PREREQ(2.59)
5
6# Note: If you change the version, you must also update it in:
7# * java/pom.xml
8# * python/setup.py
9# * src/google/protobuf/stubs/common.h
10# * src/Makefile.am (Update -version-info for LDFLAGS if needed)
11#
12# In the SVN trunk, the version should always be the next anticipated release
13# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
14# the size of one file name in the dist tarfile over the 99-char limit.)
15AC_INIT([Protocol Buffers],[2.6.1],[protobuf@googlegroups.com],[protobuf])
16
17AM_MAINTAINER_MODE([enable])
18
19AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
20AC_CONFIG_HEADERS([config.h])
21AC_CONFIG_MACRO_DIR([m4])
22
23# autoconf's default CXXFLAGS are usually "-g -O2". These aren't necessarily
24# the best choice for libprotobuf.
25AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
26 [CFLAGS=""])
27AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
28 [CXXFLAGS=""])
29
30AC_CANONICAL_TARGET
31
32AM_INIT_AUTOMAKE([subdir-objects])
33
34AC_ARG_WITH([zlib],
35 [AS_HELP_STRING([--with-zlib],
36 [include classes for streaming compressed data in and out @<:@default=check@:>@])],
37 [],[with_zlib=check])
38
39AC_ARG_WITH([protoc],
40 [AS_HELP_STRING([--with-protoc=COMMAND],
41 [use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])],
42 [],[with_protoc=no])
43
44# Checks for programs.
45AC_PROG_CC
46AC_PROG_CXX
47AC_LANG([C++])
48ACX_USE_SYSTEM_EXTENSIONS
49AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
50
51# test_util.cc takes forever to compile with GCC and optimization turned on.
52AC_MSG_CHECKING([C++ compiler flags...])
53AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
54 AS_IF([test "$GCC" = "yes"],[
55 PROTOBUF_OPT_FLAG="-O2"
56 CXXFLAGS="${CXXFLAGS} -g"
57 ])
58
59 # Protocol Buffers contains several checks that are intended to be used only
60 # for debugging and which might hurt performance. Most users are probably
61 # end users who don't want these checks, so add -DNDEBUG by default.
62 CXXFLAGS="$CXXFLAGS -DNDEBUG"
63
64 AC_MSG_RESULT([use default: $PROTOBUF_OPT_FLAG $CXXFLAGS])
65],[
66 AC_MSG_RESULT([use user-supplied: $CXXFLAGS])
67])
68
69AC_SUBST(PROTOBUF_OPT_FLAG)
70
71ACX_CHECK_SUNCC
72
73# Have to do libtool after SUNCC, other wise it "helpfully" adds Crun Cstd
74# to the link
75AC_PROG_LIBTOOL
76
77# Checks for header files.
78AC_HEADER_STDC
79AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
80
81# Checks for library functions.
82AC_FUNC_MEMCMP
83AC_FUNC_STRTOD
84AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
85
86# Check for zlib.
87HAVE_ZLIB=0
88AS_IF([test "$with_zlib" != no], [
89 AC_MSG_CHECKING([zlib version])
90
91 # First check the zlib header version.
92 AC_COMPILE_IFELSE(
93 [AC_LANG_PROGRAM([[
94 #include <zlib.h>
95 #if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204)
96 # error zlib version too old
97 #endif
98 ]], [])], [
99 AC_MSG_RESULT([ok (1.2.0.4 or later)])
100
101 # Also need to add -lz to the linker flags and make sure this succeeds.
102 AC_SEARCH_LIBS([zlibVersion], [z], [
103 AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
104 HAVE_ZLIB=1
105 ], [
106 AS_IF([test "$with_zlib" != check], [
107 AC_MSG_FAILURE([--with-zlib was given, but no working zlib library was found])
108 ])
109 ])
110 ], [
111 AS_IF([test "$with_zlib" = check], [
112 AC_MSG_RESULT([headers missing or too old (requires 1.2.0.4)])
113 ], [
114 AC_MSG_FAILURE([--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4)])
115 ])
116 ])
117])
118AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
119
120AS_IF([test "$with_protoc" != "no"], [
121 PROTOC=$with_protoc
122 AS_IF([test "$with_protoc" = "yes"], [
123 # No argument given. Use system protoc.
124 PROTOC=protoc
125 ])
126 AS_IF([echo "$PROTOC" | grep -q '^@<:@^/@:>@.*/'], [
127 # Does not start with a slash, but contains a slash. So, it's a relative
128 # path (as opposed to an absolute path or an executable in $PATH).
129 # Since it will actually be executed from the src directory, prefix with
130 # the current directory. We also insert $ac_top_build_prefix in case this
131 # is a nested package and --with-protoc was actually given on the outer
132 # package's configure script.
133 PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC
134 ])
135 AC_SUBST([PROTOC])
136])
137AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"])
138
139ACX_PTHREAD
140AC_CXX_STL_HASH
141
142case "$target_os" in
143 mingw* | cygwin* | win*)
144 ;;
145 *)
146 # Need to link against rt on Solaris
147 AC_SEARCH_LIBS([sched_yield], [rt], [], [AC_MSG_FAILURE([sched_yield was not found on your system])])
148 ;;
149esac
150
151# HACK: Make gtest's configure script pick up our copy of CFLAGS and CXXFLAGS,
152# since the flags added by ACX_CHECK_SUNCC must be used when compiling gtest
153# too.
154export CFLAGS
155export CXXFLAGS
156AC_CONFIG_SUBDIRS([gtest])
157
158AC_CONFIG_FILES([Makefile src/Makefile protobuf.pc protobuf-lite.pc])
159AC_OUTPUT
diff --git a/.pc/Hide-unnecessary-exported-library-symbols.patch/src/Makefile.am b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/Makefile.am
0new file mode 100644160new file mode 100644
index 0000000..2a11695
--- /dev/null
+++ b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/Makefile.am
@@ -0,0 +1,419 @@
1## Process this file with automake to produce Makefile.in
2
3if HAVE_ZLIB
4GZCHECKPROGRAMS = zcgzip zcgunzip
5GZHEADERS = google/protobuf/io/gzip_stream.h
6GZTESTS = google/protobuf/io/gzip_stream_unittest.sh
7else
8GZCHECKPROGRAMS =
9GZHEADERS =
10GZTESTS =
11endif
12
13if GCC
14# These are good warnings to turn on by default
15NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
16else
17NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS)
18endif
19
20AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG)
21
22AM_LDFLAGS = $(PTHREAD_CFLAGS)
23
24# If I say "dist_include_DATA", automake complains that $(includedir) is not
25# a "legitimate" directory for DATA. Screw you, automake.
26protodir = $(includedir)
27nobase_dist_proto_DATA = google/protobuf/descriptor.proto \
28 google/protobuf/compiler/plugin.proto
29
30# Not sure why these don't get cleaned automatically.
31clean-local:
32 rm -f *.loT
33
34CLEANFILES = $(protoc_outputs) unittest_proto_middleman \
35 testzip.jar testzip.list testzip.proto testzip.zip
36
37MAINTAINERCLEANFILES = \
38 Makefile.in
39
40nobase_include_HEADERS = \
41 google/protobuf/stubs/atomicops.h \
42 google/protobuf/stubs/atomicops_internals_arm64_gcc.h \
43 google/protobuf/stubs/atomicops_internals_arm_gcc.h \
44 google/protobuf/stubs/atomicops_internals_arm_qnx.h \
45 google/protobuf/stubs/atomicops_internals_atomicword_compat.h \
46 google/protobuf/stubs/atomicops_internals_generic_gcc.h \
47 google/protobuf/stubs/atomicops_internals_macosx.h \
48 google/protobuf/stubs/atomicops_internals_mips_gcc.h \
49 google/protobuf/stubs/atomicops_internals_pnacl.h \
50 google/protobuf/stubs/atomicops_internals_solaris.h \
51 google/protobuf/stubs/atomicops_internals_tsan.h \
52 google/protobuf/stubs/atomicops_internals_x86_gcc.h \
53 google/protobuf/stubs/atomicops_internals_x86_msvc.h \
54 google/protobuf/stubs/common.h \
55 google/protobuf/stubs/platform_macros.h \
56 google/protobuf/stubs/once.h \
57 google/protobuf/stubs/stl_util.h \
58 google/protobuf/stubs/template_util.h \
59 google/protobuf/stubs/type_traits.h \
60 google/protobuf/descriptor.h \
61 google/protobuf/descriptor.pb.h \
62 google/protobuf/descriptor_database.h \
63 google/protobuf/dynamic_message.h \
64 google/protobuf/extension_set.h \
65 google/protobuf/generated_enum_reflection.h \
66 google/protobuf/generated_message_util.h \
67 google/protobuf/generated_message_reflection.h \
68 google/protobuf/message.h \
69 google/protobuf/message_lite.h \
70 google/protobuf/reflection_ops.h \
71 google/protobuf/repeated_field.h \
72 google/protobuf/service.h \
73 google/protobuf/text_format.h \
74 google/protobuf/unknown_field_set.h \
75 google/protobuf/wire_format.h \
76 google/protobuf/wire_format_lite.h \
77 google/protobuf/wire_format_lite_inl.h \
78 google/protobuf/io/coded_stream.h \
79 $(GZHEADERS) \
80 google/protobuf/io/printer.h \
81 google/protobuf/io/strtod.h \
82 google/protobuf/io/tokenizer.h \
83 google/protobuf/io/zero_copy_stream.h \
84 google/protobuf/io/zero_copy_stream_impl.h \
85 google/protobuf/io/zero_copy_stream_impl_lite.h \
86 google/protobuf/compiler/code_generator.h \
87 google/protobuf/compiler/command_line_interface.h \
88 google/protobuf/compiler/importer.h \
89 google/protobuf/compiler/parser.h \
90 google/protobuf/compiler/plugin.h \
91 google/protobuf/compiler/plugin.pb.h \
92 google/protobuf/compiler/cpp/cpp_generator.h \
93 google/protobuf/compiler/java/java_generator.h \
94 google/protobuf/compiler/python/python_generator.h
95
96lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
97
98libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
99libprotobuf_lite_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
100libprotobuf_lite_la_SOURCES = \
101 google/protobuf/stubs/atomicops_internals_x86_gcc.cc \
102 google/protobuf/stubs/atomicops_internals_x86_msvc.cc \
103 google/protobuf/stubs/common.cc \
104 google/protobuf/stubs/once.cc \
105 google/protobuf/stubs/hash.h \
106 google/protobuf/stubs/map_util.h \
107 google/protobuf/stubs/shared_ptr.h \
108 google/protobuf/stubs/stringprintf.cc \
109 google/protobuf/stubs/stringprintf.h \
110 google/protobuf/extension_set.cc \
111 google/protobuf/generated_message_util.cc \
112 google/protobuf/message_lite.cc \
113 google/protobuf/repeated_field.cc \
114 google/protobuf/wire_format_lite.cc \
115 google/protobuf/io/coded_stream.cc \
116 google/protobuf/io/coded_stream_inl.h \
117 google/protobuf/io/zero_copy_stream.cc \
118 google/protobuf/io/zero_copy_stream_impl_lite.cc
119
120libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
121libprotobuf_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
122libprotobuf_la_SOURCES = \
123 $(libprotobuf_lite_la_SOURCES) \
124 google/protobuf/stubs/strutil.cc \
125 google/protobuf/stubs/strutil.h \
126 google/protobuf/stubs/substitute.cc \
127 google/protobuf/stubs/substitute.h \
128 google/protobuf/stubs/structurally_valid.cc \
129 google/protobuf/descriptor.cc \
130 google/protobuf/descriptor.pb.cc \
131 google/protobuf/descriptor_database.cc \
132 google/protobuf/dynamic_message.cc \
133 google/protobuf/extension_set_heavy.cc \
134 google/protobuf/generated_message_reflection.cc \
135 google/protobuf/message.cc \
136 google/protobuf/reflection_ops.cc \
137 google/protobuf/service.cc \
138 google/protobuf/text_format.cc \
139 google/protobuf/unknown_field_set.cc \
140 google/protobuf/wire_format.cc \
141 google/protobuf/io/gzip_stream.cc \
142 google/protobuf/io/printer.cc \
143 google/protobuf/io/strtod.cc \
144 google/protobuf/io/tokenizer.cc \
145 google/protobuf/io/zero_copy_stream_impl.cc \
146 google/protobuf/compiler/importer.cc \
147 google/protobuf/compiler/parser.cc
148
149libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
150libprotoc_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
151libprotoc_la_SOURCES = \
152 google/protobuf/compiler/code_generator.cc \
153 google/protobuf/compiler/command_line_interface.cc \
154 google/protobuf/compiler/plugin.cc \
155 google/protobuf/compiler/plugin.pb.cc \
156 google/protobuf/compiler/subprocess.cc \
157 google/protobuf/compiler/subprocess.h \
158 google/protobuf/compiler/zip_writer.cc \
159 google/protobuf/compiler/zip_writer.h \
160 google/protobuf/compiler/cpp/cpp_enum.cc \
161 google/protobuf/compiler/cpp/cpp_enum.h \
162 google/protobuf/compiler/cpp/cpp_enum_field.cc \
163 google/protobuf/compiler/cpp/cpp_enum_field.h \
164 google/protobuf/compiler/cpp/cpp_extension.cc \
165 google/protobuf/compiler/cpp/cpp_extension.h \
166 google/protobuf/compiler/cpp/cpp_field.cc \
167 google/protobuf/compiler/cpp/cpp_field.h \
168 google/protobuf/compiler/cpp/cpp_file.cc \
169 google/protobuf/compiler/cpp/cpp_file.h \
170 google/protobuf/compiler/cpp/cpp_generator.cc \
171 google/protobuf/compiler/cpp/cpp_helpers.cc \
172 google/protobuf/compiler/cpp/cpp_helpers.h \
173 google/protobuf/compiler/cpp/cpp_message.cc \
174 google/protobuf/compiler/cpp/cpp_message.h \
175 google/protobuf/compiler/cpp/cpp_message_field.cc \
176 google/protobuf/compiler/cpp/cpp_message_field.h \
177 google/protobuf/compiler/cpp/cpp_options.h \
178 google/protobuf/compiler/cpp/cpp_primitive_field.cc \
179 google/protobuf/compiler/cpp/cpp_primitive_field.h \
180 google/protobuf/compiler/cpp/cpp_service.cc \
181 google/protobuf/compiler/cpp/cpp_service.h \
182 google/protobuf/compiler/cpp/cpp_string_field.cc \
183 google/protobuf/compiler/cpp/cpp_string_field.h \
184 google/protobuf/compiler/java/java_context.cc \
185 google/protobuf/compiler/java/java_context.h \
186 google/protobuf/compiler/java/java_enum.cc \
187 google/protobuf/compiler/java/java_enum.h \
188 google/protobuf/compiler/java/java_enum_field.cc \
189 google/protobuf/compiler/java/java_enum_field.h \
190 google/protobuf/compiler/java/java_extension.cc \
191 google/protobuf/compiler/java/java_extension.h \
192 google/protobuf/compiler/java/java_field.cc \
193 google/protobuf/compiler/java/java_field.h \
194 google/protobuf/compiler/java/java_file.cc \
195 google/protobuf/compiler/java/java_file.h \
196 google/protobuf/compiler/java/java_generator.cc \
197 google/protobuf/compiler/java/java_generator_factory.cc \
198 google/protobuf/compiler/java/java_generator_factory.h \
199 google/protobuf/compiler/java/java_helpers.cc \
200 google/protobuf/compiler/java/java_helpers.h \
201 google/protobuf/compiler/java/java_lazy_message_field.cc \
202 google/protobuf/compiler/java/java_lazy_message_field.h \
203 google/protobuf/compiler/java/java_message.cc \
204 google/protobuf/compiler/java/java_message.h \
205 google/protobuf/compiler/java/java_message_field.cc \
206 google/protobuf/compiler/java/java_message_field.h \
207 google/protobuf/compiler/java/java_name_resolver.cc \
208 google/protobuf/compiler/java/java_name_resolver.h \
209 google/protobuf/compiler/java/java_primitive_field.cc \
210 google/protobuf/compiler/java/java_primitive_field.h \
211 google/protobuf/compiler/java/java_shared_code_generator.cc \
212 google/protobuf/compiler/java/java_shared_code_generator.h \
213 google/protobuf/compiler/java/java_service.cc \
214 google/protobuf/compiler/java/java_service.h \
215 google/protobuf/compiler/java/java_string_field.cc \
216 google/protobuf/compiler/java/java_string_field.h \
217 google/protobuf/compiler/java/java_doc_comment.cc \
218 google/protobuf/compiler/java/java_doc_comment.h \
219 google/protobuf/compiler/python/python_generator.cc
220
221bin_PROGRAMS = protoc
222protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
223protoc_SOURCES = google/protobuf/compiler/main.cc
224
225# Tests ==============================================================
226
227protoc_inputs = \
228 google/protobuf/unittest.proto \
229 google/protobuf/unittest_empty.proto \
230 google/protobuf/unittest_import.proto \
231 google/protobuf/unittest_import_public.proto \
232 google/protobuf/unittest_mset.proto \
233 google/protobuf/unittest_optimize_for.proto \
234 google/protobuf/unittest_embed_optimize_for.proto \
235 google/protobuf/unittest_custom_options.proto \
236 google/protobuf/unittest_lite.proto \
237 google/protobuf/unittest_import_lite.proto \
238 google/protobuf/unittest_import_public_lite.proto \
239 google/protobuf/unittest_lite_imports_nonlite.proto \
240 google/protobuf/unittest_no_generic_services.proto \
241 google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto
242
243EXTRA_DIST = \
244 $(protoc_inputs) \
245 solaris/libstdc++.la \
246 google/protobuf/io/gzip_stream.h \
247 google/protobuf/io/gzip_stream_unittest.sh \
248 google/protobuf/testdata/golden_message \
249 google/protobuf/testdata/golden_message_oneof_implemented \
250 google/protobuf/testdata/golden_packed_fields_message \
251 google/protobuf/testdata/bad_utf8_string \
252 google/protobuf/testdata/text_format_unittest_data.txt \
253 google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt \
254 google/protobuf/testdata/text_format_unittest_data_pointy.txt \
255 google/protobuf/testdata/text_format_unittest_data_pointy_oneof.txt \
256 google/protobuf/testdata/text_format_unittest_extensions_data.txt \
257 google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt \
258 google/protobuf/package_info.h \
259 google/protobuf/io/package_info.h \
260 google/protobuf/compiler/package_info.h \
261 google/protobuf/compiler/zip_output_unittest.sh \
262 google/protobuf/unittest_enormous_descriptor.proto
263
264protoc_lite_outputs = \
265 google/protobuf/unittest_lite.pb.cc \
266 google/protobuf/unittest_lite.pb.h \
267 google/protobuf/unittest_import_lite.pb.cc \
268 google/protobuf/unittest_import_lite.pb.h \
269 google/protobuf/unittest_import_public_lite.pb.cc \
270 google/protobuf/unittest_import_public_lite.pb.h
271
272protoc_outputs = \
273 $(protoc_lite_outputs) \
274 google/protobuf/unittest.pb.cc \
275 google/protobuf/unittest.pb.h \
276 google/protobuf/unittest_empty.pb.cc \
277 google/protobuf/unittest_empty.pb.h \
278 google/protobuf/unittest_import.pb.cc \
279 google/protobuf/unittest_import.pb.h \
280 google/protobuf/unittest_import_public.pb.cc \
281 google/protobuf/unittest_import_public.pb.h \
282 google/protobuf/unittest_mset.pb.cc \
283 google/protobuf/unittest_mset.pb.h \
284 google/protobuf/unittest_optimize_for.pb.cc \
285 google/protobuf/unittest_optimize_for.pb.h \
286 google/protobuf/unittest_embed_optimize_for.pb.cc \
287 google/protobuf/unittest_embed_optimize_for.pb.h \
288 google/protobuf/unittest_custom_options.pb.cc \
289 google/protobuf/unittest_custom_options.pb.h \
290 google/protobuf/unittest_lite_imports_nonlite.pb.cc \
291 google/protobuf/unittest_lite_imports_nonlite.pb.h \
292 google/protobuf/unittest_no_generic_services.pb.cc \
293 google/protobuf/unittest_no_generic_services.pb.h \
294 google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \
295 google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h
296
297BUILT_SOURCES = $(protoc_outputs)
298
299if USE_EXTERNAL_PROTOC
300
301unittest_proto_middleman: $(protoc_inputs)
302 $(PROTOC) -I$(srcdir) --cpp_out=. $^
303 touch unittest_proto_middleman
304
305else
306
307# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
308# relative to srcdir, which may not be the same as the current directory when
309# building out-of-tree.
310unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
311 oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) )
312 touch unittest_proto_middleman
313
314endif
315
316$(protoc_outputs): unittest_proto_middleman
317
318COMMON_TEST_SOURCES = \
319 google/protobuf/test_util.cc \
320 google/protobuf/test_util.h \
321 google/protobuf/testing/googletest.cc \
322 google/protobuf/testing/googletest.h \
323 google/protobuf/testing/file.cc \
324 google/protobuf/testing/file.h
325
326check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
327 protobuf-lite-test test_plugin $(GZCHECKPROGRAMS)
328protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
329 $(top_builddir)/gtest/lib/libgtest.la \
330 $(top_builddir)/gtest/lib/libgtest_main.la
331protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
332 -I$(top_builddir)/gtest/include
333# Disable optimization for tests unless the user explicitly asked for it,
334# since test_util.cc takes forever to compile with optimization (with GCC).
335# See configure.ac for more info.
336protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
337protobuf_test_SOURCES = \
338 google/protobuf/stubs/common_unittest.cc \
339 google/protobuf/stubs/once_unittest.cc \
340 google/protobuf/stubs/strutil_unittest.cc \
341 google/protobuf/stubs/structurally_valid_unittest.cc \
342 google/protobuf/stubs/stringprintf_unittest.cc \
343 google/protobuf/stubs/template_util_unittest.cc \
344 google/protobuf/stubs/type_traits_unittest.cc \
345 google/protobuf/descriptor_database_unittest.cc \
346 google/protobuf/descriptor_unittest.cc \
347 google/protobuf/dynamic_message_unittest.cc \
348 google/protobuf/extension_set_unittest.cc \
349 google/protobuf/generated_message_reflection_unittest.cc \
350 google/protobuf/message_unittest.cc \
351 google/protobuf/reflection_ops_unittest.cc \
352 google/protobuf/repeated_field_unittest.cc \
353 google/protobuf/repeated_field_reflection_unittest.cc \
354 google/protobuf/text_format_unittest.cc \
355 google/protobuf/unknown_field_set_unittest.cc \
356 google/protobuf/wire_format_unittest.cc \
357 google/protobuf/io/coded_stream_unittest.cc \
358 google/protobuf/io/printer_unittest.cc \
359 google/protobuf/io/tokenizer_unittest.cc \
360 google/protobuf/io/zero_copy_stream_unittest.cc \
361 google/protobuf/compiler/command_line_interface_unittest.cc \
362 google/protobuf/compiler/importer_unittest.cc \
363 google/protobuf/compiler/mock_code_generator.cc \
364 google/protobuf/compiler/mock_code_generator.h \
365 google/protobuf/compiler/parser_unittest.cc \
366 google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \
367 google/protobuf/compiler/cpp/cpp_unittest.h \
368 google/protobuf/compiler/cpp/cpp_unittest.cc \
369 google/protobuf/compiler/cpp/cpp_plugin_unittest.cc \
370 google/protobuf/compiler/java/java_plugin_unittest.cc \
371 google/protobuf/compiler/java/java_doc_comment_unittest.cc \
372 google/protobuf/compiler/python/python_plugin_unittest.cc \
373 $(COMMON_TEST_SOURCES)
374nodist_protobuf_test_SOURCES = $(protoc_outputs)
375
376# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
377protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
378 libprotoc.la \
379 $(top_builddir)/gtest/lib/libgtest.la \
380 $(top_builddir)/gtest/lib/libgtest_main.la
381protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
382 -I$(top_builddir)/gtest/include \
383 -DPROTOBUF_TEST_NO_DESCRIPTORS
384protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
385protobuf_lazy_descriptor_test_SOURCES = \
386 google/protobuf/compiler/cpp/cpp_unittest.cc \
387 $(COMMON_TEST_SOURCES)
388nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
389
390# Build lite_unittest separately, since it doesn't use gtest.
391protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la
392protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
393protobuf_lite_test_SOURCES = \
394 google/protobuf/lite_unittest.cc \
395 google/protobuf/test_util_lite.cc \
396 google/protobuf/test_util_lite.h
397nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs)
398
399# Test plugin binary.
400test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
401 $(top_builddir)/gtest/lib/libgtest.la
402test_plugin_CPPFLAGS = -I$(top_srcdir)/gtest/include \
403 -I$(top_builddir)/gtest/include
404test_plugin_SOURCES = \
405 google/protobuf/compiler/mock_code_generator.cc \
406 google/protobuf/testing/file.cc \
407 google/protobuf/testing/file.h \
408 google/protobuf/compiler/test_plugin.cc
409
410if HAVE_ZLIB
411zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
412zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc
413
414zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
415zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
416endif
417
418TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
419 google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)
diff --git a/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf-lite.map b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf-lite.map
0new file mode 100644420new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf-lite.map
diff --git a/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf.map b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf.map
1new file mode 100644421new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotobuf.map
diff --git a/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotoc.map b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotoc.map
2new file mode 100644422new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.pc/Hide-unnecessary-exported-library-symbols.patch/src/libprotoc.map
diff --git a/.pc/applied-patches b/.pc/applied-patches
index 7bb8252..f4d82ca 100644
--- a/.pc/applied-patches
+++ b/.pc/applied-patches
@@ -1 +1,2 @@
1debian-changes1debian-changes
2Hide-unnecessary-exported-library-symbols.patch
diff --git a/configure.ac b/configure.ac
index c07067c..353db7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,25 @@ ACX_CHECK_SUNCC
74# to the link74# to the link
75AC_PROG_LIBTOOL75AC_PROG_LIBTOOL
7676
77# Check whether the linker supports version scripts
78AC_MSG_CHECKING([whether the linker supports version scripts])
79save_LDFLAGS=$LDFLAGS
80LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
81cat > conftest.map <<EOF
82{
83 global:
84 main;
85 local:
86 *;
87};
88EOF
89AC_LINK_IFELSE(
90 [AC_LANG_SOURCE([int main() { return 0; }])],
91 [have_ld_version_script=yes; AC_MSG_RESULT(yes)],
92 [have_ld_version_script=no; AC_MSG_RESULT(no)])
93LDFLAGS=$save_LDFLAGS
94AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test "$have_ld_version_script" == "yes"])
95
77# Checks for header files.96# Checks for header files.
78AC_HEADER_STDC97AC_HEADER_STDC
79AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])98AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
diff --git a/debian/changelog b/debian/changelog
index 3d1951c..039598b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1protobuf (2.6.1-1.3ubuntu1) xenial; 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
diff --git a/src/Makefile.am b/src/Makefile.am
index 2a11695..c8d200d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -97,6 +97,10 @@ lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
9797
98libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)98libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
99libprotobuf_lite_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined99libprotobuf_lite_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
100if HAVE_LD_VERSION_SCRIPT
101libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
102EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
103endif
100libprotobuf_lite_la_SOURCES = \104libprotobuf_lite_la_SOURCES = \
101 google/protobuf/stubs/atomicops_internals_x86_gcc.cc \105 google/protobuf/stubs/atomicops_internals_x86_gcc.cc \
102 google/protobuf/stubs/atomicops_internals_x86_msvc.cc \106 google/protobuf/stubs/atomicops_internals_x86_msvc.cc \
@@ -119,6 +123,10 @@ libprotobuf_lite_la_SOURCES = \
119123
120libprotobuf_la_LIBADD = $(PTHREAD_LIBS)124libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
121libprotobuf_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined125libprotobuf_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
126if HAVE_LD_VERSION_SCRIPT
127libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
128EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
129endif
122libprotobuf_la_SOURCES = \130libprotobuf_la_SOURCES = \
123 $(libprotobuf_lite_la_SOURCES) \131 $(libprotobuf_lite_la_SOURCES) \
124 google/protobuf/stubs/strutil.cc \132 google/protobuf/stubs/strutil.cc \
@@ -148,6 +156,10 @@ libprotobuf_la_SOURCES = \
148156
149libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la157libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
150libprotoc_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined158libprotoc_la_LDFLAGS = -version-info 9:1:0 -export-dynamic -no-undefined
159if HAVE_LD_VERSION_SCRIPT
160libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
161EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
162endif
151libprotoc_la_SOURCES = \163libprotoc_la_SOURCES = \
152 google/protobuf/compiler/code_generator.cc \164 google/protobuf/compiler/code_generator.cc \
153 google/protobuf/compiler/command_line_interface.cc \165 google/protobuf/compiler/command_line_interface.cc \
@@ -259,6 +271,9 @@ EXTRA_DIST = \
259 google/protobuf/io/package_info.h \271 google/protobuf/io/package_info.h \
260 google/protobuf/compiler/package_info.h \272 google/protobuf/compiler/package_info.h \
261 google/protobuf/compiler/zip_output_unittest.sh \273 google/protobuf/compiler/zip_output_unittest.sh \
274 libprotobuf-lite.map \
275 libprotobuf.map \
276 libprotoc.map \
262 google/protobuf/unittest_enormous_descriptor.proto277 google/protobuf/unittest_enormous_descriptor.proto
263278
264protoc_lite_outputs = \279protoc_lite_outputs = \
diff --git a/src/libprotobuf-lite.map b/src/libprotobuf-lite.map
265new file mode 100644280new file mode 100644
index 0000000..3915546
--- /dev/null
+++ b/src/libprotobuf-lite.map
@@ -0,0 +1,9 @@
1{
2 global:
3 extern "C++" {
4 *google*;
5 };
6
7 local:
8 *;
9};
diff --git a/src/libprotobuf.map b/src/libprotobuf.map
0new file mode 10064410new file mode 100644
index 0000000..3915546
--- /dev/null
+++ b/src/libprotobuf.map
@@ -0,0 +1,9 @@
1{
2 global:
3 extern "C++" {
4 *google*;
5 };
6
7 local:
8 *;
9};
diff --git a/src/libprotoc.map b/src/libprotoc.map
0new file mode 10064410new file mode 100644
index 0000000..3915546
--- /dev/null
+++ b/src/libprotoc.map
@@ -0,0 +1,9 @@
1{
2 global:
3 extern "C++" {
4 *google*;
5 };
6
7 local:
8 *;
9};

Subscribers

People subscribed via source and target branches

to all changes: