Add tbb package.

This is needed by sysdig 0.27.1.
It is based on the following patch:
https://lore.kernel.org/buildroot/20220407182425.194001-2-flaniel@linux.microsoft.com/T/#u

Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
pull/12707/head
Francis Laniel 2022-04-08 10:44:18 +01:00
parent f20b7ecf73
commit 4f03ea51cb
5 changed files with 113 additions and 0 deletions

View File

@ -1,4 +1,5 @@
menu "System tools" menu "System tools"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/tbb/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crun/Config.in" source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crun/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/automount/Config.in" source "$BR2_EXTERNAL_MINIKUBE_PATH/package/automount/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/gluster/Config.in" source "$BR2_EXTERNAL_MINIKUBE_PATH/package/gluster/Config.in"

View File

@ -0,0 +1,55 @@
From 42c3faff14917f687aab405d8f571e352ffdf3f5 Mon Sep 17 00:00:00 2001
From: Francis Laniel <flaniel@linux.microsoft.com>
Date: Wed, 6 Apr 2022 15:58:02 +0100
Subject: [PATCH] tbb: Enable cross-compilation.
This patch replaces hardcoded value for CPLUS and CONLY with $(CXX) and $(CC).
So, by defining CC= it is possible to cross compile this library using a
cross-compiler.
This patch was originally written by:
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
and taken from:
https://github.com/intel/luv-yocto/blob/3b0688bc9a5e8d52b6ca461b15fb4abd3eaaf7a8/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
---
build/linux.clang.inc | 5 +++--
build/linux.gcc.inc | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/build/linux.clang.inc b/build/linux.clang.inc
index 5a459ef5..a0777db5 100644
--- a/build/linux.clang.inc
+++ b/build/linux.clang.inc
@@ -31,8 +31,9 @@ DYLIB_KEY = -shared
EXPORT_KEY = -Wl,--version-script,
LIBDL = -ldl
-CPLUS = clang++
-CONLY = clang
+CPLUS = $(CXX)
+CONLY = $(CC)
+CPLUS_FLAGS = $(CXXFLAGS)
LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
LIBS += -lpthread -lrt
LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc
index 786c4153..30242a82 100644
--- a/build/linux.gcc.inc
+++ b/build/linux.gcc.inc
@@ -32,8 +32,9 @@ DYLIB_KEY = -shared
EXPORT_KEY = -Wl,--version-script,
LIBDL = -ldl
-CPLUS = g++
-CONLY = gcc
+CPLUS = $(CXX)
+CONLY = $(CC)
+CPLUS_FLAGS = $(CXXFLAGS)
LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
LIBS += -lpthread -lrt
LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
--
2.25.1

View File

@ -0,0 +1,16 @@
config BR2_PACKAGE_TBB
bool "tbb"
depends on BR2_TOOLCHAIN_USES_GLIBC
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_INSTALL_LIBSTDCPP
help
Intel(R) Threading Building Blocks (Intel(R) TBB) lets you
easily write parallel C++ programs that take full advantage
of multicore performance, that are portable, composable and
have future-proof scalability.
https://www.threadingbuildingblocks.org/
comment "tbb needs a glibc toolchain w/ dynamic library, threads, C++"
depends on !BR2_TOOLCHAIN_USES_GLIBC || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP

View File

@ -0,0 +1,2 @@
# Locally calculated
sha256 b8dbab5aea2b70cf07844f86fa413e549e099aa3205b6a04059ca92ead93a372 tbb-2018_U5.tar.gz

View File

@ -0,0 +1,39 @@
################################################################################
#
# tbb
#
################################################################################
TBB_VERSION = 2018_U5
TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))
TBB_INSTALL_STAGING = YES
TBB_LICENSE = Apache-2.0
TBB_LICENSE_FILES = LICENSE
TBB_SO_VERSION = 2
TBB_LIBS = libtbb libtbbmalloc libtbbmalloc_proxy
TBB_BIN_PATH = $(@D)/build/linux_*
define TBB_BUILD_CMDS
$(MAKE) $(TARGET_CONFIGURE_OPTS) arch=$(BR2_ARCH) -C $(@D)
endef
define TBB_INSTALL_LIBS
$(foreach lib,$(TBB_LIBS),
$(INSTALL) -D -m 0755 $(TBB_BIN_PATH)/$(lib).so.$(TBB_SO_VERSION) \
$(1)/usr/lib/$(lib).so.$(TBB_SO_VERSION) ;
ln -sf $(lib).so.$(TBB_SO_VERSION) $(1)/usr/lib/$(lib).so
)
endef
define TBB_INSTALL_STAGING_CMDS
mkdir -p $(STAGING_DIR)/usr/include/
cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/
$(call TBB_INSTALL_LIBS,$(STAGING_DIR))
endef
define TBB_INSTALL_TARGET_CMDS
$(call TBB_INSTALL_LIBS,$(TARGET_DIR))
endef
$(eval $(generic-package))