Bug#960822: autofdo: diff for NMU version 0.19-2.1
Control: tags 960822 + pending
Control: tags 974802 + patch
Control: tags 974802 + pending
Dear maintainer,
I've prepared an NMU for autofdo (versioned as 0.19-2.1) and
uploaded it to DELAYED/14. Please feel free to tell me if I
should cancel it.
cu
Adrian
diff -Nru autofdo-0.19/debian/changelog autofdo-0.19/debian/changelog
--- autofdo-0.19/debian/changelog 2019-10-28 12:28:07.000000000 +0200
+++ autofdo-0.19/debian/changelog 2021-10-07 15:13:26.000000000 +0300
@@ -1,3 +1,14 @@
+autofdo (0.19-2.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Use the default LLVM. (Closes: #974802)
+ * Backport upstream fix for FTBFS with LLVM 11.
+ * Use the system libprotobuf. (Closes: #960822)
+ * Remove vendored copies in dh_auto_clean,
+ fixes building twice in a row.
+
+ -- Adrian Bunk <bunk@debian.org> Thu, 07 Oct 2021 15:13:26 +0300
+
autofdo (0.19-2) unstable; urgency=medium
* Link with -latomic where needed.
diff -Nru autofdo-0.19/debian/control autofdo-0.19/debian/control
--- autofdo-0.19/debian/control 2019-10-27 21:52:39.000000000 +0200
+++ autofdo-0.19/debian/control 2021-10-07 15:13:26.000000000 +0300
@@ -7,7 +7,9 @@
libssl-dev, zlib1g-dev,
libgoogle-glog-dev, libgflags-dev,
libelf-dev,
- llvm-9-dev,
+ llvm-dev,
+ protobuf-compiler,
+ libprotobuf-dev,
Standards-Version: 4.4.1
Homepage: https://github.com/google/autofdo
diff -Nru autofdo-0.19/debian/patches/0001-Fix-build-error-for-LLVM11.patch autofdo-0.19/debian/patches/0001-Fix-build-error-for-LLVM11.patch
--- autofdo-0.19/debian/patches/0001-Fix-build-error-for-LLVM11.patch 1970-01-01 02:00:00.000000000 +0200
+++ autofdo-0.19/debian/patches/0001-Fix-build-error-for-LLVM11.patch 2021-10-07 15:13:26.000000000 +0300
@@ -0,0 +1,25 @@
+From 0603771d8a0f70c6c6223ae2bdd918f7508e1704 Mon Sep 17 00:00:00 2001
+From: Ruijie Fang <ruijief@princeton.edu>
+Date: Sun, 21 Jun 2020 00:04:42 -0400
+Subject: Fix build error for LLVM11
+
+---
+ llvm_profile_writer.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/llvm_profile_writer.cc b/llvm_profile_writer.cc
+index 1431e9f..3da7a1f 100644
+--- a/llvm_profile_writer.cc
++++ b/llvm_profile_writer.cc
+@@ -94,7 +94,7 @@ void LLVMProfileBuilder::VisitCallsite(const Callsite &callsite) {
+ inline_stack_.pop_back();
+ }
+ auto &caller_profile = *(inline_stack_.back());
+- auto CalleeName = GetNameRef(Symbol::Name(callsite.second));
++ auto CalleeName = GetNameRef(Symbol::Name(callsite.second)).str();
+ auto &callee_profile =
+ caller_profile.functionSamplesAt(llvm::sampleprof::LineLocation(
+ line, discriminator))[CalleeName];
+--
+2.20.1
+
diff -Nru autofdo-0.19/debian/patches/link-atomic.diff autofdo-0.19/debian/patches/link-atomic.diff
--- autofdo-0.19/debian/patches/link-atomic.diff 2019-10-28 12:28:07.000000000 +0200
+++ autofdo-0.19/debian/patches/link-atomic.diff 1970-01-01 02:00:00.000000000 +0200
@@ -1,30 +0,0 @@
---- a/third_party/protobuf/configure.ac
-+++ b/third_party/protobuf/configure.ac
-@@ -189,6 +189,16 @@ AM_CONDITIONAL([HAVE_PTHREAD], [test "x$
- # We still keep this for improving pbconfig.h for unsupported platforms.
- AC_CXX_STL_HASH
-
-+AC_MSG_CHECKING([whether linking wiht -latomic succeeds])
-+save_LIBS=$LIBS
-+LIBS="$LIBS -latomic"
-+AC_LINK_IFELSE(
-+ [AC_LANG_SOURCE([int main() { return 0; }])],
-+ [LIBATOMIC=-latomic; AC_MSG_RESULT(yes)],
-+ [LIBATOMIC=; AC_MSG_RESULT(no)])
-+AC_SUBST(LIBATOMIC)
-+LIBS=$save_LIBS
-+
- case "$target_os" in
- mingw* | cygwin* | win* | aix*)
- ;;
---- a/third_party/protobuf/src/Makefile.am
-+++ b/third_party/protobuf/src/Makefile.am
-@@ -211,7 +211,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)
- libprotobuf_la_LDFLAGS = -version-info 15:1:0 -export-dynamic -no-undefined
- if HAVE_LD_VERSION_SCRIPT
- libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
diff -Nru autofdo-0.19/debian/patches/link-protobuf.diff autofdo-0.19/debian/patches/link-protobuf.diff
--- autofdo-0.19/debian/patches/link-protobuf.diff 1970-01-01 02:00:00.000000000 +0200
+++ autofdo-0.19/debian/patches/link-protobuf.diff 2021-10-07 15:13:23.000000000 +0300
@@ -0,0 +1,36 @@
+--- autofdo-0.19.orig/Makefile.am
++++ autofdo-0.19/Makefile.am
+@@ -1,14 +1,14 @@
+ ## Process this file with automake to produce Makefile.in
+
+ PROTOBUF = third_party/protobuf
+-PROTOBUF_DEP = $(PROTOBUF)/src/.libs/libprotobuf.a
+-PROTOC = ./$(PROTOBUF)/src/protoc
++PROTOBUF_DEP = -lprotobuf
++PROTOC = protoc
+
+ $(PROTOBUF)/configure:
+ echo "[AUTOGEN] Preparing protobuf"
+ (cd $(PROTOBUF) ; autoreconf -f -i -Wall,no-obsolete)
+
+-$(PROTOC) $(PROTOBUF)/src/.libs/libprotobuf.a: $(PROTOBUF)/configure
++$(PROTOBUF)/src/.libs/libprotobuf.a: $(PROTOBUF)/configure
+ echo "[MAKE] Building protobuf"
+ (cd third_party/protobuf/; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g $(PROTOBUF_LDFLAGS_EXTRA)" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g $(PROTOBUF_CPPFLAGS_EXTRA)" ./configure --disable-shared --enable-static $(PROTOBUF_CONFIG_OPTS))
+ make -C $(PROTOBUF)
+@@ -23,12 +23,12 @@ protoc_outputs = \
+ third_party/perf_data_converter/src/quipper/perf_stat.pb.cc \
+ third_party/perf_data_converter/src/quipper/perf_stat.pb.h
+
+-$(protoc_outputs): $(protoc_inputs) $(PROTOC)
++$(protoc_outputs): $(protoc_inputs)
+ $(PROTOC) --cpp_out=`dirname $<` -I`dirname $<` $(protoc_inputs)
+
+ ACLOCAL_AMFLAGS = -I m4
+-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/third_party/perf_data_converter/src/quipper -I./$(PROTOBUF)/src
+-AM_CXXFLAGS = -std=gnu++11 -I./$(PROTOBUF)/src
++AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/third_party/perf_data_converter/src/quipper
++AM_CXXFLAGS = -std=gnu++11
+ LIBS += -lpthread
+ LIBELF = -lelf
+
diff -Nru autofdo-0.19/debian/patches/series autofdo-0.19/debian/patches/series
--- autofdo-0.19/debian/patches/series 2019-10-28 12:27:55.000000000 +0200
+++ autofdo-0.19/debian/patches/series 2021-10-07 15:13:26.000000000 +0300
@@ -1,4 +1,5 @@
link-libgflags.diff
link-libglog.diff
disable-rpath.diff
-link-atomic.diff
+link-protobuf.diff
+0001-Fix-build-error-for-LLVM11.patch
diff -Nru autofdo-0.19/debian/rules autofdo-0.19/debian/rules
--- autofdo-0.19/debian/rules 2019-10-27 21:16:11.000000000 +0200
+++ autofdo-0.19/debian/rules 2021-10-07 15:13:26.000000000 +0300
@@ -6,7 +6,8 @@
%:
dh $@ --with autoreconf
-override_dh_auto_configure:
+override_dh_auto_clean:
rm -rf gflags
rm -rf glog
- dh_auto_configure -- --with-llvm=/usr/bin/llvm-config-9
+ rm -rf third_party/protobuf
+ dh_auto_clean
Reply to: