diff options
-rw-r--r-- | recipes-devtools/bpftrace/bpftrace/0001-Allow-to-build-with-OE-llvm-clang-cross-compiled-pac.patch | 65 | ||||
-rw-r--r-- | recipes-devtools/bpftrace/bpftrace_0.9.4.bb | 36 |
2 files changed, 101 insertions, 0 deletions
diff --git a/recipes-devtools/bpftrace/bpftrace/0001-Allow-to-build-with-OE-llvm-clang-cross-compiled-pac.patch b/recipes-devtools/bpftrace/bpftrace/0001-Allow-to-build-with-OE-llvm-clang-cross-compiled-pac.patch new file mode 100644 index 0000000..d6cb322 --- /dev/null +++ b/recipes-devtools/bpftrace/bpftrace/0001-Allow-to-build-with-OE-llvm-clang-cross-compiled-pac.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | From cdfd9284c7e83b1bd18c94c0f39c020f31759178 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sumit Garg <sumit.garg@linaro.org> | ||
3 | Date: Mon, 17 Feb 2020 09:45:38 +0000 | ||
4 | Subject: [PATCH] Allow to build with OE llvm & clang cross compiled packages | ||
5 | |||
6 | The default llvm and clang cmake packages requires all libraries, headers | ||
7 | and tools to be present but in case of cross compilation, OE only | ||
8 | provides target specific libraries and headers and requires native llvm | ||
9 | or clang tools. | ||
10 | |||
11 | So instead of looking for a complete llvm & clang packages, look for | ||
12 | libraries and headers which are installed in target sysroot-recipe path. | ||
13 | |||
14 | Also, fix name for clang library lookup. | ||
15 | |||
16 | Signed-off-by: Sumit Garg <sumit.garg@linaro.org> | ||
17 | --- | ||
18 | CMakeLists.txt | 6 +++--- | ||
19 | src/ast/CMakeLists.txt | 2 +- | ||
20 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
23 | index b766669..e4de1e3 100644 | ||
24 | --- a/CMakeLists.txt | ||
25 | +++ b/CMakeLists.txt | ||
26 | @@ -14,7 +14,7 @@ set(STATIC_LIBC OFF CACHE BOOL "Attempt to embed libc, only known to work with m | ||
27 | set(EMBED_LLVM OFF CACHE BOOL "Build LLVM static libs as an ExternalProject and link to these instead of system libs.") | ||
28 | set(EMBED_CLANG OFF CACHE BOOL "Build Clang static libs as an ExternalProject and link to these instead of system libs.") | ||
29 | set(EMBED_LIBCLANG_ONLY OFF CACHE BOOL "Build only libclang.a, and link to system libraries statically") | ||
30 | -set(LLVM_VERSION "8" CACHE STRING "Embedded LLVM/Clang version to build and link against.") | ||
31 | +set(LLVM_VERSION "9" CACHE STRING "Embedded LLVM/Clang version to build and link against.") | ||
32 | set(BUILD_ASAN OFF CACHE BOOL "Build bpftrace with -fsanitize=address") | ||
33 | |||
34 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
35 | @@ -122,7 +122,7 @@ check_include_file("sys/sdt.h" HAVE_SYSTEMTAP_SYS_SDT_H) | ||
36 | |||
37 | if (EMBED_LLVM) | ||
38 | include(embed_llvm) | ||
39 | -else() | ||
40 | +elseif(0) | ||
41 | # Some users have multiple versions of llvm installed and would like to specify | ||
42 | # a specific llvm version. | ||
43 | if(${LLVM_REQUESTED_VERSION}) | ||
44 | @@ -142,7 +142,7 @@ endif() | ||
45 | |||
46 | if(EMBED_CLANG) | ||
47 | include(embed_clang) | ||
48 | -else() | ||
49 | +elseif(0) | ||
50 | find_package(Clang REQUIRED) | ||
51 | include_directories(SYSTEM ${CLANG_INCLUDE_DIRS}) | ||
52 | endif() | ||
53 | diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt | ||
54 | index f280f47..f8b9dff 100644 | ||
55 | --- a/src/ast/CMakeLists.txt | ||
56 | +++ b/src/ast/CMakeLists.txt | ||
57 | @@ -57,5 +57,5 @@ else() | ||
58 | llvm_expand_dependencies(llvm_libs ${_llvm_libs}) | ||
59 | target_link_libraries(ast ${llvm_libs}) | ||
60 | endif() | ||
61 | - target_link_libraries(ast libclang) | ||
62 | + target_link_libraries(ast clang) | ||
63 | endif() | ||
64 | -- | ||
65 | 2.17.1 | ||
diff --git a/recipes-devtools/bpftrace/bpftrace_0.9.4.bb b/recipes-devtools/bpftrace/bpftrace_0.9.4.bb new file mode 100644 index 0000000..2afb430 --- /dev/null +++ b/recipes-devtools/bpftrace/bpftrace_0.9.4.bb | |||
@@ -0,0 +1,36 @@ | |||
1 | SUMMARY = "bpftrace" | ||
2 | HOMEPAGE = "https://github.com/iovisor/bpftrace" | ||
3 | LICENSE = "Apache-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
5 | |||
6 | DEPENDS += "bison-native \ | ||
7 | ninja-native \ | ||
8 | elfutils-native \ | ||
9 | flex-native \ | ||
10 | gtest-native \ | ||
11 | git-native \ | ||
12 | ${MLPREFIX}elfutils \ | ||
13 | ${MLPREFIX}binutils \ | ||
14 | ${MLPREFIX}flex \ | ||
15 | clang \ | ||
16 | bcc \ | ||
17 | " | ||
18 | |||
19 | RDEPENDS_${PN} += "bash python3" | ||
20 | |||
21 | SRC_URI = "git://github.com/iovisor/bpftrace \ | ||
22 | file://0001-Allow-to-build-with-OE-llvm-clang-cross-compiled-pac.patch \ | ||
23 | " | ||
24 | SRCREV = "85f9eea624c83443816e37654d0c1c93366a2e66" | ||
25 | |||
26 | S = "${WORKDIR}/git" | ||
27 | |||
28 | inherit cmake | ||
29 | |||
30 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" | ||
31 | |||
32 | EXTRA_OECMAKE = " \ | ||
33 | -DCMAKE_BUILD_TYPE=Release \ | ||
34 | " | ||
35 | |||
36 | FILES_${PN} += "${prefix}/man/*" | ||