From patchwork Thu Oct 31 20:04:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Kuhls X-Patchwork-Id: 2004876 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XfZk26Qw3z1xxJ for ; Fri, 1 Nov 2024 07:05:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 553B381E4F; Thu, 31 Oct 2024 20:05:45 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id W8hU3dBn3-zy; Thu, 31 Oct 2024 20:05:44 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 605A081E51 Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 605A081E51; Thu, 31 Oct 2024 20:05:44 +0000 (UTC) X-Original-To: buildroot@buildroot.org Delivered-To: buildroot@buildroot.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 732995E4F for ; Thu, 31 Oct 2024 20:05:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 61F7081E4F for ; Thu, 31 Oct 2024 20:05:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id edLKfmTJ9Wa6 for ; Thu, 31 Oct 2024 20:05:42 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=85.13.140.57; helo=dd20012.kasserver.com; envelope-from=bernd@kuhls.net; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 589C281E4B DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 589C281E4B Received: from dd20012.kasserver.com (dd20012.kasserver.com [85.13.140.57]) by smtp1.osuosl.org (Postfix) with ESMTPS id 589C281E4B for ; Thu, 31 Oct 2024 20:05:42 +0000 (UTC) Received: from fli4l.lan.fli4l (p5b3a02c6.dip0.t-ipconnect.de [91.58.2.198]) by dd20012.kasserver.com (Postfix) with ESMTPSA id 9B538A4C1A32; Thu, 31 Oct 2024 21:05:12 +0100 (CET) Received: from bruckner.lan.fli4l ([192.168.1.1]:60236) by fli4l.lan.fli4l with esmtp (Exim 4.98) (envelope-from ) id 1t6bPr-000000001WT-3Qdm; Thu, 31 Oct 2024 20:05:12 +0000 From: Bernd Kuhls To: buildroot@buildroot.org Cc: Romain Naour , Valentin Korenblit , Daniel Lang , Eric Le Bihan , "Yann E . MORIN" , Romain Naour , Sebastian Weyer , Antoine Coutant Date: Thu, 31 Oct 2024 21:04:58 +0100 Message-Id: <20241031200501.1107802-3-bernd@kuhls.net> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031200501.1107802-1-bernd@kuhls.net> References: <20241031200501.1107802-1-bernd@kuhls.net> MIME-Version: 1.0 X-Spamd-Bar: + X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kuhls.net; s=kas202406071026; t=1730405112; bh=bRIxL6KF56BvrE+WPUSNuEZe5D9eM4eHUrnmkNvlqnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fypdo1expdv7O3cdM+E5ABnW7+gpoxbqHsAJs8CymhPzyIlGdCJNEg5rThKV/TzaM Gm9CtokPXwGyuu16jNty1pYdP39+C3MI4X1/0Ga7tC40qgEfg6FY5FgeyTWt7xx00Y J8o2lZHJGHdCKBFreo+1/Lcsp47M7IyMKbRJWRPBiWifYGTL55zRiQsVLsU3A3HV51 mcYFWTDeHcCCOEYDqyTz0fFyxkvgG2E6dlP6Fq8E2W7cO3kp8wZP9yjEwIZTfqspVX 2h3oiQnhkfi6ZcIhIU4W7akuxsjrTM0H8Rh5819j1QLmofEYnSAG+2NsprbAu/SFGX vNyG4kZLz2L+w== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=kuhls.net X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kuhls.net header.i=@kuhls.net header.a=rsa-sha256 header.s=kas202406071026 header.b=Fypdo1ex Subject: [Buildroot] [PATCH 3/6] package/spirv-llvm-translator: add target variant to provide LLVMSPIRVLib X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Romain Naour This target version is needed for Rusticl which is an LLVM based OpenCL framework[1]. Rusticl allow programs to compile OpenCL C/C++ code at runtime with Clang. Clang generates LLVM IR which is translated into SPIR-V by spirv-llvm-translator. Finally, mesa can use its internal tools to manage SPIR-V. [1]: https://docs.mesa3d.org/rusticl.html Signed-off-by: Romain Naour Signed-off-by: Sebastian Weyer Signed-off-by: Antoine Coutant Signed-off-by: Bernd Kuhls --- package/Config.in | 1 + package/spirv-llvm-translator/Config.in | 22 +++++++++++++++++++ .../spirv-llvm-translator.mk | 10 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 package/spirv-llvm-translator/Config.in diff --git a/package/Config.in b/package/Config.in index fd0de2cb6d..d62eb08025 100644 --- a/package/Config.in +++ b/package/Config.in @@ -335,6 +335,7 @@ comment "Graphic applications" source "package/pngquant/Config.in" source "package/qt5cinex/Config.in" source "package/rrdtool/Config.in" + source "package/spirv-llvm-translator/Config.in" source "package/spirv-tools/Config.in" source "package/stellarium/Config.in" source "package/sway/Config.in" diff --git a/package/spirv-llvm-translator/Config.in b/package/spirv-llvm-translator/Config.in new file mode 100644 index 0000000000..73ca787d8a --- /dev/null +++ b/package/spirv-llvm-translator/Config.in @@ -0,0 +1,22 @@ +config BR2_PACKAGE_SPIRV_LLVM_TRANSLATOR + bool "spirv-translator" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_INSTALL_LIBSTDCPP + depends on !BR2_STATIC_LIBS + depends on BR2_HOST_GCC_AT_LEAST_7 # host-llvm + select BR2_PACKAGE_LLVM + select BR2_PACKAGE_SPIRV_HEADERS + select BR2_PACKAGE_ZLIB + help + LLVM/SPIR-V Bi-Directional Translator is a library and tool + for translation between LLVM IR and SPIR-V. + + https://github.com/khronosGroup/SPIRV-LLVM-Translator + +comment "spirv-translator needs a toolchain w/ threads, C++, gcc >= 7, dynamic library, host gcc >= 7" + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_7 \ + || BR2_STATIC_LIBS || !BR2_HOST_GCC_AT_LEAST_7 diff --git a/package/spirv-llvm-translator/spirv-llvm-translator.mk b/package/spirv-llvm-translator/spirv-llvm-translator.mk index 523890a986..ffc8a63b89 100644 --- a/package/spirv-llvm-translator/spirv-llvm-translator.mk +++ b/package/spirv-llvm-translator/spirv-llvm-translator.mk @@ -19,4 +19,14 @@ HOST_SPIRV_LLVM_TRANSLATOR_CONF_OPTS = \ -DLLVM_EXTERNAL_PROJECTS="SPIRV-Headers" \ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$(HOST_DIR)/include +SPIRV_LLVM_TRANSLATOR_INSTALL_STAGING = YES +SPIRV_LLVM_TRANSLATOR_DEPENDENCIES = host-clang host-llvm llvm spirv-headers +SPIRV_LLVM_TRANSLATOR_CONF_OPTS = \ + -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$(STAGING_DIR)/usr \ + -DLLVM_BUILD_TOOLS=ON \ + -DLLVM_DIR=$(STAGING_DIR)/lib/cmake/llvm \ + -DLLVM_SPIRV_BUILD_EXTERNAL=YES \ + -DLLVM_SPIRV_INCLUDE_TESTS=OFF + +$(eval $(cmake-package)) $(eval $(host-cmake-package))