From patchwork Wed Apr 16 15:59:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 61438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A10AC369BA for ; Wed, 16 Apr 2025 15:59:35 +0000 (UTC) Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web11.22732.1744819174018446328 for ; Wed, 16 Apr 2025 08:59:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=iPtmUsrk; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: oss.qualcomm.com, ip: 205.220.180.131, mailfrom: dmitry.baryshkov@oss.qualcomm.com) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mDo5020542 for ; Wed, 16 Apr 2025 15:59:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=vabxFzg+1W2+ugdC02oao6fkqCsGe9YBXas aX2N+6ls=; b=iPtmUsrkPtlVqSe+AAy+JlQuWdpjy6+MiSTx7n2OwPGocX5Whqm s0t5N9rjMjXwJB30QHDrk+VcLNgtrwgSCf5j3RrW7goTP7qZwDMUsCf8SjrF4ZaC hOi9pa9xoN296dhPjs+m+XJySBxsCubS6vdtz2Qtv+w51DWk73ZCkb0JrAgmKERd QRNC4FLZaM8ug7UIz5s63WZr2PFSz/B6bCympofxsSYi8r4hlfC8VKL0AGWtNaCH zFDdVWaC/SMA6nD6f3RkMsWJRZJnV3DQ86JJgPfswVAkRnHog6Fy6zeiX4QOTJcE x3CKz0PUvtcZ0o/e8Oi5DKqsBuLtqlmcYSQ== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yg8wm2a1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 15:59:33 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6e913e1cf4aso173909016d6.2 for ; Wed, 16 Apr 2025 08:59:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744819172; x=1745423972; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vabxFzg+1W2+ugdC02oao6fkqCsGe9YBXasaX2N+6ls=; b=vgIVAOK7zSJ7S8I9wDtGhLzGTI5uALlHCpVeTFuUS0Pd5kRdFeOdbOP5dCKjIa/ulF AtozyV7d1MZdyYoRRTLe/NlLriafTO/mnP1k6+qk8ENWkKnQZMmJACiHxQzDw0pXrNOO +AxXGy2NYBqb82HBX2aiMCJrn8AEg70+UM4+cwCd5+Xd2fNpciqqpf3TaD1AO07YrhZg Ve/wZEXGith1bHfoMAlQl4GSBvjvIrsdg9ktp0D5QBSlb2R59CEBFizS4+uNCsyKtvl1 6bZNpxtrihbuDWtH+lIm8+GKBcaKkYOgcQjEF88UdvoJR5cjd8hzURIM/UoioTOOBsXx g2Lg== X-Gm-Message-State: AOJu0YzNWLooozZjAPw9h4V/POD369ED18cmDpZV7ngbtXTOL4eGLVLd 7xDZSg+0lyiVCgjpUPr0MQ8gDmJf3w3WZOi9AaEe2+ucxz1Uko4QRBHSeEG6wL3CyqzXRyVDMBJ O2UMFsQFQuL6NpvKpPlOiJZiKfYg/HCiY8ADQh2mMf9INhOPJdUbLmmeEj6OglyP6Yw95AeRnMQ 89l4wk//v8aFY= X-Gm-Gg: ASbGncs/j2KdkldruelhnZloiRHEJHf7ByOtAlCVmn9LvCPDijewCxqD25fg+AASCbl znWckv41BVcLV7qYjrimXl1HA8VM52noM69b+WgpMFgQsBw2xarQ+UWMHcGEqxYrNMqk1VLV4HU 8hjzGn8Gma0zbvvn7IwWpEah0/3XvwJjy0Obe90pa1DaOLlIcSXuJMu8n4/M75YsIANtquqzFQJ 1oj86kngwt37z+bgIui+ntSRP7Yd9abztG2IUxyeP9irRLJovLs3hVOxtWzOVB/taHLgg7Nz5js xdP3evoi6jUhx3TRbT+KJhohYQvNCsphMdOPbizvTEqkX6o0L/m/RuCpzlPqeFuTEaBMn09S4gt 0D7gD85859VKtk8EAJKvYTVaI X-Received: by 2002:a05:6214:1246:b0:6e8:9957:e705 with SMTP id 6a1803df08f44-6f2b3036a23mr39800326d6.34.1744819171975; Wed, 16 Apr 2025 08:59:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGi+SuGDj4rIUzJ2YrowryA//601MXR1KZaNgBC6dzHkf0IVf8HesrNUCBuc+rVTyLEDH9Qug== X-Received: by 2002:a05:6214:1246:b0:6e8:9957:e705 with SMTP id 6a1803df08f44-6f2b3036a23mr39799806d6.34.1744819171444; Wed, 16 Apr 2025 08:59:31 -0700 (PDT) Received: from umbar.lan (2001-14ba-a0c3-3a00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a0c3:3a00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54d5857223csm676550e87.175.2025.04.16.08.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 08:59:30 -0700 (PDT) From: Dmitry Baryshkov To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 1/3] llvm: import build fix from meta-clang Date: Wed, 16 Apr 2025 18:59:27 +0300 Message-Id: <20250416155929.2630778-1-dmitry.baryshkov@oss.qualcomm.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=E9TNpbdl c=1 sm=1 tr=0 ts=67ffd3e5 cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=t7CeM3EgAAAA:8 a=uIQtxe-Ix_KvRWAXy9AA:9 a=iYH6xdkBrDN1Jqds4HTS:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: zcb3XMck_LHSAqdL3ticq81dQMtLe7NF X-Proofpoint-GUID: zcb3XMck_LHSAqdL3ticq81dQMtLe7NF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160130 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Apr 2025 15:59:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214995 Import a fix from meta-clang, which allows packages using LLVM to find tools from the native sysroot. Signed-off-by: Dmitry Baryshkov --- ...gure-for-packages-using-find_package.patch | 117 ++++++++++++++++++ meta/recipes-devtools/llvm/llvm_20.1.2.bb | 1 + 2 files changed, 118 insertions(+) create mode 100644 meta/recipes-devtools/llvm/llvm/0014-cmake-Fix-configure-for-packages-using-find_package.patch diff --git a/meta/recipes-devtools/llvm/llvm/0014-cmake-Fix-configure-for-packages-using-find_package.patch b/meta/recipes-devtools/llvm/llvm/0014-cmake-Fix-configure-for-packages-using-find_package.patch new file mode 100644 index 000000000000..94c056ab8e0a --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0014-cmake-Fix-configure-for-packages-using-find_package.patch @@ -0,0 +1,117 @@ +From 93141cee493022d9f39dbd1f5f0bb0a1110ac829 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Fri, 31 Jan 2020 10:56:11 +0200 +Subject: [PATCH] cmake: Fix configure for packages using find_package() + +Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) +that depends on LLVM/Clang tries to run cmake find_package() during +do_configure, it will fail with a similar error: + +| The imported target "llvm-tblgen" references the file +| ".../recipe-sysroot/usr/bin/llvm-tblgen" +| +| but this file does not exist. Possible reasons include: +| * The file was deleted, renamed, or moved to another location. +| * An install or uninstall procedure did not complete successfully. +| * The installation package was faulty and contained +| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" +| but not all the files it references. + +This is due to the fact that currently the cmake scripts look for target +binaries in sysroot. Work around this by not exporting the target binaries in +Exports-* cmake files. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + clang/cmake/modules/AddClang.cmake | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 9 ++------- + llvm/cmake/modules/TableGen.cmake | 6 ------ + 3 files changed, 2 insertions(+), 15 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index cdc8bd5cd503..5faa9117a30f 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -182,7 +182,6 @@ macro(add_clang_tool name) + if (CLANG_BUILD_TOOLS) + get_target_export_arg(${name} Clang export_to_clangtargets) + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT ${name}) + +@@ -191,7 +190,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) + endif() + endif() + set_target_properties(${name} PROPERTIES XCODE_GENERATE_SCHEME ON) +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index d3e9377c8d2f..fe22d6f2b35a 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1492,7 +1492,6 @@ macro(llvm_add_tool project name) + if( LLVM_BUILD_TOOLS ) + get_target_export_arg(${name} ${project} export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1503,10 +1502,8 @@ macro(llvm_add_tool project name) + endif() + endif() + endif() +- if( LLVM_BUILD_TOOLS ) +- string(TOUPPER "${project}" project_upper) +- set_property(GLOBAL APPEND PROPERTY ${project_upper}_EXPORTS ${name}) +- endif() ++ string(TOUPPER "${project}" project_upper) ++ set_target_properties(${name} PROPERTIES FOLDER "Tools") + endif() + get_subproject_title(subproject_title) + set_target_properties(${name} PROPERTIES FOLDER "${subproject_title}/Tools") +@@ -1556,7 +1553,6 @@ macro(add_llvm_utility name) + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1565,7 +1561,6 @@ macro(add_llvm_utility name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + elseif(LLVM_BUILD_UTILS) + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) + endif() +diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake +index ffcc718b4777..a76f28e74b86 100644 +--- a/llvm/cmake/modules/TableGen.cmake ++++ b/llvm/cmake/modules/TableGen.cmake +@@ -232,12 +232,7 @@ macro(add_tablegen target project) + + if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND + (LLVM_BUILD_UTILS OR ${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)) +- set(export_arg) +- if(ADD_TABLEGEN_EXPORT) +- get_target_export_arg(${target} ${ADD_TABLEGEN_EXPORT} export_arg) +- endif() + install(TARGETS ${target} +- ${export_arg} + COMPONENT ${target} + RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}") + if(NOT LLVM_ENABLE_IDE) +@@ -248,6 +243,5 @@ macro(add_tablegen target project) + endif() + if(ADD_TABLEGEN_EXPORT) + string(TOUPPER ${ADD_TABLEGEN_EXPORT} export_upper) +- set_property(GLOBAL APPEND PROPERTY ${export_upper}_EXPORTS ${target}) + endif() + endmacro() diff --git a/meta/recipes-devtools/llvm/llvm_20.1.2.bb b/meta/recipes-devtools/llvm/llvm_20.1.2.bb index b51ab703a136..4b24d28364cd 100644 --- a/meta/recipes-devtools/llvm/llvm_20.1.2.bb +++ b/meta/recipes-devtools/llvm/llvm_20.1.2.bb @@ -39,6 +39,7 @@ SRC_URI_SPIRV:append:class-native = " \ SRC_URI = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz \ file://0007-llvm-allow-env-override-of-exe-path.patch \ file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch \ + file://0014-cmake-Fix-configure-for-packages-using-find_package.patch \ ${@bb.utils.contains('PACKAGECONFIG', 'spirv-llvm-translator', '${SRC_URI_SPIRV}', '', d)} \ file://llvm-config \ " From patchwork Wed Apr 16 15:59:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 61439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 794A2C369BD for ; Wed, 16 Apr 2025 15:59:45 +0000 (UTC) Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web10.23110.1744819176476825180 for ; Wed, 16 Apr 2025 08:59:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=Qft/bsb3; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: oss.qualcomm.com, ip: 205.220.180.131, mailfrom: dmitry.baryshkov@oss.qualcomm.com) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mb3J022245 for ; Wed, 16 Apr 2025 15:59:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=HFmv60zzpxB Ot9BfSsOk6nn+Acop19FOvvN5XPXKizs=; b=Qft/bsb3T3qpdxdOyShdjV6vWtC MboMn+++ncbKdVHhfRL4WVFrdXs0tzJg0fjD5kGESnrve3FUx26w0NU6x+vR6/Gv x61Ent3eTCoou5hFCU1cD4J+Nnq/XlB7Wz3ggAHj8FcJhOd2QZqcpxJ8QhXphYCJ gk+R4EY7qhuTb+pXvXzg9ihSzrPg+QxrkK6aIfY6vwjIXgC2ANmBp8j1s9atyqJd 8VbvL+gtPQRud3KpIW9EJfJkRsYRlmjoMqZY47+3XQ5DvQULfnl+kMosnD8xmoXw 244+EZSzW44hGnCZpNZLVbAfLyUUHyw1qTu8p9cC/yNXOg/Os1rlOHLlOAQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45ygj9c1a6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 15:59:35 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c579d37eeeso1019976785a.0 for ; Wed, 16 Apr 2025 08:59:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744819174; x=1745423974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HFmv60zzpxBOt9BfSsOk6nn+Acop19FOvvN5XPXKizs=; b=ixhiH/j8nCuAu2DqrWn0aJmJQIgtCP2RRzC0knAjDhGU5uBozecodqv2wzYVlEMcg2 OBoxYp007JADSYgOfANkwlig5LgLle63y8ZkgIuz3K8Tpqr1d9ZjeaBbO/pS9dnnP6q3 8bvA4mHv6VQswXqtegVTuAj1uOHMgoLfhgScDezgaeakSK2+F1mvw/I+v3iJoM6Uom4i YZSr5Ad3y4Da4DAJJkTYNqGOaR5wE1UbzGX3gFtLiQH/m4s5uKbMzYg6QMoKIQMEmA1T no1cJeM+Xuvh6EtGmmKP4iX6aZX5opY3AYfEz4rO34gQuXk626pVL5rci2x88Hk2FyXY toAg== X-Gm-Message-State: AOJu0YzwBlrIVAOqDbHdTXROzvh223kUlOb5szBiBFGVLYVIypT2GSHz CEu90QJ1ewiVWK99sKstq+wreBBJBzl8T7wEgQ+ERI1Z+6Y2prtWXWzFDyB850c1Irec7kwpa8/ 8kfB7Oc6AHJhVaSXaF17u5b9uIvADQKBrJBAaxOZMVdFyOe1lA29qH1dOHyi/c40fduYC45+nqB uTSwva/AU0uGU= X-Gm-Gg: ASbGnct9wGNMlTd8GdibXzcZA74IclNONv/0/xMwqTzD23iMASrVmbrPf3IBkrBw0ub puW7Cp4SGQTTGvPzLpCUMFPYIjzmSw2qg+H0xqhyeMR/0AGsLhW6fagl/miOMJo1DECrdp9CBK9 NBAbCWeIzPQOPpaie3dDvAqbIIaK21NBCxfHq205w+/CM015oftc0r4+A1s188ftPNKlirccW65 DTvGXSYHpCwL+/xD+dhAzP+TSU43SVIz1d1fcePxZLKrVMuQfP8kj208XaI+7+Kp0irP91CusJR FpFyx2+tYeKsKnQ+xM5HsfntTC3/qENYWpsY1YvlP7KK1vtGazGXzCLxpegXkpR97jbQUtNsUy/ WFiyiIF88JgxmJOGFXf3zU/1s X-Received: by 2002:a05:6214:e89:b0:6ea:d69c:a22e with SMTP id 6a1803df08f44-6f2b3050403mr31858476d6.30.1744819174428; Wed, 16 Apr 2025 08:59:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDSZjCGMTy8igQK5OnOa7wDxALGgwL+uHn4Yz4JpCv+zEs92Dy1pjR2CFJki9h+/cv3Ks0/Q== X-Received: by 2002:a05:6214:e89:b0:6ea:d69c:a22e with SMTP id 6a1803df08f44-6f2b3050403mr31857976d6.30.1744819173947; Wed, 16 Apr 2025 08:59:33 -0700 (PDT) Received: from umbar.lan (2001-14ba-a0c3-3a00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a0c3:3a00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54d5857223csm676550e87.175.2025.04.16.08.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 08:59:33 -0700 (PDT) From: Dmitry Baryshkov To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 2/3] llvm: also install llvm-min-tblgen Date: Wed, 16 Apr 2025 18:59:28 +0300 Message-Id: <20250416155929.2630778-2-dmitry.baryshkov@oss.qualcomm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416155929.2630778-1-dmitry.baryshkov@oss.qualcomm.com> References: <20250416155929.2630778-1-dmitry.baryshkov@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: LootTYi-oDWZJ7bVQXE1cxQTNLbWh7Sw X-Authority-Analysis: v=2.4 cv=PruTbxM3 c=1 sm=1 tr=0 ts=67ffd3e7 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=qQd9_2v_86bFzIgGbuAA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-GUID: LootTYi-oDWZJ7bVQXE1cxQTNLbWh7Sw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 spamscore=0 mlxscore=0 mlxlogscore=887 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160130 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Apr 2025 15:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214996 Some projects are picky and want to hanve llvm-min-tblgen in addition to a normal llvm-tblgen. Install the tool to the sysroot. Signed-off-by: Dmitry Baryshkov --- meta/recipes-devtools/llvm/llvm_20.1.2.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-devtools/llvm/llvm_20.1.2.bb b/meta/recipes-devtools/llvm/llvm_20.1.2.bb index 4b24d28364cd..98855fa4c14d 100644 --- a/meta/recipes-devtools/llvm/llvm_20.1.2.bb +++ b/meta/recipes-devtools/llvm/llvm_20.1.2.bb @@ -159,6 +159,7 @@ do_install() { do_install:append:class-native() { install -D -m 0755 ${B}/bin/llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} + install -D -m 0755 ${B}/bin/llvm-min-tblgen ${D}${bindir}/llvm-min-tblgen install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV} ln -sf llvm-config${PV} ${D}${bindir}/llvm-config From patchwork Wed Apr 16 15:59:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 61440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78608C369BA for ; Wed, 16 Apr 2025 15:59:45 +0000 (UTC) Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web10.23111.1744819177671500873 for ; Wed, 16 Apr 2025 08:59:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=GzjTHjhQ; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: oss.qualcomm.com, ip: 205.220.180.131, mailfrom: dmitry.baryshkov@oss.qualcomm.com) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mDjd005948 for ; Wed, 16 Apr 2025 15:59:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=Ajgp1K65Pa5 yc3L8eALzoHsS+G0L2p+/c+IiE64S2PY=; b=GzjTHjhQDrYBrMz21OS5n2yQ7pk 8lI1Ji6AV3uGcHWuoMzS05/TpFUoOPccTRFyhaR96Xsr7Vzp7ufjU3xFGy0X9xTq r9B1P2yEWUR+88h82/dVn/6tITzY4mVaTOWocdegdDCZKyeNo8Aq9F3GO5e7Ztof OiuJlDrtePjCXG65rWBCLwFVH/0Nps1l6ClXD4c7VRDv0hr3PdSp7GDpPMQYVauN nfVNxAgnb7T/hsAFoZkM5PxEjMfLwoMTNw66x1CJ8qLNreoCeyINLvAx/StUhWne 1upvacL2edSJNjql+EPVjYJA59xbbH481+BvRFq9o2LTP1mmOTuxBT2fFGA== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45ydhqc9c8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 15:59:36 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6e8f9450b19so18845736d6.1 for ; Wed, 16 Apr 2025 08:59:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744819176; x=1745423976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ajgp1K65Pa5yc3L8eALzoHsS+G0L2p+/c+IiE64S2PY=; b=oGL0vTgNzj0G2w5Ja5/c73EfBS3c7JO9CnUF0rc1QUixXxHB2XaVjSpe70wZxbBEsd yJG+N22+H+gd0KRcYoIRNC6xwBsrZ5/pOul6G2bt1w0lfB9helmoPHHSrIHM5/eRC0gN /1aKl6j96vXP4hmjjy5CARIFYDgmA/YvLjkNfHFUkKg9SrWOfvrsEKdKbyyvoe4vC2AU 42bPVTWHtAFaRcKySmRsddl+oxfe2lEFwJ+zSw/+cdk/QZUmh/hYFs5aWWrg0yPhRBu5 m3/aC+ABONkGFm4vHPvl+fE9qR3A0b3Ydbgu6PwNnvi3sOiK6d+Rbzb5fXjCrjZl3xgW IuSA== X-Gm-Message-State: AOJu0YyEFnS3iNIIqn7vRuqIgx2Eosxv3nto65u9Oh57tQOFX1u7PnL6 fGE3sYHXu0v/X7s+lJ63hwTd62PzUofflojhTICA1MSOcjUOek9UVRQpQbEZK4FsEmwf/1ayUN2 1c2bUsP9LhUJEWBWNNYvSIo1SZ720ToO2mwye9ciy/fgeMmC3GRNrEbebwK/I6hpgk/J7m2VDwK LxHC5wpzu32XI= X-Gm-Gg: ASbGncs3JCIekRd6VXy4mZoZ2vMQmlpOb/gsO400SZVfFFLzCQSAlCUfI0n3qdWA4Os JbZ98aIHUnfOrMCqyPJsix9OLyAjR5fyN6KExLo8I9rBFA3vUax6ub1yf9W2OR8w7rpwNXAMdFr vAaWBdkyyVU2VPCy8DPqKdDT4NEs7lclNs7zdv5b0aFbWBV9v3K3CAE+duv7MGU7wWmrK5HgOv6 uWSwztYVP57LYw8OYAB/xI+UEOtzIkmkJvH9cXUZ7nd/ikUa4MGsSKvrBUqV45xKsjfF+DTbmA+ EfiuN6iWUk6wfbuLtoBCKdO7wSnXSstzJ/ui5DNvFTcIHB7khCtplvqnRAUabCEdJaMWNNZBU2s 5He8tI4Fm4WoHDLa7ePPxE1f0 X-Received: by 2002:a05:6214:1d0a:b0:6ea:eeb6:c82b with SMTP id 6a1803df08f44-6f2b9955501mr910876d6.2.1744819175834; Wed, 16 Apr 2025 08:59:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHy5AxNrxZlaSq5MHep6hPwIujk/BQX449iVA8d+lkIRMU4PXpUiyRBIT2y/hlt9TaTkmycZw== X-Received: by 2002:a05:6214:1d0a:b0:6ea:eeb6:c82b with SMTP id 6a1803df08f44-6f2b9955501mr910446d6.2.1744819175378; Wed, 16 Apr 2025 08:59:35 -0700 (PDT) Received: from umbar.lan (2001-14ba-a0c3-3a00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a0c3:3a00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54d5857223csm676550e87.175.2025.04.16.08.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 08:59:34 -0700 (PDT) From: Dmitry Baryshkov To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 3/3] mesa: bundle Clang OpenCL headers into meta-clc Date: Wed, 16 Apr 2025 18:59:29 +0300 Message-Id: <20250416155929.2630778-3-dmitry.baryshkov@oss.qualcomm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416155929.2630778-1-dmitry.baryshkov@oss.qualcomm.com> References: <20250416155929.2630778-1-dmitry.baryshkov@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: BWetrUyeLfwoylJweDGh49b-N9ezqbYk X-Authority-Analysis: v=2.4 cv=C7DpyRP+ c=1 sm=1 tr=0 ts=67ffd3e8 cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=e5mUnYsNAAAA:8 a=ZpVaWaFtAAAA:8 a=EUspDBNiAAAA:8 a=smLMKbEpzHjB7PiwKtkA:9 a=OIgjcC2v60KrkQgK7BGD:22 a=Vxmtnl_E_bksehYqCbjh:22 a=5tn4MO8azEBWFjlAA-rn:22 X-Proofpoint-GUID: BWetrUyeLfwoylJweDGh49b-N9ezqbYk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 clxscore=1015 spamscore=0 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160130 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Apr 2025 15:59:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/214997 Add a patch bundling OpenCL headers into meta-clc. This removes extra runtime dependencies when runnign meta-clc compiler. Signed-off-by: Dmitry Baryshkov --- ...option-to-force-inclusion-of-OpenCL-.patch | 57 +++++++++++++++++++ meta/recipes-graphics/mesa/mesa.inc | 3 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-graphics/mesa/files/0001-mesa-clc-add-an-option-to-force-inclusion-of-OpenCL-.patch diff --git a/meta/recipes-graphics/mesa/files/0001-mesa-clc-add-an-option-to-force-inclusion-of-OpenCL-.patch b/meta/recipes-graphics/mesa/files/0001-mesa-clc-add-an-option-to-force-inclusion-of-OpenCL-.patch new file mode 100644 index 000000000000..567c1f7e1b44 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-mesa-clc-add-an-option-to-force-inclusion-of-OpenCL-.patch @@ -0,0 +1,57 @@ +From f9b6175e7c446a82c568ff1a214885d707c95f49 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Wed, 16 Apr 2025 14:35:37 +0300 +Subject: [PATCH] mesa-clc: add an option to force inclusion of OpenCL headers + +Currently mesa-clc bundles OpenCL headers from Clang only if the static +LLVM is used (which means Clang / LLVM are not present on the target +system). In some cases (e.g. when building in OpenEmbedded environemnt) +it is desirable to have shared LLVM library, but skip installing the +whole Clang runtime just to compile shaders. Add an option that forces +OpenCL headers to be bundled with the mesa-clc binary. + +Signed-off-by: Dmitry Baryshkov +Upstream-Status: Inappropriate [OE-Specific https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34551] +--- + meson_options.txt | 10 ++++++++++ + src/compiler/clc/meson.build | 3 ++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/meson_options.txt b/meson_options.txt +index 18da31eff507..addd274ecef7 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -797,6 +797,16 @@ option( + description : 'Install the mesa-clc compiler (if needed for cross builds).' + ) + ++option( ++ 'mesa-clc-bundle-headers', ++ type : 'combo', ++ value : 'auto', ++ choices : [ ++ 'enabled', 'auto' ++ ], ++ description : 'Bundle the OpenCL headers into the mesa-clc binary (default to bundle if static LLVM is used)' ++) ++ + option( + 'precomp-compiler', + type : 'combo', +diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build +index 263eba527191..9ff61440f0da 100644 +--- a/src/compiler/clc/meson.build ++++ b/src/compiler/clc/meson.build +@@ -11,7 +11,8 @@ _libmesaclc_c_args = [] + _libmesaclc_cpp_args = ['-DLLVM_LIB_DIR="@0@"'.format(llvm_libdir)] + _libmesaclc_sources = [] + +-if not _shared_llvm ++if not _shared_llvm or \ ++ get_option('mesa-clc-bundle-headers') == 'enabled' + # LLVM 16 moved clang header path from using full version to only major version + if dep_llvm.version().version_compare('< 16') + # Prior to LLVM 16, this path used a full version +-- +2.47.2 + diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index c191e68b5841..6660fb65374f 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -18,6 +18,7 @@ SRC_URI = "https://archive.mesa3d.org/mesa-${PV}.tar.xz \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ file://0001-meson-disable-SIMD-blake-optimisations-on-x32-host.patch \ file://0001-freedreno-don-t-encode-build-path-into-binaries.patch\ + file://0001-mesa-clc-add-an-option-to-force-inclusion-of-OpenCL-.patch \ " SRC_URI[sha256sum] = "adf904d083b308df95898600ffed435f4b5c600d95fb6ec6d4c45638627fdc97" @@ -193,7 +194,7 @@ MESA_NATIVE:class-native = "" PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm" PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils" -PACKAGECONFIG[libclc] = "-Dmesa-clc=${MESA_CLC} -Dinstall-mesa-clc=${INSTALL_MESA_CLC},,libclc spirv-tools spirv-llvm-translator ${MESA_NATIVE}" +PACKAGECONFIG[libclc] = "-Dmesa-clc=${MESA_CLC} -Dinstall-mesa-clc=${INSTALL_MESA_CLC} -Dmesa-clc-bundle-headers=enabled,,libclc spirv-tools spirv-llvm-translator ${MESA_NATIVE}" PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled" PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"