diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-01-03 09:40:38 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-01-07 16:07:01 +0100 |
commit | 12a3897e0d68b77b5f0b13615217908a6dc501aa (patch) | |
tree | 55c4a9619e5413386a6b9e26243c9ee9ed2d7b19 /patches/protobuf-all-3.6.1 | |
parent | 30b4132d3fbdda33e3b7cdf7289b48b5554399b6 (diff) | |
download | ptxdist-12a3897e0d68b77b5f0b13615217908a6dc501aa.tar.gz ptxdist-12a3897e0d68b77b5f0b13615217908a6dc501aa.tar.xz |
protobuf: add upstream patch to use -latomic when needed
This is needed to build protobuf on ARMv5 and PPC.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/protobuf-all-3.6.1')
-rw-r--r-- | patches/protobuf-all-3.6.1/0001-Link-to-libatomic-when-necessary-eg.-on-armv6l.patch | 58 | ||||
l--------- | patches/protobuf-all-3.6.1/autogen.sh | 1 | ||||
-rw-r--r-- | patches/protobuf-all-3.6.1/series | 4 |
3 files changed, 63 insertions, 0 deletions
diff --git a/patches/protobuf-all-3.6.1/0001-Link-to-libatomic-when-necessary-eg.-on-armv6l.patch b/patches/protobuf-all-3.6.1/0001-Link-to-libatomic-when-necessary-eg.-on-armv6l.patch new file mode 100644 index 000000000..4ac4a9a56 --- /dev/null +++ b/patches/protobuf-all-3.6.1/0001-Link-to-libatomic-when-necessary-eg.-on-armv6l.patch @@ -0,0 +1,58 @@ +From: Ben Wolsieffer <benwolsieffer@gmail.com> +Date: Thu, 4 Oct 2018 20:25:10 -0400 +Subject: [PATCH] Link to libatomic when necessary (eg. on armv6l) + +--- + configure.ac | 16 ++++++++++++++++ + src/Makefile.am | 4 ++-- + 2 files changed, 18 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7d6682764950..56bbef6009af 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -165,6 +165,22 @@ AS_IF([test "$with_zlib" != no], [ + ]) + AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1]) + ++dnl On some platforms, std::atomic needs a helper library ++AC_MSG_CHECKING(whether -latomic is needed) ++AC_LINK_IFELSE([AC_LANG_SOURCE([[ ++ #include <atomic> ++ #include <cstdint> ++ std::atomic<std::int64_t> v; ++ int main() { ++ return v; ++ } ++]])], STD_ATOMIC_NEED_LIBATOMIC=no, STD_ATOMIC_NEED_LIBATOMIC=yes) ++AC_MSG_RESULT($STD_ATOMIC_NEED_LIBATOMIC) ++if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then ++ LIBATOMIC_LIBS="-latomic" ++fi ++AC_SUBST([LIBATOMIC_LIBS]) ++ + AS_IF([test "$with_protoc" != "no"], [ + PROTOC=$with_protoc + AS_IF([test "$with_protoc" = "yes"], [ +diff --git a/src/Makefile.am b/src/Makefile.am +index 4bb77452f203..0a59b3147be8 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -163,7 +163,7 @@ nobase_include_HEADERS = \ + + lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la + +-libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) ++libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) + libprotobuf_lite_la_LDFLAGS = -version-info 17:0:0 -export-dynamic -no-undefined + if HAVE_LD_VERSION_SCRIPT + libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map +@@ -209,7 +209,7 @@ libprotobuf_lite_la_SOURCES = \ + google/protobuf/io/zero_copy_stream.cc \ + google/protobuf/io/zero_copy_stream_impl_lite.cc + +-libprotobuf_la_LIBADD = $(PTHREAD_LIBS) ++libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) + libprotobuf_la_LDFLAGS = -version-info 17:0:0 -export-dynamic -no-undefined + if HAVE_LD_VERSION_SCRIPT + libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map diff --git a/patches/protobuf-all-3.6.1/autogen.sh b/patches/protobuf-all-3.6.1/autogen.sh new file mode 120000 index 000000000..9f8a4cb7d --- /dev/null +++ b/patches/protobuf-all-3.6.1/autogen.sh @@ -0,0 +1 @@ +../autogen.sh
\ No newline at end of file diff --git a/patches/protobuf-all-3.6.1/series b/patches/protobuf-all-3.6.1/series new file mode 100644 index 000000000..b238a9cca --- /dev/null +++ b/patches/protobuf-all-3.6.1/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-Link-to-libatomic-when-necessary-eg.-on-armv6l.patch +# 9e36f76040f8c202ae5b588b48401b69 - git-ptx-patches magic |