Hello community,

here is the log from the commit of package bcc for openSUSE:Factory checked in 
at 2018-04-10 10:54:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bcc (Old)
 and      /work/SRC/openSUSE:Factory/.bcc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bcc"

Tue Apr 10 10:54:43 2018 rev:22 rq:594823 version:0.5.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/bcc/bcc.changes  2018-04-02 22:49:45.368691075 
+0200
+++ /work/SRC/openSUSE:Factory/.bcc.new/bcc.changes     2018-04-10 
10:54:53.780740933 +0200
@@ -1,0 +2,6 @@
+Fri Apr  6 08:52:10 UTC 2018 - [email protected]
+
+- Add bcc-fix-a-compilation-error-with-latest-llvm-clang-trunk.patch
+  to fix build with LLVM6.
+
+-------------------------------------------------------------------

New:
----
  bcc-fix-a-compilation-error-with-latest-llvm-clang-trunk.patch

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

Other differences:
------------------
++++++ bcc.spec ++++++
--- /var/tmp/diff_new_pack.oArSRT/_old  2018-04-10 10:54:55.504678669 +0200
+++ /var/tmp/diff_new_pack.oArSRT/_new  2018-04-10 10:54:55.504678669 +0200
@@ -44,6 +44,7 @@
 Patch7:         %{name}-bsc1080085-import-readline-from-lib.patch
 Patch8:         %{name}-bsc1080085-detect-slab-for-slabratetop.patch
 Patch9:         %{name}-bsc1080085-fix-syscount-str.patch
+Patch10:        
%{name}-fix-a-compilation-error-with-latest-llvm-clang-trunk.patch
 ExcludeArch:    ppc s390
 BuildRequires:  bison
 BuildRequires:  cmake >= 2.8.7
@@ -177,6 +178,7 @@
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 %build
 # Prevent the cpp examples from compilation and installation

++++++ bcc-fix-a-compilation-error-with-latest-llvm-clang-trunk.patch ++++++
>From c0d1694e28336cbe4a57f420dd33c5e3bfaa2df9 Mon Sep 17 00:00:00 2001
From: Yonghong Song <[email protected]>
Date: Thu, 28 Dec 2017 13:34:06 -0800
Subject: [PATCH] fix a compilation error with latest llvm/clang trunk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

bcc build with latest llvm/clang trunk failed with the
below error:
......
[ 35%] Built target api-static
/home/yhs/work/bcc/src/cc/frontends/clang/tp_frontend_action.cc: In member 
function ‘bool ebpf::TracepointTypeVisitor::Visit
FunctionDecl(clang::FunctionDecl*)’:
/home/yhs/work/bcc/src/cc/frontends/clang/tp_frontend_action.cc:163:60: error: 
no matching function for call to ‘clang::Qual
Type::getAsString(clang::SplitQualType)’
         auto type_name = QualType::getAsString(type.split());
                                                            ^
......

The error is caused by the below clang commit:
commit fcc28fd8cc8139cf1e4763459447880768579d8e
Author: Aaron Ballman <[email protected]>
Date:   Thu Dec 21 21:42:42 2017 +0000

    Re-commit r321223, which adds a printing policy to the ASTDumper.
......
-  std::string getAsString() const {
-    return getAsString(split());
+  static std::string getAsString(SplitQualType split,
+                                 const PrintingPolicy &Policy) {
+    return getAsString(split.Ty, split.Quals, Policy);
   }
+  static std::string getAsString(const Type *ty, Qualifiers qs,
+                                 const PrintingPolicy &Policy);

-  static std::string getAsString(SplitQualType split) {
-    return getAsString(split.Ty, split.Quals);
-  }
-
-  static std::string getAsString(const Type *ty, Qualifiers qs);
-
+  std::string getAsString() const;
   std::string getAsString(const PrintingPolicy &Policy) const;
......

The signature of static function getAsString(), which is used
in src/cc/frontends/clang/tp_frontend_action.cc, got changed,
and this caused the compilation error.

The patch chooses a different way to get type_name which works
for llvm 4.0 to 6.0 (tested).

Signed-off-by: Yonghong Song <[email protected]>
---
 src/cc/frontends/clang/tp_frontend_action.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cc/frontends/clang/tp_frontend_action.cc 
b/src/cc/frontends/clang/tp_frontend_action.cc
index b8818ba..3b46a62 100644
--- a/src/cc/frontends/clang/tp_frontend_action.cc
+++ b/src/cc/frontends/clang/tp_frontend_action.cc
@@ -160,7 +160,7 @@ bool TracepointTypeVisitor::VisitFunctionDecl(FunctionDecl 
*D) {
       auto type = arg->getType();
       if (type->isPointerType() &&
           type->getPointeeType()->isStructureOrClassType()) {
-        auto type_name = QualType::getAsString(type.split());
+        auto type_name = type->getPointeeType().getAsString();
         string tp_cat, tp_evt;
         if (_is_tracepoint_struct_type(type_name, tp_cat, tp_evt)) {
           string tp_struct = GenerateTracepointStruct(
-- 
2.13.6


Reply via email to