Hello community,

here is the log from the commit of package bpftrace for openSUSE:Factory 
checked in at 2020-01-31 23:57:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bpftrace (Old)
 and      /work/SRC/openSUSE:Factory/.bpftrace.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bpftrace"

Fri Jan 31 23:57:29 2020 rev:2 rq:769016 version:0.9.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/bpftrace/bpftrace.changes        2019-12-27 
13:49:20.116486803 +0100
+++ /work/SRC/openSUSE:Factory/.bpftrace.new.26092/bpftrace.changes     
2020-01-31 23:58:54.355701818 +0100
@@ -1,0 +2,8 @@
+Fri Jan 31 09:19:26 UTC 2020 - Aleksa Sarai <[email protected]>
+
+- Fix builds on Leap 15.1. This requires quite a bit of trickery related to
+  binutils (see boo#1162312), but it's nothing too hard.
+- Added patch to workaround boo#1162312.
+  + boo1162312-cmake-use-_LIBRARIES-when-testing-for-libbfd-version.patch
+
+-------------------------------------------------------------------

New:
----
  boo1162312-cmake-use-_LIBRARIES-when-testing-for-libbfd-version.patch

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

Other differences:
------------------
++++++ bpftrace.spec ++++++
--- /var/tmp/diff_new_pack.IX7hxg/_old  2020-01-31 23:58:55.211702261 +0100
+++ /var/tmp/diff_new_pack.IX7hxg/_new  2020-01-31 23:58:55.215702263 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package bpftrace
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,10 @@
 URL:            https://github.com/iovisor/bpftrace
 Source:         
https://github.com/iovisor/bpftrace/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Patch0:         install-man-dir.patch
+# FIX-UPSTREAM: Backport of https://github.com/iovisor/bpftrace/pull/1121. 
boo#1162312
+Patch1:         
boo1162312-cmake-use-_LIBRARIES-when-testing-for-libbfd-version.patch
+BuildRequires:  binutils
+BuildRequires:  binutils-devel
 BuildRequires:  bison
 BuildRequires:  clang
 BuildRequires:  clang-devel
@@ -59,16 +63,25 @@
 %prep
 %setup -q
 %patch0 -p1
+# boo#1162312
+%patch1 -p1
 
 # Correct the #!-line to avoid rpmlint warnings.
 find tools -name '*.bt' -type f \
        -exec sed -i '1s|^#!%{_bindir}/env bpftrace|#!%{_bindir}/bpftrace|' 
'{}' ';'
 
 %build
+# Find libbfd.so and libopcodes.so. This is necessary because binutils gives
+# these libraries very strange names which CMake cannot find. See boo#1162312.
+LIBBFD="$(find "%{_libdir}" -type f -name 'libbfd*.so*')"
+LIBOPCODES="$(find "%{_libdir}" -type f -name 'libopcodes*.so*')"
+
 %define _lto_cflags %{nil}
 export CC="clang"
 export CXX="clang++"
 %cmake \
+       -DLIBBFD_LIBRARIES="${LIBBFD}" \
+       -DLIBOPCODES_LIBRARIES="${LIBOPCODES}" \
        -DBUILD_SHARED_LIBS:BOOL=OFF \
        -DBUILD_STATIC_LIBS:BOOL=ON \
        -DBUILD_TESTING:BOOL=OFF

++++++ boo1162312-cmake-use-_LIBRARIES-when-testing-for-libbfd-version.patch 
++++++
>From 87f1a5ce8a098d89ccfc0c2b3124c8fc45041725 Mon Sep 17 00:00:00 2001
From: Aleksa Sarai <[email protected]>
Date: Fri, 31 Jan 2020 20:09:08 +1100
Subject: [PATCH] cmake: use *_LIBRARIES when testing for libbfd version

On openSUSE, binutils has really strangely named libbfd and libopcodes
libraries[1]. This is fine (we can define *_LIBRARIES variables), but the
result is that the LIBBFD_DISASM_FOUR_ARGS_SIGNATURE test will always
fail because CHECK_CXX_SOURCE_COMPILES cannot find the right libraries.

The fix is simple -- just use *_LIBRARIES for CMAKE_REQUIRED_LIBRARIES.
We need to find_library(LibOpcodes) for that test, but that isn't too
bad because CMake caches the result.

[1]: https://bugzilla.suse.com/show_bug.cgi?id=1162312

Signed-off-by: Aleksa Sarai <[email protected]>
---
 cmake/FindLibBfd.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmake/FindLibBfd.cmake b/cmake/FindLibBfd.cmake
index d8b7bf1e2c6b..c659d46e313e 100644
--- a/cmake/FindLibBfd.cmake
+++ b/cmake/FindLibBfd.cmake
@@ -61,7 +61,8 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibBfd "Please install the 
libbfd development
 mark_as_advanced(LIBBFD_INCLUDE_DIRS LIBBFD_LIBRARIES)
 
 if(${LIBBFD_FOUND})
-SET(CMAKE_REQUIRED_LIBRARIES bfd opcodes)
+find_package(LibOpcodes)
+SET(CMAKE_REQUIRED_LIBRARIES ${LIBBFD_LIBRARIES} ${LIBOPCODES_LIBRARIES})
 INCLUDE(CheckCXXSourceCompiles)
 CHECK_CXX_SOURCE_COMPILES("
 #include <string.h>
-- 
2.25.0


Reply via email to