From patchwork Wed Apr 4 16:31:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895062 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgp4LD3z9s0p for ; Thu, 5 Apr 2018 02:31:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9CE7686A98; Wed, 4 Apr 2018 16:31:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RUR-ypsF-lDG; Wed, 4 Apr 2018 16:31:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 93617864DA; Wed, 4 Apr 2018 16:31:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7D3CF1C1599 for ; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 79D3488E28 for ; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D6ttGn4TZwcA for ; Wed, 4 Apr 2018 16:31:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by fraxinus.osuosl.org (Postfix) with ESMTPS id ACB7088D69 for ; Wed, 4 Apr 2018 16:31:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 53C751EE1F5F; Wed, 4 Apr 2018 18:31:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZsKbw08ol6sj; Wed, 4 Apr 2018 18:31:37 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id 1C9951EE1954; Wed, 4 Apr 2018 18:31:37 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:18 +0200 Message-Id: <20180404163124.27934-2-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> Subject: [Buildroot] [PATCH v5 1/7] package/llvm: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch installs LLVM tools and libraries for the host and libLLVM.so for the target. In order to cross-compile LLVM for the target, LLVM must be installed on the host, or at least llvm-tblgen. This is necessary as the path to host's llvm-tblgen must be specified when cross-compiling using the LLVM_TABLEGEN option. Also, a version of llvm-config that can run on the host will be required by packages that link with LLVM libraries, so we need to generate it and install it in STAGING_DIR/usr/bin. It is important to remark why we need llvm-config(host variant) installed in STAGING dir. This tool is necessary to build applications that use LLVM, as it prints the compiler flags, linker flags and object libraries needed to link against LLVM libs. More info: https://bugs.chromium.org/p/chromium/issues/detail?id=219369 The original idea was to compile only llvm-tblgen and llvm-config for the host, as they are the only necessary components. However, llvm-config tool does not work as expected if it is not linked with libLLVM.so, so we must also enable LLVM_LINK_LLVM_DYLIB, what builds LLVM as a single shared library and links LLVM tools with it. More info: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224847 in comment #11. If we don't build full LLVM for the host, it would be necessary to patch configure.ac from mesa3d if we want dynamic linking, because it uses llvm-config (host variant installed in STAGING_DIR) to get the necessary LLVM libraries to link with, which has the following problems: - llvm-config --shared mode outputs static (even if LLVM is built as one shared library) which leads to link issues with libgallium. - llvm-config --libs outputs all LLVM tiny libs: -lLLVMLTO, -lLLVMPasses,etc instead of the single shared library containing all LLVM components (-lLLVM-5.0) Mesa tries to execute: llvm-config --link-shared --libs, but this outputs llvm-config: error: libLLVM-5.0.so is missing. Given that these problems may arise with other packages that use LLVM, it is preferable to do a full build for the host. Also, having a complete installation of LLVM on the host will also facilitate the integration of Clang front-end, which is going to be added in a future patch. As option LLVM_BUILD_LLVM_DYLIB is enabled for the llvm target variant, a single shared library containing all LLVM components is built. This option is not compatible with BUILD_SHARED_LIBS, which generates one .so per library and is only recommended for use by LLVM developers. Tools and utils are not built for the target. The patch aims to provide LLVM support for other packages. The main options needed to cross-compile LLVM are the following ones: LLVM_TABLEGEN CMAKE_CROSSCOMPILING LLVM_DEFAULT_TARGET_TRIPLE LLVM_HOST_TRIPLE LLVM_TARGET_ARCH LLVM_TARGETS_TO_BUILD Signed-off-by: Valentin Korenblit --- DEVELOPERS | 3 + package/Config.in | 1 + package/llvm/Config.in | 27 +++++ package/llvm/llvm.hash | 3 + package/llvm/llvm.mk | 263 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 package/llvm/Config.in create mode 100644 package/llvm/llvm.hash create mode 100644 package/llvm/llvm.mk diff --git a/DEVELOPERS b/DEVELOPERS index 38e727ecc3..78be8256bc 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1887,6 +1887,9 @@ N: Tzu-Jung Lee F: package/dropwatch/ F: package/tstools/ +N: Valentin Korenblit +F: package/llvm/ + N: Vanya Sergeev F: package/lua-periphery/ diff --git a/package/Config.in b/package/Config.in index d883909094..82c5c40531 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1545,6 +1545,7 @@ menu "Other" source "package/libuv/Config.in" source "package/lightning/Config.in" source "package/linux-pam/Config.in" + source "package/llvm/Config.in" if BR2_PACKAGE_LINUX_PAM comment "linux-pam plugins" source "package/libpam-radius-auth/Config.in" diff --git a/package/llvm/Config.in b/package/llvm/Config.in new file mode 100644 index 0000000000..f222b196cb --- /dev/null +++ b/package/llvm/Config.in @@ -0,0 +1,27 @@ +config BR2_PACKAGE_LLVM_ARCH_SUPPORTS + bool + default y if BR2_i386 + default y if BR2_x86_64 + default y if BR2_aarch64 + default y if BR2_arm || BR2_armeb + +config BR2_PACKAGE_LLVM_TARGET_ARCH + string + default "AArch64" if BR2_aarch64 + default "ARM" if BR2_arm || BR2_armeb + default "X86" if BR2_i386 || BR2_x86_64 + +config BR2_PACKAGE_LLVM + bool "llvm" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on BR2_HOST_GCC_AT_LEAST_4_8 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 + help + The LLVM Project is a collection of modular and reusable + compiler and toolchain technologies. + + http://llvm.org + +comment "llvm needs a toolchain w/ gcc >= 4.8, host gcc >= 4.8" + depends on !BR2_HOST_GCC_AT_LEAST_4_8 \ + || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 diff --git a/package/llvm/llvm.hash b/package/llvm/llvm.hash new file mode 100644 index 0000000000..3e998c4328 --- /dev/null +++ b/package/llvm/llvm.hash @@ -0,0 +1,3 @@ +# locally calculated +sha256 5fa7489fc0225b11821cab0362f5813a05f2bcf2533e8a4ea9c9c860168807b0 llvm-5.0.1.src.tar.xz +sha256 abd4d8794808bacb1eb6924d49efafd9ab6eef88faaaeb5d3cfa13ee3670d672 LICENSE.TXT diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk new file mode 100644 index 0000000000..525e0f98f8 --- /dev/null +++ b/package/llvm/llvm.mk @@ -0,0 +1,263 @@ +################################################################################ +# +# llvm +# +################################################################################ + +LLVM_VERSION = 5.0.1 +LLVM_SITE = http://llvm.org/releases/$(LLVM_VERSION) +LLVM_SOURCE = llvm-$(LLVM_VERSION).src.tar.xz +LLVM_LICENSE = NCSA +LLVM_LICENSE_FILES = LICENSE.TXT +LLVM_SUPPORTS_IN_SOURCE_BUILD = NO +LLVM_INSTALL_STAGING = YES + +# http://llvm.org/docs/GettingStarted.html#software +# host-python: Python interpreter 2.7 or newer is required for builds and testing. +HOST_LLVM_DEPENDENCIES = host-python +LLVM_DEPENDENCIES = host-llvm + +# Don't build clang libcxx libcxxabi lldb compiler-rt lld polly as llvm subprojects +# This flag assumes that projects are checked out side-by-side and not nested +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_PROJECTS="" +LLVM_CONF_OPTS += -DLLVM_ENABLE_PROJECTS="" + +HOST_LLVM_CONF_OPTS += -DLLVM_CCACHE_BUILD=$(if $(BR2_CCACHE),ON,OFF) +LLVM_CONF_OPTS += -DLLVM_CCACHE_BUILD=$(if $(BR2_CCACHE),ON,OFF) + +# Disable experimental Global Instruction Selection support. +# https://llvm.org/docs/GlobalISel.html +HOST_LLVM_CONF_OPTS += -DLLVM_BUILD_GLOBAL_ISEL=OFF +LLVM_CONF_OPTS += -DLLVM_BUILD_GLOBAL_ISEL=OFF + +# Get target architecture +LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH)) + +# Build backend for target architecture. This include backends like AMDGPU. +LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH) +HOST_LLVM_CONF_OPTS = -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" +LLVM_CONF_OPTS = -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" + +# LLVM target to use for native code generation. This is required for JIT generation. +# It must be set to LLVM_TARGET_ARCH for host and target, otherwise we get +# "No available targets are compatible for this triple" with llvmpipe when host +# and target architectures are different. +HOST_LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH) +LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH) + +# Use native llvm-tblgen from host-llvm (needed for cross-compilation) +LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen + +# BUILD_SHARED_LIBS has a misleading name. It is in fact an option for +# LLVM developers to build all LLVM libraries as separate shared libraries. +# For normal use of LLVM, it is recommended to build a single +# shared library, which is achieved by BUILD_SHARED_LIBS=OFF and +# LLVM_BUILD_LLVM_DYLIB=ON. +HOST_LLVM_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF +LLVM_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF + +# Generate libLLVM.so. This library contains a default set of LLVM components +# that can be overwritten with "LLVM_DYLIB_COMPONENTS". The default contains +# most of LLVM and is defined in "tools/llvm-shlib/CMakelists.txt". +HOST_LLVM_CONF_OPTS += -DLLVM_BUILD_LLVM_DYLIB=ON +LLVM_CONF_OPTS += -DLLVM_BUILD_LLVM_DYLIB=ON + +# LLVM_BUILD_LLVM_DYLIB to ON. We need to enable this option for the +# host as llvm-config for the host will be used in STAGING_DIR by packages +# linking against libLLVM and if this option is not selected, then llvm-config +# does not work properly. For example, it assumes that LLVM is built statically +# and cannot find libLLVM.so. +HOST_LLVM_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON +LLVM_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON + +LLVM_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1 + +# Disabled for the host since no host-libedit. +# Fall back to "Simple fgets-based implementation" of llvm line editor. +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_LIBEDIT=OFF +LLVM_CONF_OPTS += -DLLVM_ENABLE_LIBEDIT=OFF + +# We want to install llvm libraries and modules. +HOST_LLVM_CONF_OPTS += -DLLVM_INSTALL_TOOLCHAIN_ONLY=OFF +LLVM_CONF_OPTS += -DLLVM_INSTALL_TOOLCHAIN_ONLY=OFF + +# We build from a release archive without vcs files. +HOST_LLVM_CONF_OPTS += -DLLVM_APPEND_VC_REV=OFF +LLVM_CONF_OPTS += -DLLVM_APPEND_VC_REV=OFF + +# No backtrace package in Buildroot. +# https://documentation.backtrace.io +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_BACKTRACES=OFF +LLVM_CONF_OPTS += -DLLVM_ENABLE_BACKTRACES=OFF + +# Enable signal handlers overrides support. +HOST_LLVM_CONF_OPTS += -DENABLE_CRASH_OVERRIDES=ON +LLVM_CONF_OPTS += -DENABLE_CRASH_OVERRIDES=ON + +# Disable ffi for now. +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_FFI=OFF +LLVM_CONF_OPTS += -DLLVM_ENABLE_FFI=OFF + +# Disable terminfo database (needs ncurses libtinfo.so) +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_TERMINFO=OFF +LLVM_CONF_OPTS += -DLLVM_ENABLE_TERMINFO=OFF + +# Enable thread support +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_THREADS=ON +LLVM_CONF_OPTS += -DLLVM_ENABLE_THREADS=ON + +# Enable optional host-zlib support for LLVM Machine Code (llvm-mc) to add +# compression/uncompression capabilities. +# Not needed on the target. +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_ZLIB=ON +HOST_LLVM_DEPENDENCIES += host-zlib +LLVM_CONF_OPTS += -DLLVM_ENABLE_ZLIB=OFF + +# We don't use llvm for static only build, so enable PIC +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_PIC=ON +LLVM_CONF_OPTS += -DLLVM_ENABLE_PIC=ON + +# Default is Debug build, which requires considerably more disk space and +# build time. Release build is selected for host and target because the linker +# can run out of memory in Debug mode. +HOST_LLVM_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release +LLVM_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release + +# Disable C++1y (ISO C++ 2014 standard) +# Disable C++1z (ISO C++ 2017 standard) +# Compile llvm with the C++11 (ISO C++ 2011 standard) which is the fallback. +HOST_LLVM_CONF_OPTS += \ + -DLLVM_ENABLE_CXX1Y=OFF \ + -DLLVM_ENABLE_CXX1Z=OFF +LLVM_CONF_OPTS += \ + -DLLVM_ENABLE_CXX1Y=OFF \ + -DLLVM_ENABLE_CXX1Z=OFF + +# Disabled, requires sys/ndir.h header +# Disable debug in module +HOST_LLVM_CONF_OPTS += \ + -DLLVM_ENABLE_MODULES=OFF \ + -DLLVM_ENABLE_MODULE_DEBUGGING=OFF +LLVM_CONF_OPTS += \ + -DLLVM_ENABLE_MODULES=OFF \ + -DLLVM_ENABLE_MODULE_DEBUGGING=OFF + +# Don't change the standard library to libc++. +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_LIBCXX=OFF +LLVM_CONF_OPTS += -DLLVM_ENABLE_LIBCXX=OFF + +# Don't use lld as a linker. +HOST_LLVM_CONF_OPTS += -DLLVM_ENABLE_LLD=OFF +LLVM_CONF_OPTS += -DLLVM_ENABLE_LLD=OFF + +# Generate code for the target. LLVM selects a target by looking at the +# toolchain tuple +HOST_LLVM_CONF_OPTS += -DLLVM_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) +LLVM_CONF_OPTS += -DLLVM_DEFAULT_TARGET_TRIPLE=$(GNU_TARGET_NAME) + +# LLVM_HOST_TRIPLE has a misleading name, it is in fact the triple of the +# system where llvm is going to run on. We need to specify triple for native +# code generation on the target. +# This solves "No available targets are compatible for this triple" with llvmpipe +LLVM_CONF_OPTS += -DLLVM_HOST_TRIPLE=$(GNU_TARGET_NAME) + +# The Go bindings have no CMake rules at the moment, but better remove the +# check preventively. Building the Go and OCaml bindings is yet unsupported. +HOST_LLVM_CONF_OPTS += \ + -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND \ + -DOCAMLFIND=OCAMLFIND-NOTFOUND + +# Builds a release host tablegen that gets used during the LLVM build. +HOST_LLVM_CONF_OPTS += -DLLVM_OPTIMIZED_TABLEGEN=ON + +# Keep llvm utility binaries for the host. llvm-tblgen is built anyway as +# CMakeLists.txt has add_subdirectory(utils/TableGen) unconditionally. +HOST_LLVM_CONF_OPTS += \ + -DLLVM_BUILD_UTILS=ON \ + -DLLVM_INCLUDE_UTILS=ON \ + -DLLVM_INSTALL_UTILS=ON +LLVM_CONF_OPTS += \ + -DLLVM_BUILD_UTILS=OFF \ + -DLLVM_INCLUDE_UTILS=OFF \ + -DLLVM_INSTALL_UTILS=OFF + +HOST_LLVM_CONF_OPTS += \ + -DLLVM_INCLUDE_TOOLS=ON \ + -DLLVM_BUILD_TOOLS=ON + +# We need to activate LLVM_INCLUDE_TOOLS, otherwise it does not generate +# libLLVM.so +LLVM_CONF_OPTS += \ + -DLLVM_INCLUDE_TOOLS=ON \ + -DLLVM_BUILD_TOOLS=OFF + +# Compiler-rt not in the source tree. +# llvm runtime libraries are not in the source tree. +# Polly is not in the source tree. +HOST_LLVM_CONF_OPTS += \ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT=OFF \ + -DLLVM_BUILD_RUNTIME=OFF \ + -DLLVM_INCLUDE_RUNTIMES=OFF \ + -DLLVM_POLLY_BUILD=OFF +LLVM_CONF_OPTS += \ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT=OFF \ + -DLLVM_BUILD_RUNTIME=OFF \ + -DLLVM_INCLUDE_RUNTIMES=OFF \ + -DLLVM_POLLY_BUILD=OFF + +HOST_LLVM_CONF_OPTS += \ + -DLLVM_ENABLE_WARNINGS=ON \ + -DLLVM_ENABLE_PEDANTIC=ON \ + -DLLVM_ENABLE_WERROR=OFF +LLVM_CONF_OPTS += \ + -DLLVM_ENABLE_WARNINGS=ON \ + -DLLVM_ENABLE_PEDANTIC=ON \ + -DLLVM_ENABLE_WERROR=OFF + +HOST_LLVM_CONF_OPTS += \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLLVM_BUILD_DOCS=OFF \ + -DLLVM_BUILD_TESTS=OFF \ + -DLLVM_ENABLE_DOXYGEN=OFF \ + -DLLVM_ENABLE_OCAMLDOC=OFF \ + -DLLVM_ENABLE_SPHINX=OFF \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INCLUDE_DOCS=OFF \ + -DLLVM_INCLUDE_GO_TESTS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF +LLVM_CONF_OPTS += \ + -DLLVM_BUILD_EXAMPLES=OFF \ + -DLLVM_BUILD_DOCS=OFF \ + -DLLVM_BUILD_TESTS=OFF \ + -DLLVM_ENABLE_DOXYGEN=OFF \ + -DLLVM_ENABLE_OCAMLDOC=OFF \ + -DLLVM_ENABLE_SPHINX=OFF \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INCLUDE_DOCS=OFF \ + -DLLVM_INCLUDE_GO_TESTS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF + +# Copy llvm-config (host variant) to STAGING_DIR +# llvm-config (host variant) returns include and lib directories +# for the host if it's installed in host/bin: +# output/host/bin/llvm-config --includedir +# output/host/include +# When installed in STAGING_DIR, llvm-config returns include and lib +# directories from STAGING_DIR. +# output/staging/usr/bin/llvm-config --includedir +# output/staging/usr/include +define HOST_LLVM_COPY_LLVM_CONFIG_TO_STAGING_DIR + $(INSTALL) -D -m 0755 $(HOST_DIR)/bin/llvm-config \ + $(STAGING_DIR)/usr/bin/llvm-config +endef +HOST_LLVM_POST_INSTALL_HOOKS = HOST_LLVM_COPY_LLVM_CONFIG_TO_STAGING_DIR + +# By default llvm-tblgen is built and installed on the target but it is +# not necessary. +define LLVM_DELETE_LLVM_TBLGEN_TARGET + rm -f $(TARGET_DIR)/usr/bin/llvm-tblgen +endef +LLVM_POST_INSTALL_TARGET_HOOKS = LLVM_DELETE_LLVM_TBLGEN_TARGET + +$(eval $(cmake-package)) +$(eval $(host-cmake-package)) From patchwork Wed Apr 4 16:31:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895059 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgj5Hjvz9s0p for ; Thu, 5 Apr 2018 02:31:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DC94888E38; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SJVbPJh63oNX; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E94E088DF2; Wed, 4 Apr 2018 16:31:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 6960F1C1599 for ; Wed, 4 Apr 2018 16:31:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 67321307D4 for ; Wed, 4 Apr 2018 16:31:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B4d5rKsLQZrF for ; Wed, 4 Apr 2018 16:31:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by silver.osuosl.org (Postfix) with ESMTPS id 637A8307C1 for ; Wed, 4 Apr 2018 16:31:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 3292B1EE25E0; Wed, 4 Apr 2018 18:31:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PoWwSQytLTax; Wed, 4 Apr 2018 18:31:38 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id 037671EE1954; Wed, 4 Apr 2018 18:31:38 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:19 +0200 Message-Id: <20180404163124.27934-3-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 2/7] package/llvm: enable AMDGPU X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The AMDGPU backend provides ISA code generation for AMD GPU's, starting with the R600 family up until the current GCN families. It should not be confused with the AMDGPU Linux kernel DRM driver. For more info: https://llvm.org/docs/AMDGPUUsage.html Signed-off-by: Valentin Korenblit Tested-by: Jérôme Oufella --- Tested on HD6480 using Gallium Radeon R600 driver. package/llvm/Config.in | 10 ++++++++++ package/llvm/llvm.mk | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/package/llvm/Config.in b/package/llvm/Config.in index f222b196cb..41e8e940bb 100644 --- a/package/llvm/Config.in +++ b/package/llvm/Config.in @@ -22,6 +22,16 @@ config BR2_PACKAGE_LLVM http://llvm.org +if BR2_PACKAGE_LLVM + +config BR2_PACKAGE_LLVM_AMDGPU + bool "AMDGPU backend" + help + Build AMDGPU target. Select this option if you are going + to install mesa3d with llvm and use Gallium Radeon driver. + +endif + comment "llvm needs a toolchain w/ gcc >= 4.8, host gcc >= 4.8" depends on !BR2_HOST_GCC_AT_LEAST_4_8 \ || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 525e0f98f8..9c8bf5c820 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -45,6 +45,15 @@ LLVM_CONF_OPTS = -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_B HOST_LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH) LLVM_CONF_OPTS += -DLLVM_TARGET_ARCH=$(LLVM_TARGET_ARCH) +# Build AMDGPU backend +# We need to build AMDGPU backend for both host and target because +# llvm-config --targets built (host variant installed in STAGING) will +# output only $(LLVM_TARGET_ARCH) if not, and mesa3d won't build as +# it thinks AMDGPU backend is not installed on the target. +ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y) +LLVM_TARGETS_TO_BUILD += AMDGPU +endif + # Use native llvm-tblgen from host-llvm (needed for cross-compilation) LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen From patchwork Wed Apr 4 16:31:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895061 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgp0cgTz9s0b for ; Thu, 5 Apr 2018 02:31:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 05F8988E60; Wed, 4 Apr 2018 16:31:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gQemwlrtTU1s; Wed, 4 Apr 2018 16:31:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2453A88E39; Wed, 4 Apr 2018 16:31:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D30551C1599 for ; Wed, 4 Apr 2018 16:31:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CFF1089D6E for ; Wed, 4 Apr 2018 16:31:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FWDe-o6qrnXq for ; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by whitealder.osuosl.org (Postfix) with ESMTPS id E013C89DB2 for ; Wed, 4 Apr 2018 16:31:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 0733B1EE273A; Wed, 4 Apr 2018 18:31:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rfEuH-G4I5+p; Wed, 4 Apr 2018 18:31:38 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id C9D031EE1954; Wed, 4 Apr 2018 18:31:38 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:20 +0200 Message-Id: <20180404163124.27934-4-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 3/7] package/mesa3d: enable llvm support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch provides LLVM support for Mesa3D, enabling llvmpipe software rasterizer if Gallium swrast is selected. In case Gallium r600 is selected, llvm AMDGPU backend is built. Having llvm installed also enables radeonsi Gallium driver, but it is not provided with this patch as it hasn't been tested. It uses llvm-config (host variant) installed in STAGING_DIR/usr/bin to get LLVM libraries. Assuming that LLVM version 5.0.1 is installed, llvm-config --libs will output -lLLVM-5.0. Signed-off-by: Valentin Korenblit Tested-by: Jérôme Oufella --- llvmpipe tested running glmark2-es2 on x86, ARM and Aarch64 package/mesa3d/Config.in | 6 ++++++ package/mesa3d/mesa3d.mk | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in index f141587c4d..ffe0287ac5 100644 --- a/package/mesa3d/Config.in +++ b/package/mesa3d/Config.in @@ -25,6 +25,11 @@ menuconfig BR2_PACKAGE_MESA3D if BR2_PACKAGE_MESA3D +config BR2_PACKAGE_MESA3D_LLVM + bool "llvm support" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + select BR2_PACKAGE_LLVM + # inform the .mk file of gallium, dri or vulkan driver selection config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER bool @@ -77,6 +82,7 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 depends on BR2_i386 || BR2_x86_64 select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER select BR2_PACKAGE_LIBDRM_RADEON + select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM select BR2_PACKAGE_MESA3D_NEEDS_XA help Driver for ATI/AMD Radeon R600/R700/HD5000/HD6000 GPUs. diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk index 1d88fd8480..506f84274f 100644 --- a/package/mesa3d/mesa3d.mk +++ b/package/mesa3d/mesa3d.mk @@ -32,6 +32,17 @@ ifeq ($(BR2_SHARED_STATIC_LIBS),y) MESA3D_CONF_OPTS += --disable-static endif +ifeq ($(BR2_PACKAGE_MESA3D_LLVM),y) +MESA3D_DEPENDENCIES += host-llvm llvm +MESA3D_CONF_OPTS += \ + --with-llvm-prefix=$(STAGING_DIR)/usr \ + --enable-llvm-shared-libs \ + --enable-llvm +else +# Avoid automatic search of llvm-config +MESA3D_CONF_OPTS += --disable-llvm +endif + # The Sourcery MIPS toolchain has a special (non-upstream) feature to # have "compact exception handling", which unfortunately breaks with # mesa3d, so we disable it here by passing -mno-compact-eh. @@ -219,7 +230,4 @@ else MESA3D_CONF_OPTS += --disable-lmsensors endif -# Avoid automatic search of llvm-config -MESA3D_CONF_OPTS += --with-llvm-prefix=$(STAGING_DIR)/usr/bin - $(eval $(autotools-package)) From patchwork Wed Apr 4 16:31:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895064 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgv1CZLz9s0b for ; Thu, 5 Apr 2018 02:31:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E7BFD88E3A; Wed, 4 Apr 2018 16:31:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BqS1tNnrTZM3; Wed, 4 Apr 2018 16:31:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5AF5F88E3B; Wed, 4 Apr 2018 16:31:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8F9BA1C1599 for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8709688E38 for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2DTWQTvO0Hf9 for ; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0173488DFD for ; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id C62A01EE1F5F; Wed, 4 Apr 2018 18:31:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4sWLWKLjy6Jn; Wed, 4 Apr 2018 18:31:39 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id 9889E1EE1954; Wed, 4 Apr 2018 18:31:39 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:21 +0200 Message-Id: <20180404163124.27934-5-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> Subject: [Buildroot] [PATCH v5 4/7] package/clang: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch provides Clang tools and libraries for the host and libclang for the target. Clang is needed to build libclc, which is also provided in a follup patch. We need libclang for the target because it is used by most of OpenCL implementations. A later patch in this series will enable Clover, the OpenCl implementation part of Mesa3D, which requires libclang. clang-tblgen must be copied to HOST_DIR as it is not installed by default but is needed for cross-compilation: http://lists.llvm.org/pipermail/cfe-dev/2015-June/043318.html Signed-off-by: Valentin Korenblit --- DEVELOPERS | 1 + package/Config.in | 1 + package/clang/Config.in | 9 ++++++ package/clang/clang.hash | 3 ++ package/clang/clang.mk | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 package/clang/Config.in create mode 100644 package/clang/clang.hash create mode 100644 package/clang/clang.mk diff --git a/DEVELOPERS b/DEVELOPERS index 78be8256bc..72303992c2 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1888,6 +1888,7 @@ F: package/dropwatch/ F: package/tstools/ N: Valentin Korenblit +F: package/clang/ F: package/llvm/ N: Vanya Sergeev diff --git a/package/Config.in b/package/Config.in index 82c5c40531..b358e39c3f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1479,6 +1479,7 @@ menu "Other" source "package/bctoolbox/Config.in" source "package/bdwgc/Config.in" source "package/boost/Config.in" + source "package/clang/Config.in" source "package/clapack/Config.in" source "package/classpath/Config.in" source "package/cppcms/Config.in" diff --git a/package/clang/Config.in b/package/clang/Config.in new file mode 100644 index 0000000000..269766da1e --- /dev/null +++ b/package/clang/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_CLANG + bool "clang" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + select BR2_PACKAGE_LLVM + help + Clang is a C/C++, Objective C/C++ and OpenCL C front-end + for the LLVM compiler. + + http://clang.llvm.org diff --git a/package/clang/clang.hash b/package/clang/clang.hash new file mode 100644 index 0000000000..a5bf909814 --- /dev/null +++ b/package/clang/clang.hash @@ -0,0 +1,3 @@ +# locally calculated +sha256 135f6c9b0cd2da1aff2250e065946258eb699777888df39ca5a5b4fe5e23d0ff cfe-5.0.1.src.tar.xz +sha256 de4c79665f0f5688b0ace17cba6f8e0343925bb95e0949d66d47bbd4527310d6 LICENSE.TXT diff --git a/package/clang/clang.mk b/package/clang/clang.mk new file mode 100644 index 0000000000..7535782436 --- /dev/null +++ b/package/clang/clang.mk @@ -0,0 +1,71 @@ +################################################################################ +# +# clang +# +################################################################################ + +CLANG_VERSION = 5.0.1 +CLANG_SITE = http://llvm.org/releases/$(CLANG_VERSION) +CLANG_SOURCE = cfe-$(CLANG_VERSION).src.tar.xz +CLANG_LICENSE = NCSA +CLANG_LICENSE_FILES = LICENSE.TXT +CLANG_SUPPORTS_IN_SOURCE_BUILD = NO +CLANG_INSTALL_STAGING = YES + +HOST_CLANG_DEPENDENCIES = host-llvm host-libxml2 +CLANG_DEPENDENCIES = llvm host-clang + +# This option is needed. Otherwise multiple shared libs (libclangAST.so, +# libclangBasic.so, libclangFrontend.so, etc.) will be generated. As a final +# shared lib containing all these components (libclang.so) is also generated, this +# resulted in the following error when trying to use tools that use libclang: +# $ CommandLine Error: Option 'track-memory' registered more than once! +# $ LLVM ERROR: inconsistency in registered CommandLine options +# By setting BUILD_SHARED_LIBS to OFF, we generate multiple static libraries +# (the same way as host's clang build) and finally libclang.so to be installed on the +# target. +CLANG_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF + +# Default is Debug build, which requires considerably more disk space and +# build time. Release build is selected for host and target because the linker +# can run out of memory in Debug mode. +HOST_CLANG_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release +CLANG_CONF_OPTS += -DCMAKE_BUILD_TYPE=Release + +CLANG_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1 + +# We need to build tools because libclang is a tool +HOST_CLANG_CONF_OPTS += -DCLANG_BUILD_TOOLS=ON +CLANG_CONF_OPTS += -DCLANG_BUILD_TOOLS=ON + +HOST_CLANG_CONF_OPTS += \ + -DCLANG_BUILD_EXAMPLES=OFF \ + -DCLANG_INCLUDE_DOCS=OFF \ + -DCLANG_INCLUDE_TESTS=OFF + +CLANG_CONF_OPTS += \ + -DCLANG_BUILD_EXAMPLES=OFF \ + -DCLANG_INCLUDE_DOCS=OFF \ + -DCLANG_INCLUDE_TESTS=OFF + +HOST_CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(HOST_DIR)/bin/llvm-config +CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(STAGING_DIR)/usr/bin/llvm-config \ + -DCLANG_TABLEGEN:FILEPATH=$(HOST_DIR)/usr/bin/clang-tblgen + +# Clang can't be used as compiler on the target since there are no development files +# (headers) and other build tools. So remove clang binaries from target. +define CLANG_DELETE_BINARIES_FROM_TARGET + rm -f $(TARGET_DIR)/usr/bin/clang* +endef +CLANG_POST_INSTALL_TARGET_HOOKS += CLANG_DELETE_BINARIES_FROM_TARGET + +# clang-tblgen is not installed by default, however it is necessary for +# cross-compiling clang +define HOST_CLANG_INSTALL_CLANG_TBLGEN + $(INSTALL) -D -m 0755 $(HOST_CLANG_BUILDDIR)/bin/clang-tblgen \ + $(HOST_DIR)/usr/bin/clang-tblgen +endef +HOST_CLANG_POST_INSTALL_HOOKS = HOST_CLANG_INSTALL_CLANG_TBLGEN + +$(eval $(cmake-package)) +$(eval $(host-cmake-package)) From patchwork Wed Apr 4 16:31:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895066 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgw2DBTz9s0b for ; Thu, 5 Apr 2018 02:31:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 763A888E6E; Wed, 4 Apr 2018 16:31:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id reoXkxxwXsVZ; Wed, 4 Apr 2018 16:31:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4D7EC88E4D; Wed, 4 Apr 2018 16:31:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B17BF1C1599 for ; Wed, 4 Apr 2018 16:31:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AF44D88E49 for ; Wed, 4 Apr 2018 16:31:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZULV0yKvt1Ac for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A939D88E28 for ; Wed, 4 Apr 2018 16:31:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 7A2D51EE25E0; Wed, 4 Apr 2018 18:31:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kHJJTQaTB9k0; Wed, 4 Apr 2018 18:31:40 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id 49F2C1EE1954; Wed, 4 Apr 2018 18:31:40 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:22 +0200 Message-Id: <20180404163124.27934-6-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> Subject: [Buildroot] [PATCH v5 5/7] package/libclc: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch provides libclc, an open source implementation of the library requirements of the OpenCL C programming language, as specified by the OpenCL 1.1 Specification. It is intended to be used with Mesa Clover. It needs to be compiled with Clang, as it generates LLVM IR bitcode files containing device builtin functions for each target. Currently, libclc supports AMDGCN, R600 and NVPTX targets. As OpenCL kernels are built dynamically on the target using libclang and libLLVM, it is necessary to copy /usr/include/clc from STAGING_DIR to the target manually, as Buildroot doesn't include this directory. Signed-off-by: Valentin Korenblit --- This patch should not yet be applied, we must first find a place where clc headers can be stored. DEVELOPERS | 1 + package/Config.in | 1 + package/libclc/Config.in | 9 +++++++++ package/libclc/libclc.hash | 3 +++ package/libclc/libclc.mk | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 package/libclc/Config.in create mode 100644 package/libclc/libclc.hash create mode 100644 package/libclc/libclc.mk diff --git a/DEVELOPERS b/DEVELOPERS index 72303992c2..ec8f73681a 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1889,6 +1889,7 @@ F: package/tstools/ N: Valentin Korenblit F: package/clang/ +F: package/libclc/ F: package/llvm/ N: Vanya Sergeev diff --git a/package/Config.in b/package/Config.in index b358e39c3f..3cd979661f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -281,6 +281,7 @@ comment "Graphic libraries" source "package/fbv/Config.in" source "package/freerdp/Config.in" source "package/imagemagick/Config.in" + source "package/libclc/Config.in" source "package/linux-fusion/Config.in" source "package/lite/Config.in" source "package/mesa3d/Config.in" diff --git a/package/libclc/Config.in b/package/libclc/Config.in new file mode 100644 index 0000000000..797f090bfc --- /dev/null +++ b/package/libclc/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_LIBCLC + bool "libclc" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + help + libclc is an open source, BSD licensed implementation of + the library requirements of the OpenCL C programming language, + as specified by the OpenCL 1.1 Specification. + + http://libclc.llvm.org/ diff --git a/package/libclc/libclc.hash b/package/libclc/libclc.hash new file mode 100644 index 0000000000..c5bf5a668c --- /dev/null +++ b/package/libclc/libclc.hash @@ -0,0 +1,3 @@ +# locally calculated +sha256 e2f1f294f93695f2d1f87ccb9760231b435702dd0c27abeb38baa97186674d9e libclc-00236279a293b3737dee08c14f25923a889d2795.tar.gz +sha256 c66aa55d8478b45f1018500af9f433dd271444ad304d683dd49ff2a42f30dad1 LICENSE.TXT diff --git a/package/libclc/libclc.mk b/package/libclc/libclc.mk new file mode 100644 index 0000000000..35a69ea360 --- /dev/null +++ b/package/libclc/libclc.mk @@ -0,0 +1,41 @@ +################################################################################ +# +# libclc +# +################################################################################ + +# There are only two releases: release_35 and release_38, but the last +# commit is from 2 years ago. Master has some recent activity. +LIBCLC_VERSION = 00236279a293b3737dee08c14f25923a889d2795 +LIBCLC_SITE = https://git.llvm.org/git/libclc +LIBCLC_SITE_METHOD = git +LIBCLC_LICENSE = NCSA +LIBCLC_LICENSE_FILES = LICENSE.TXT + +LIBCLC_DEPENDENCIES = host-clang host-llvm +LIBCLC_INSTALL_STAGING = YES + +# C++ compiler is used to build a small tool (prepare-builtins) for the host. +# It must be built with the C++ compiler from the host +LIBCLC_CONF_OPTS = --with-llvm-config=$(HOST_DIR)/usr/bin/llvm-config \ + --prefix="/usr" \ + --pkgconfigdir="/usr/lib/pkgconfig" \ + --with-cxx-compiler=$(HOSTCXX) + +define LIBCLC_CONFIGURE_CMDS + (cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure.py $(LIBCLC_CONF_OPTS)) +endef + +define LIBCLC_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define LIBCLC_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install +endef + +define LIBCLC_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install +endef + +$(eval $(generic-package)) From patchwork Wed Apr 4 16:31:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895065 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgw12vpz9s0p for ; Thu, 5 Apr 2018 02:31:56 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 77BA786709; Wed, 4 Apr 2018 16:31:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rrSZRoNVgN3k; Wed, 4 Apr 2018 16:31:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E0F9486895; Wed, 4 Apr 2018 16:31:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 464301C1599 for ; Wed, 4 Apr 2018 16:31:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 43B96307D4 for ; Wed, 4 Apr 2018 16:31:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DrSwYWs0JkdB for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by silver.osuosl.org (Postfix) with ESMTPS id 5B612307D0 for ; Wed, 4 Apr 2018 16:31:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 2DC881EE278B; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mjgAkiWj6+5H; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id F28841EE1954; Wed, 4 Apr 2018 18:31:40 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:23 +0200 Message-Id: <20180404163124.27934-7-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> Subject: [Buildroot] [PATCH v5 6/7] package/mesa3d: enable OpenCL support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch provides Clover, the OpenCL 1.1 API implementation by Mesa for AMD GPUs. It generates libOpenCL.so. Add --disable-opencl-icd because int Mesa 18 defaults to on. When disabled, the shared library is named libOpenCL instead of libMesaOpenCL and CL headers are installed. Signed-off-by: Valentin Korenblit --- Tested with AMD Radeon Dual (AMD SUMO + AMD CAICOS) using Gallium r600: Piglit taken from Romain Naour's patch, setting -DPIGLIT_BUILD_CL_TESTS=ON: http://lists.busybox.net/pipermail/buildroot/2018-February/213601.html Results from 704 tests: skip 94 pass 541 fail 60 crash 9 Opencl-example (100% pass): https://cgit.freedesktop.org/~tstellar/opencl-example/ package/mesa3d/Config.in | 17 +++++++++++++++++ package/mesa3d/mesa3d.mk | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in index ffe0287ac5..600f9ffdda 100644 --- a/package/mesa3d/Config.in +++ b/package/mesa3d/Config.in @@ -30,6 +30,23 @@ config BR2_PACKAGE_MESA3D_LLVM depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS select BR2_PACKAGE_LLVM +config BR2_PACKAGE_MESA3D_OPENCL + bool "opencl support" + depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 + depends on BR2_PACKAGE_MESA3D_LLVM + depends on BR2_USE_WCHAR # elfutils + depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC + depends on !BR2_bfin # elfutils + select BR2_PACKAGE_CLANG + select BR2_PACKAGE_ELFUTILS + select BR2_PACKAGE_LIBCLC + +comment "mesa3d OpenCL needs a uClibc or glibc toolchain w/ wchar" + depends on BR2_PACKAGE_MESA3D_LLVM + depends on !BR2_bfin + depends on !BR2_USE_WCHAR \ + || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) + # inform the .mk file of gallium, dri or vulkan driver selection config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER bool diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk index 506f84274f..0d00b3f1b9 100644 --- a/package/mesa3d/mesa3d.mk +++ b/package/mesa3d/mesa3d.mk @@ -230,4 +230,14 @@ else MESA3D_CONF_OPTS += --disable-lmsensors endif +# Clover requires libelf +ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y) +MESA3D_DEPENDENCIES += clang elfutils libclc +MESA3D_CONF_OPTS += --enable-opencl \ + --disable-opencl-icd \ + --with-clang-libdir=$(STAGING_DIR)/usr/lib +else +MESA3D_CONF_OPTS += --disable-opencl +endif + $(eval $(autotools-package)) From patchwork Wed Apr 4 16:31:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 895063 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GWgt18Rjz9s0b for ; Thu, 5 Apr 2018 02:31:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AADA389DDF; Wed, 4 Apr 2018 16:31:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J9d+KCvQEiMz; Wed, 4 Apr 2018 16:31:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2B4D689DA7; Wed, 4 Apr 2018 16:31:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id AF8E81C1599 for ; Wed, 4 Apr 2018 16:31:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id ABF7E307D4 for ; Wed, 4 Apr 2018 16:31:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tap09BWZtw2q for ; Wed, 4 Apr 2018 16:31:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by silver.osuosl.org (Postfix) with ESMTPS id 09B91307C1 for ; Wed, 4 Apr 2018 16:31:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id CFCE41EE1F5F; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9qqDOcU1rgwf; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id 9E1141EE1954; Wed, 4 Apr 2018 18:31:41 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 4 Apr 2018 18:31:24 +0200 Message-Id: <20180404163124.27934-8-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404163124.27934-1-valentin.korenblit@smile.fr> References: <20180404163124.27934-1-valentin.korenblit@smile.fr> Subject: [Buildroot] [PATCH v5 7/7] package/clinfo: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This tool allows to verify if the OpenCL environment is set up correctly and output information related to the supported OpenCL platforms. Signed-off-by: Valentin Korenblit --- DEVELOPERS | 1 + package/Config.in | 1 + package/clinfo/Config.in | 9 +++++++++ package/clinfo/clinfo.hash | 2 ++ package/clinfo/clinfo.mk | 23 +++++++++++++++++++++++ 5 files changed, 36 insertions(+) create mode 100644 package/clinfo/Config.in create mode 100644 package/clinfo/clinfo.hash create mode 100644 package/clinfo/clinfo.mk diff --git a/DEVELOPERS b/DEVELOPERS index ec8f73681a..3312233fc3 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1889,6 +1889,7 @@ F: package/tstools/ N: Valentin Korenblit F: package/clang/ +F: package/clinfo/ F: package/libclc/ F: package/llvm/ diff --git a/package/Config.in b/package/Config.in index 3cd979661f..69af4aa15e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1483,6 +1483,7 @@ menu "Other" source "package/clang/Config.in" source "package/clapack/Config.in" source "package/classpath/Config.in" + source "package/clinfo/Config.in" source "package/cppcms/Config.in" source "package/cracklib/Config.in" source "package/dawgdic/Config.in" diff --git a/package/clinfo/Config.in b/package/clinfo/Config.in new file mode 100644 index 0000000000..279b5acbfb --- /dev/null +++ b/package/clinfo/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_CLINFO + bool "clinfo" + depends on BR2_PACKAGE_MESA3D_OPENCL + help + clinfo is a simple command-line application that enumerates + all possible (known) properties of the OpenCL platform and + devices available on the system. + + https://github.com/Oblomov/clinfo diff --git a/package/clinfo/clinfo.hash b/package/clinfo/clinfo.hash new file mode 100644 index 0000000000..e1c10afc9e --- /dev/null +++ b/package/clinfo/clinfo.hash @@ -0,0 +1,2 @@ +# locally calculated +sha256 64b02e68ccff3b95437bd0bd70dcb88438c58adec16a7145a5d4e5c26a898ccf clinfo-2.2.18.03.26.tar.gz diff --git a/package/clinfo/clinfo.mk b/package/clinfo/clinfo.mk new file mode 100644 index 0000000000..1477b76946 --- /dev/null +++ b/package/clinfo/clinfo.mk @@ -0,0 +1,23 @@ +################################################################################ +# +# clinfo +# +################################################################################ + +CLINFO_VERSION = 2.2.18.03.26 +CLINFO_SITE = $(call github,Oblomov,clinfo,$(CLINFO_VERSION)) +CLINFO_LICENSE = CC0-1.0 +CLINFO_LICENSE_FILES = legalcode.txt + +# libOpenCL is needed +CLINFO_DEPENDENCIES = mesa3d + +define CLINFO_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) +endef + +define CLINFO_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/clinfo $(TARGET_DIR)/usr/bin/clinfo +endef + +$(eval $(generic-package))