Hello community,

here is the log from the commit of package bcc for openSUSE:Factory checked in 
at 2017-11-10 14:57:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bcc (Old)
 and      /work/SRC/openSUSE:Factory/.bcc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bcc"

Fri Nov 10 14:57:14 2017 rev:8 rq:540143 version:0.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/bcc/bcc.changes  2017-08-18 15:06:44.158448318 
+0200
+++ /work/SRC/openSUSE:Factory/.bcc.new/bcc.changes     2017-11-10 
14:57:30.935821666 +0100
@@ -1,0 +2,55 @@
+Thu Nov  9 06:56:39 UTC 2017 - [email protected]
+
+- Update to 0.4.0
+  + Fix helper to access stack pointer for powerpc
+  + bpf: rename helper function bpf_get_stackid
+  + bpf: print out the src debug info to a temporary file
+  + attempt to compile with system bpf.h if default compile failed
+  + sync src/cc/compat/linux headers with latest net-next
+  + Fix segfault with enumerations
+  + Allow BCC to parse vDSO symbols
+  + libbpf: print error to error stream
+  + Avoid potential SEGFAULT when resolving Kernel symbols
+  + Fix 'tools/statsnoop' from failing to attach kprobes
+  + Update USDT argument constraint for powerpc and powerpc64
+  + examples:dns_matching: make it work as DNS sniffer
+  + add debug option to dump asm insns embedded with source
+  + examples:dns_matching: helper function for adding cache entry
+  + Traces external pointers in parenthesized expressions
+  + examples:dns_matching: fixed loop break condition
+  + Fix bcc_resolve_global_addr on shared libraries
+  + BCC macro for the creation of LPM trie maps (#1359)
+  + bpf_probe_read*: src argument should be const void *.
+  + hardirqs, softirqs: Fix distribution mode units handling
+  + Add a generic utility to check any binary availability
+  + Fix 'test_debuginfo' from failing if a symbol has multiple
+    aliases
+  + nfsdist tool (#1347)
+  + annotate program tag
+  + add helpers to access program tag
+  + examples: fixed http_filter example
+  + nfsslower: trace slow NFS operations
+  + Update after lookup in map.increment for HASH types
+  + fix a bug introduced by previous lua-bcc build fix commit
+  + Better check for compiler standard support
+  + fix lua-bcc build issue with cmake try_compile
+  + Fix segfault on incomplete types
+  + Trace external pointers from helpers
+  + Allow the flags to be specified in remove_xdp()
+  + bcc-lua: --no-pie, not -no-pie
+  + solisten, tcpconnlat, tcpretrans: Remove unnecessary
+    bpf_probe_reads
+- Add the new subpackage libbpf0
+- Add bcc-bsc1065593-llvm4-hack.patch to work around the llvm
+  libraries searching issue (bsc#1065593)
+  (Also add clang4-devel-static to BuildRequires)
+- Add bcc-bsc1065593-switch-to-mcjit.patch to switch from OrcJIT
+  to MCJIT. OrcJIT actually doesn't work for bcc, and the bug was
+  covered until we start to use the unified LLVM shared library.
+  (bsc#1065593)
+- Add bcc-add-soname-to-libbpf.patch to install the shared library
+         properly
+- Update the group of packages
+- Disable USDT for ARM and AArch64 since it's not ready.
+
+-------------------------------------------------------------------

Old:
----
  bcc-v0.3.0+git1502955391.9de830a.tar.xz

New:
----
  bcc-add-soname-to-libbpf.patch
  bcc-bsc1065593-llvm4-hack.patch
  bcc-bsc1065593-switch-to-mcjit.patch
  v0.4.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bcc.spec ++++++
--- /var/tmp/diff_new_pack.IsIe2h/_old  2017-11-10 14:57:32.435767413 +0100
+++ /var/tmp/diff_new_pack.IsIe2h/_new  2017-11-10 14:57:32.435767413 +0100
@@ -16,7 +16,7 @@
 #
 
 
-%define libversion 0.3.0
+%define libversion 0.4.0
 %ifarch ppc64 aarch64 ppc64le
 %{!?with_lua: %global with_lua 0}
 %else
@@ -24,14 +24,17 @@
 %endif
 
 Name:           bcc
-Version:        0.3.0+git1502955391.9de830a
+Version:        0.4.0
 Release:        0
 Summary:        BPF Compiler Collection (BCC)
 License:        Apache-2.0
-Group:          Development/Languages
+Group:          Development/Tools/Other
 Url:            https://github.com/iovisor/bcc
-Source:         %{name}-v%{version}.tar.xz
-Patch2:         armv7.patch
+Source:         https://github.com/iovisor/bcc/archive/v%{version}.tar.gz
+Patch1:         armv7.patch
+Patch2:         %{name}-bsc1065593-llvm4-hack.patch
+Patch3:         %{name}-bsc1065593-switch-to-mcjit.patch
+Patch4:         %{name}-add-soname-to-libbpf.patch
 ExclusiveArch:  armv7hl aarch64 x86_64 ppc64 ppc64le
 BuildRequires:  bison
 BuildRequires:  cmake >= 2.8.7
@@ -41,6 +44,8 @@
 BuildRequires:  llvm-clang-devel >= 3.7.0
 BuildRequires:  llvm-devel >= 3.7.0
 %if 0%{?suse_version} > 1320
+# bsc#1065593 Some static clang libraries are needed
+BuildRequires:  clang4-devel-static
 BuildRequires:  llvm-gold
 %if %{with_lua}
 BuildRequires:  lua51-luajit-devel
@@ -70,9 +75,16 @@
 %description -n libbcc0
 Shared Library for BPF Compiler Collection (BCC)
 
+%package -n libbpf0
+Summary:        Standalone eBPF library
+Group:          System/Libraries
+
+%description -n libbpf0
+A standalone library to load eBPF programs
+
 %package devel
 Summary:        BPF Compiler Collection (BCC) (devel package)
-Group:          Development/Languages
+Group:          Development/Languages/C and C++
 Requires:       libbcc0 = %{version}
 
 %description devel
@@ -80,7 +92,7 @@
 
 %package -n python-bcc
 Summary:        Python bindings for BPF Compiler Collection
-Group:          Development/Languages
+Group:          Development/Languages/Python
 Requires:       kernel >= 4.1.0
 Requires:       kernel-devel >= 4.1.0
 Requires:       libbcc0 = %{version}
@@ -90,7 +102,7 @@
 
 %package -n python3-bcc
 Summary:        Python3 bindings for BPF Compiler Collection
-Group:          Development/Languages
+Group:          Development/Languages/Python
 Requires:       kernel >= 4.1.0
 Requires:       kernel-devel >= 4.1.0
 Requires:       libbcc0 = %{version}
@@ -101,7 +113,7 @@
 %if %{with_lua}
 %package lua
 Summary:        Lua interpreter for BPF Compiler Collection
-Group:          Development/Languages
+Group:          Development/Languages/Other
 Requires:       kernel >= 4.1.0
 Requires:       kernel-devel >= 4.1.0
 Requires:       libbcc0 = %{version}
@@ -112,7 +124,7 @@
 
 %package examples
 Summary:        Examples for BPF Compiler Collection (BCC)
-Group:          Development/Languages
+Group:          Development/Sources
 Requires:       python-bcc = %{version}
 Requires:       python-future
 Recommends:     python-pyroute2
@@ -124,7 +136,7 @@
 
 %package tools
 Summary:        Tracing tools of BPF Compiler Collection (BCC)
-Group:          Development/Languages
+Group:          System/Monitoring
 Requires:       python-bcc = %{version}
 Requires:       python-future
 
@@ -133,18 +145,24 @@
 
 %package docs
 Summary:        BPF Compiler Collection (BCC) documentation
-Group:          Development/Languages
+Group:          Documentation/Other
 
 %description docs
 The documentation of how to write programs with BPF Compiler Collection (BCC)
 
 
 %prep
-%setup -D -n %{name}-v%{version}
+%setup -D -n %{name}-%{version}
+%patch1 -p1
+%if 0%{?suse_version} > 1320
 %patch2 -p1
+%endif
+%patch3 -p1
+%patch4 -p1
 
 %build
-# Prevent the cpp examples from installation
+# Prevent the cpp examples from compilation and installation
+# Those programs are statically linked and huge in binary size.
 sed -i "/add_subdirectory(cpp)/d" examples/CMakeLists.txt
 
 export LD_LIBRARY_PATH="%{_builddir}/usr/lib64"
@@ -160,8 +178,13 @@
        -DLUAJIT_INCLUDE_DIR=`pkg-config --variable=includedir luajit` \
        -DLUAJIT_LIBRARY=%{_libdir}/lib`pkg-config --variable=libname 
luajit`.so \
 %endif
+%ifarch aarch64 || %arm
+       -DENABLE_USDT=OFF \
+%endif
        ..
-make %{?_smp_mflags} VERBOSE=1
+# Remove %{?_smp_mflags} since linking static libraries consumes lots of RAM.
+# Don't add it back unless we can get rid of clang4-devel-static
+make VERBOSE=1
 popd
 
 %install
@@ -179,8 +202,13 @@
 
 %postun -n libbcc0 -p /sbin/ldconfig
 
+%post -n libbpf0 -p /sbin/ldconfig
+
+%postun -n libbpf0 -p /sbin/ldconfig
+
 %files -n bcc-devel
 %{_libdir}/libbcc.so
+%{_libdir}/libbpf.so
 %dir %{_includedir}/bcc/
 %{_includedir}/bcc/*
 %{_libdir}/pkgconfig/libbcc.pc
@@ -189,6 +217,10 @@
 %doc LICENSE.txt COPYRIGHT.txt
 %{_libdir}/libbcc.so.*
 
+%files -n libbpf0
+%doc LICENSE.txt COPYRIGHT.txt
+%{_libdir}/libbpf.so.*
+
 %files -n python-bcc
 %{python_sitelib}/bcc*
 

++++++ bcc-add-soname-to-libbpf.patch ++++++
>From f609af256b79da788f19a8193d471dcd6ea98348 Mon Sep 17 00:00:00 2001
From: Rafael Fonseca <[email protected]>
Date: Tue, 31 Oct 2017 17:20:37 +0100
Subject: [PATCH] Add soname to libbpf.so

---
 src/cc/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
index c31936e..b552f45 100644
--- a/src/cc/CMakeLists.txt
+++ b/src/cc/CMakeLists.txt
@@ -25,6 +25,7 @@ include(static_libstdc++)
 add_library(bpf-static STATIC libbpf.c perf_reader.c)
 set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bpf)
 add_library(bpf-shared SHARED libbpf.c perf_reader.c)
+set_target_properties(bpf-shared PROPERTIES VERSION ${REVISION_LAST} SOVERSION 
0)
 set_target_properties(bpf-shared PROPERTIES OUTPUT_NAME bpf)
 
 set(bcc_common_sources bpf_common.cc bpf_module.cc exported_files.cc)
-- 
2.14.3

++++++ bcc-bsc1065593-llvm4-hack.patch ++++++
diff --git a/cmake/clang_libs.cmake b/cmake/clang_libs.cmake
index fcccf2b..a699a48 100644
--- a/cmake/clang_libs.cmake
+++ b/cmake/clang_libs.cmake
@@ -11,8 +11,9 @@ endif()
 if (${LLVM_PACKAGE_VERSION} VERSION_GREATER "5")
   list(APPEND llvm_raw_libs bpfdisassembler)
 endif()
-llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs})
-llvm_expand_dependencies(llvm_libs ${_llvm_libs})
+#llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs})
+#llvm_expand_dependencies(llvm_libs ${_llvm_libs})
+set(llvm_libs LLVM)
 
 # order is important
 set(clang_libs
++++++ bcc-bsc1065593-switch-to-mcjit.patch ++++++
>From 4456d510d4d6da07d11314bce0a0b5b3f078f268 Mon Sep 17 00:00:00 2001
From: Gary Lin <[email protected]>
Date: Thu, 9 Nov 2017 11:52:45 +0800
Subject: [PATCH] bpf: use MCJIT explicitly for ExecutionEngine

When BPFModule finalized the module, it set UseOrcMCJITReplacement to
true to use OrcJIT for ExecutionEngine. However, this never worked.
First, in clang_libs.cmake, mcjit is in the library list instead of
orcjit, so ExecutionEngine always fell back to MCJIT.
Second, even if OrcJIT was linked correctly, it actually broke bcc.
For OrcJIT, finalizeObject() is just an empty function. The code
generation is delayed till getPointerToFunction() or runFunction(), so
the current implementation of BPFModule won't work for OrcJIT.

This bug was covered when using the separate LLVM share libraries. If
the system builds LLVM into an unified share library, then OrcJIT will
be used and bcc would fail to generate BPF bytecodes without any
warning.

Signed-off-by: Gary Lin <[email protected]>
---
 src/cc/bpf_module.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
index cf1b09e..7f5e560 100644
--- a/src/cc/bpf_module.cc
+++ b/src/cc/bpf_module.cc
@@ -455,7 +455,7 @@ unique_ptr<ExecutionEngine> 
BPFModule::finalize_rw(unique_ptr<Module> m) {
   string err;
   EngineBuilder builder(move(m));
   builder.setErrorStr(&err);
-  builder.setUseOrcMCJITReplacement(true);
+  builder.setUseOrcMCJITReplacement(false);
   auto engine = unique_ptr<ExecutionEngine>(builder.create());
   if (!engine)
     fprintf(stderr, "Could not create ExecutionEngine: %s\n", err.c_str());
@@ -596,7 +596,7 @@ int BPFModule::finalize() {
   builder.setErrorStr(&err);
   
builder.setMCJITMemoryManager(ebpf::make_unique<MyMemoryManager>(&sections_));
   builder.setMArch("bpf");
-  builder.setUseOrcMCJITReplacement(true);
+  builder.setUseOrcMCJITReplacement(false);
   engine_ = unique_ptr<ExecutionEngine>(builder.create());
   if (!engine_) {
     fprintf(stderr, "Could not create ExecutionEngine: %s\n", err.c_str());
-- 
2.14.3


Reply via email to