From patchwork Fri Nov 7 23:06:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 73979 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 E00C8CCF9F8 for ; Fri, 7 Nov 2025 23:06:23 +0000 (UTC) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.1160.1762556780900261766 for ; Fri, 07 Nov 2025 15:06:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VJg25Gmk; spf=pass (domain: gmail.com, ip: 209.85.216.47, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-3436d6aa66dso127746a91.1 for ; Fri, 07 Nov 2025 15:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762556780; x=1763161580; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JynNlKzpVBb389fKI7UOdDhwQEr3kuPDoM825xicWq4=; b=VJg25GmkraOLGXmJ/T+gQAO94P5Bs2MrDTI/o5Zq54on1KIomHoq98gExMKE8JpcvQ onKqpv+uwELUHxuXdlu/Va2jnCJIkToimRaIPX+Vesq9weRDDvgiUsZvpoOcddnDe9y5 IXGfF5lENty+DzYJAGDi0KU7JoqXb5YZBSjCO1U1hG2+6CCJfC0dRejhM7R+FM3VnmXM PTxKlg+4njdvINkJnrPbv77mrR0jOwbym5MvJzmOJkRkHLrn2Q8Go6S3rvmRDTBF9/pQ WZlaTa6aYUSqx1sE2Le2rlSxarV7kRKUh37i+57ByUN/Xihm3teCjJsME5Y8dgBb6qJQ ikpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762556780; x=1763161580; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JynNlKzpVBb389fKI7UOdDhwQEr3kuPDoM825xicWq4=; b=vWdptxi5PzF2n+tyRHQNmL5F1NHXrdLPxxifFnHS78tKJRC8+Q8SV0alJybxWWFRxU fWr6SvJ5Q8UD+isVhgJRfCZLRxFPXPZ0HmBIX9GsmsdLSzd1nQ3y4y9HYLU3xXjZyrKZ /L+3YOkP6Vx1/1SAolR5zc24jiU9zy2oAmk2O1Ztck8imQhIwf4HjFnx+T8ihDwYJT0d GnlglpC7SQ2eO7bfQevaJ2VGRw7DMA2dXR7ZXhiIqVFtdRk6Lj2d1rHjNBAWdB1qqhHF T0wHqnr8DgMlDslR6KqcphaG8d/ZPE9QcYyJaE1m73HU5/VGFgqbv1mtIhoiJODEpI3J aZlA== X-Gm-Message-State: AOJu0YzQWEjSrllmwoimwD/OYhjojpn3kJci4yETVJoiyIlhxkUIk0P/ uCBt1eklPV0MUvlQq3zv6GksZ/CFzxIPSCHWWXu0WKZo7Ffresn9QKzoKFuWMISuIqA= X-Gm-Gg: ASbGncumFxLL2rBVuNQTJlzLJnZCv8lemZyGmU3a/K3tn+cIAbbeKz9zLWsOshl/7yV DDd0tqdqY5pQlD84wc/GpsMhL/a7hF4AieJW1/evRmChUhYHI+NQTgasfQerxAGwT03XatwFyfx B4tM9myrGdDKKp0BEK6ahDUgbqCVaII0VDz/X8H7c5OgYAqsBjTrtigaWmTtp2yFsEgxSJiYiZd eqqteQgvcxJGUe4ETQ4wRWt4etAJ1oIjPsA004DEuu798FpFlNMAqqcOX2hMRmi1cHUXBUOezQX euPIN6swoZFEBDQtmzy1xrpE+cCZquqhTL3L/kHgeKgPjUyWtkF+rIEE2zLSAche8MxwVJe6VxI Gshoo2UHBdPuw9ycvY4mlNq0uLuaqwG/ircvpHK/YR0Fw9Q9FeKpLw0/MEOq6z6trNRkII/rmL9 nhd4rfzATj9Mo439cFErfoTnPEgfVJ1eYVlCKXmzXyOnLxu3JX/nHnSd0wXD8gU1rA0KX4cWB8 X-Google-Smtp-Source: AGHT+IE5o5xPs9Z80006FsPOroFcwBi6RoxuX/scnCdFiXmFcQAsdX2uyra0u4a/XargcoSuKFMjwQ== X-Received: by 2002:a17:90b:1644:b0:33d:5e2a:891b with SMTP id 98e67ed59e1d1-343537796edmr4295487a91.14.1762556779850; Fri, 07 Nov 2025 15:06:19 -0800 (PST) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::888a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a69b626csm10526282a91.19.2025.11.07.15.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 15:06:19 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 1/6] clang: Fix libgcc.so.1.0 symlink to point to libunwind.so.1 Date: Fri, 7 Nov 2025 15:06:12 -0800 Message-ID: <20251107230617.364804-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.51.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Nov 2025 23:06:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226068 Pointing to libunwind.so results in build QA errors since libunwind.so ends up in -dev package Signed-off-by: Khem Raj --- ...symlink-path-for-libcc-when-LLVM_ENA.patch | 33 ++++++++ ...libgcc.a-symlink-path-when-LLVM_ENAB.patch | 83 +++++++++++++++++++ meta/recipes-devtools/clang/common.inc | 4 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/clang/clang/0040-llvm-libgcc-Fix-symlink-path-for-libcc-when-LLVM_ENA.patch create mode 100644 meta/recipes-devtools/clang/clang/0041-llvm-libgcc-Fix-libgcc.a-symlink-path-when-LLVM_ENAB.patch diff --git a/meta/recipes-devtools/clang/clang/0040-llvm-libgcc-Fix-symlink-path-for-libcc-when-LLVM_ENA.patch b/meta/recipes-devtools/clang/clang/0040-llvm-libgcc-Fix-symlink-path-for-libcc-when-LLVM_ENA.patch new file mode 100644 index 00000000000..f385dc83ea5 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0040-llvm-libgcc-Fix-symlink-path-for-libcc-when-LLVM_ENA.patch @@ -0,0 +1,33 @@ +From 4204fd1b62de30418433139fea1b7dad4fff9c59 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 28 Oct 2025 15:44:49 -0700 +Subject: [PATCH] [llvm-libgcc] Fix symlink path for libgcc + +The symlink for libgcc_so.1.0 is made to point to libunwind.so +which is functionally correct but it fails some linux distro packaging +complain because libunwind.so is made part of -dev package but +libgcc_so.1.0 ends up in the real package, and creates an unneeded +package -> dev dependency + +create the symlink to point to libunwind.so.1 instead then the boundaries +of packaging are not crossed and all is well. + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/165487] +Signed-off-by: Khem Raj +--- + llvm-libgcc/CMakeLists.txt | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt +index 47208fc19869..54009c1104c3 100644 +--- a/llvm-libgcc/CMakeLists.txt ++++ b/llvm-libgcc/CMakeLists.txt +@@ -137,7 +147,7 @@ add_custom_target(llvm-libgcc ALL + DEPENDS unwind_shared unwind_static clang_rt.builtins-${COMPILER_RT_DEFAULT_TARGET_ARCH} + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLVM_LIBGCC_COMPILER_RT} libgcc.a + COMMAND ${CMAKE_COMMAND} -E create_symlink libunwind.a libgcc_eh.a +- COMMAND ${CMAKE_COMMAND} -E create_symlink libunwind.so libgcc_s.so.1.0 ++ COMMAND ${CMAKE_COMMAND} -E create_symlink libunwind.so.1 libgcc_s.so.1.0 + COMMAND ${CMAKE_COMMAND} -E create_symlink libgcc_s.so.1.0 libgcc_s.so.1 + COMMAND ${CMAKE_COMMAND} -E create_symlink libgcc_s.so.1 libgcc_s.so + ) diff --git a/meta/recipes-devtools/clang/clang/0041-llvm-libgcc-Fix-libgcc.a-symlink-path-when-LLVM_ENAB.patch b/meta/recipes-devtools/clang/clang/0041-llvm-libgcc-Fix-libgcc.a-symlink-path-when-LLVM_ENAB.patch new file mode 100644 index 00000000000..789d6d727a3 --- /dev/null +++ b/meta/recipes-devtools/clang/clang/0041-llvm-libgcc-Fix-libgcc.a-symlink-path-when-LLVM_ENAB.patch @@ -0,0 +1,83 @@ +From 919fcd11ad53bdfab9a14d5df6de0895bf24e456 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 28 Oct 2025 19:02:44 -0700 +Subject: [PATCH] [llvm-libgcc] Fix libgcc.a symlink path when LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF + +The llvm-libgcc installation was creating incorrect symlinks for libgcc.a +when built with LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF, particularly seen with +Yocto cross-compilation environments. + +Issues seen: + +- Absolute path in symlink: The previous code didn't handle absolute paths + returned by get_compiler_rt_install_dir() in staging/sysroot environments, + resulting in symlinks like: + libgcc.a -> /absolute/path/to/sysroot/usr/lib/clang/.../libclang_rt.builtins.a + +- Missing architecture suffix: When the install path contained "clang", the + code would skip setting builtins_suffix, creating: + libgcc.a -> clang/21.1.4/lib/linux/libclang_rt.builtins.a + instead of: + libgcc.a -> clang/21.1.4/lib/linux/libclang_rt.builtins-aarch64.a + +- Incorrect relative path calculation: The original regex stripped too much + or too little of the path, either creating symlinks pointing to non-existent + locations or stripping the clang/ directory prefix entirely. + +Solution: + +- Extract the relative path starting from 'clang/' when present in absolute + paths, ensuring the symlink points to the correct location within the + installation hierarchy +- Always append the architecture suffix to the builtins library name +- Only prepend '../' to the path when LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is + enabled, as this is when the builtins are in a different directory level + +The symlink now correctly points to the existing compiler-rt builtins library +without creating duplicate copies. + +Tested with LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF in cross-compilation +environments (aarch64 target). + +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/165487] +Signed-off-by: Khem Raj +--- + llvm-libgcc/CMakeLists.txt | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +diff --git a/llvm-libgcc/CMakeLists.txt b/llvm-libgcc/CMakeLists.txt +index cd9c5011d410..ee7fe768bda0 100644 +--- a/llvm-libgcc/CMakeLists.txt ++++ b/llvm-libgcc/CMakeLists.txt +@@ -124,11 +124,27 @@ target_link_libraries(unwind_shared PUBLIC + #=============================================================================== + + get_compiler_rt_install_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} install_dir_builtins) +-string(REGEX REPLACE "^lib/" "" install_dir_builtins "${install_dir_builtins}") +-string(FIND "${install_dir_builtins}" "clang" install_path_contains_triple) +-if(install_path_contains_triple EQUAL -1) +- set(builtins_suffix "-${COMPILER_RT_DEFAULT_TARGET_ARCH}") ++ ++# Extract the relative path starting from 'clang' or after 'lib/' ++if(IS_ABSOLUTE "${install_dir_builtins}") ++ # For absolute paths, extract starting from 'clang/' if it exists ++ string(REGEX MATCH "clang/.*$" install_dir_builtins_temp "${install_dir_builtins}") ++ if(install_dir_builtins_temp) ++ set(install_dir_builtins "${install_dir_builtins_temp}") ++ else() ++ # Fallback: strip up to first lib/ ++ string(REGEX REPLACE "^.*/lib/" "" install_dir_builtins "${install_dir_builtins}") ++ endif() + else() ++ string(REGEX REPLACE "^lib/" "" install_dir_builtins "${install_dir_builtins}") ++endif() ++ ++# Always add the architecture suffix ++set(builtins_suffix "-${COMPILER_RT_DEFAULT_TARGET_ARCH}") ++ ++# Only prepend ../ when using per-target runtime directories ++string(FIND "${install_dir_builtins}" "clang" install_path_contains_triple) ++if(install_path_contains_triple GREATER -1 AND LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) + string(PREPEND install_dir_builtins "../") + endif() + set(LLVM_LIBGCC_COMPILER_RT ${install_dir_builtins}/libclang_rt.builtins${builtins_suffix}.a) diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc index 20adbf2610f..2b76c690588 100644 --- a/meta/recipes-devtools/clang/common.inc +++ b/meta/recipes-devtools/clang/common.inc @@ -38,7 +38,7 @@ SRC_URI = "\ file://0016-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ file://0017-clang-Use-python3-in-python-scripts.patch \ file://0018-llvm-clang-Insert-anchor-for-adding-OE-distro-vendor.patch \ - file://0019-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0019-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ file://0020-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ file://0021-libunwind-Added-unw_backtrace-method.patch \ file://0022-lldb-Link-with-libatomic-on-x86.patch \ @@ -59,6 +59,8 @@ SRC_URI = "\ file://0037-Revert-libc-Remap-headers-in-the-debug-info-when-bui.patch \ file://0038-Prevent-revisiting-block-when-searching-for-noreturn.patch \ file://0039-Only-build-c-index-test-when-clang-tests-are-include.patch \ + file://0040-llvm-libgcc-Fix-symlink-path-for-libcc-when-LLVM_ENA.patch \ + file://0041-llvm-libgcc-Fix-libgcc.a-symlink-path-when-LLVM_ENAB.patch \ file://0001-Install-lldb-tblgen.patch \ file://0001-dont-expose-LLVM_HAVE_OPT_VIEWER_MODULES.patch \ file://0001-clang-Support-building-native-tools-when-cross-compi.patch \ From patchwork Fri Nov 7 23:06:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 73980 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 E2E2CCCFA18 for ; Fri, 7 Nov 2025 23:06:33 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1143.1762556782206322046 for ; Fri, 07 Nov 2025 15:06:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nE+yGCaw; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-33ff5149ae8so795184a91.3 for ; Fri, 07 Nov 2025 15:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762556781; x=1763161581; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gFnWMb9R89S6o/JDaVaFchrWpYMS/UxWW3T7IeGGnvI=; b=nE+yGCawB/PQ715VS5ZdDgpQja291LNOVtCZyOctAc0aX0dc48eNM26ssgFcR7Ve8/ GCWwRGMDW+YR0nq0lAURSR75I8xZF6dTxZcuY3BtnvHh5UexFnn/tB5HJdUBz/kPpiVT 2GqhWwZ8aS/ln+x/cbOKvkEaNyDvaPMbhgnUVGJGrcikSaN8OAoIphnyYuWvqmbMre0a kIBeqhjy+/jjvS/k7ArQ/QNyJechsKov7PvRV3Fq5BaRAWh7THxixdAFmaZeh8yVvoCC xRvnJRkJjQU0KaNQ2B0bKWAwDECZy9HbO6wRqE7oXvzOOXg0KzqcuMZP+bB6JkVMmoRh nSSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762556781; x=1763161581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gFnWMb9R89S6o/JDaVaFchrWpYMS/UxWW3T7IeGGnvI=; b=cdjxhSrF1eDpuT+ag8SYRHlRKpB8baO+Mv/mY4Iya/zOe68awJMApJQxKUQZZM7Gux geycjSo1oeNTvq+DLzksWKzRZ8ppoHx7ClkfgA3xvPha4owyz+HVEbdgIGTmcLeKjHLD ac8FangDEWRMq8czPOLzn257CjdKmeFxjbRzANUA+vBHCa1MT/szqXT4118EGa6ROYMt 7C3qvZyKjMaeai4JzNmMRd9dPVI7eoSHWzanKS7IprQV1y7sy40ahEMPTNJungZJO07c Np3R1TBQqFzi/BoBnYNohUzuwVi2+2Zxp0Pomwtq91hwOfK7dfreZyLycvsvy9RLAE4w NOaA== X-Gm-Message-State: AOJu0YzUTwZi8RzgXUW/hrPYP9AkRnDBPPRIhGbWblS6SYHRv12vFG94 n/v23RCnZxh4jJb6WDAXhAcSDWOpCP+V7WMnBsdm9yKneTs1do5cjsW2nIyTbqdxX6k= X-Gm-Gg: ASbGncuw3ttvpYkyaCuuoTKnGSTTWu12J9TD+396OrPPu8Cf5bnXie90XH6jNKq6TKK l3xHe08eSup8rr8TDOFvkdcMnIDW+/kdKOjtARKb4bfXmDKOiobaYHyn6raayU83ti9XsfMpAa9 d8XTzaBgkWU1MiVX/pzEiMQqhdvIYP67dPlhzA1JWbcc4dpdqHxKgmuTO1pqbvjbEIrwGCf3BKr ht51eCqUbDPYvYwkJFEma1a5v3sXsORqa/xRb3NFFA2VXGGPj2o7Ty1Xk4F2PKCpph+sH1SsJKx IrO48G4R14cxiHtw/TSADPoh7RQ1xwVukFNnYbGREX0X3M1U9F9KUlD7nE7OJFz8+oGVyX5BWLD YPqtaoQD4IpQLq9Rkc724LlTCiHzK3IR54m4oHaSVl5p3oQNOlzVriGVeIeeWYwq8xs33Fvl1ke PuXBSLlANvKLhv6Fc/YhvyC3cTlc4tNGnVISJc0fDLEP99Vm7XilPcWhIlnSnviQ== X-Google-Smtp-Source: AGHT+IEifayCyIqBP0Na/DnhdoVMMXA2eXrL44zAK9mzVrWSp4dP+tqFz+97RtULBlbLTUtABah6Iw== X-Received: by 2002:a17:90b:4a81:b0:340:ff89:8b63 with SMTP id 98e67ed59e1d1-3436cbf3965mr784076a91.22.1762556781251; Fri, 07 Nov 2025 15:06:21 -0800 (PST) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::888a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a69b626csm10526282a91.19.2025.11.07.15.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 15:06:20 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 2/6] compiler-rt: Remove the need to depend on libgcc Date: Fri, 7 Nov 2025 15:06:13 -0800 Message-ID: <20251107230617.364804-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251107230617.364804-1-raj.khem@gmail.com> References: <20251107230617.364804-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Nov 2025 23:06:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226069 libgcc is only used in cmake tests for compiler checks which works in contained environment like OE, add depedencies on native version of compiler-rt and libcxx for compiler to use Do not build orc builtins, its only needed for JIT which OE does not use. Signed-off-by: Khem Raj --- meta/recipes-devtools/clang/compiler-rt_git.bb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index 8cf11edf85f..f42f17e9ba6 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -25,9 +25,8 @@ TUNE_CCARGS:remove = "-no-integrated-as" INHIBIT_DEFAULT_DEPS = "1" -DEPENDS += "libgcc" -DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" -DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime" +DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc libcxx-native compiler-rt-native" +DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS}" DEPENDS:append:class-native = " clang-native" DEPENDS:remove:class-native = "libcxx-native compiler-rt-native" @@ -76,6 +75,8 @@ INSTALL_VER ?= "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" INSTALL_VER:class-native = "${@oe.utils.trim_version("${PV}", 1)}" EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_COMPILER_WORKS=ON \ + -DCMAKE_CXX_COMPILER_WORKS=ON \ -DCOMPILER_RT_STANDALONE_BUILD=ON \ -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_BUILD_XRAY=OFF \ @@ -100,6 +101,7 @@ EXTRA_OECMAKE:append:class-target = "\ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCOMPILER_RT_BUILD_ORC=OFF \ " EXTRA_OECMAKE:append:class-nativesdk = "\ @@ -111,14 +113,13 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCOMPILER_RT_BUILD_ORC=OFF \ " do_install:append () { if [ "${HF}" = "hf" ]; then mv -f ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/libclang_rt.builtins-arm.a \ ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/libclang_rt.builtins-armhf.a - mv -f ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/liborc_rt-arm.a \ - ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/liborc_rt-armhf.a fi } From patchwork Fri Nov 7 23:06:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 73981 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 E1EEFCCF9E3 for ; Fri, 7 Nov 2025 23:06:33 +0000 (UTC) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1144.1762556783320336883 for ; Fri, 07 Nov 2025 15:06:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lL0nkOKJ; spf=pass (domain: gmail.com, ip: 209.85.216.42, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-3436d6bdce8so216442a91.3 for ; Fri, 07 Nov 2025 15:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762556782; x=1763161582; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=697pTWrzF/GJkmzrh8Vwe/3efvUhh9ru/Otr6GOdT4M=; b=lL0nkOKJcK+hdQARVtgInSi5/RZ04/C1ykR8MJ/yikoVV4uQ9S26UgLl6F8j2Y2gSg DGbisk2wrCHzWLyNnTmZoGhk2EqLycHWAdE4CJN0Dyhbr9Lo4qFgShKq7JgHXzLXdGTF csQiSV9UPwLg34Nc0MQdWqMITtdTBSgKkJBMetBbwjwQkELxNx6Uy9T6k+l2NI3ywsOM /5ngsX2j+cZfak+f/AR4NlhclC9hG+g6kjL407ClS3LfA0dhZ2DOZuJ0iVe/lEWAsP4K MQZBBNun9/PK6i/DnFpqihUCatGwKV+nkWVxpOR409RgeIF/ImJebQdjsUG4t1m4BF+P kBuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762556782; x=1763161582; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=697pTWrzF/GJkmzrh8Vwe/3efvUhh9ru/Otr6GOdT4M=; b=J3L5wKPrZqK1k8/EBAWTvSeLkksf4/ieUq2pq3ZomORStF1TyV48DR5iWrllk83XzG sbuOqihrN88KMbH0jANwAzOnrfMN3XAo0DGLmbCPR1A7y93dfCHEGU866j+gvtEcp6v6 p4ZyaHpz1AgtmjxUtCL0p4tlp1UTuTSU2BfHL3paoZY+JChpqZPQVf2K1jnVz6vurxsD cbx5ylbTj2RK19+E5vpHIprTz7ogmW52AXhHT4nfTlUufbrGmNvpJZPCbM1H+vGkR9Ha QgxUqgj/C3qE4/G6Feeg5ntQpSuCBg8rEeuPw9XIw8X0nRpyT0cmsr4b+J840IWXc6Qi qeiA== X-Gm-Message-State: AOJu0YxZ3saRuUfURGSNtJokfGIs66Vt+3Aa0RpwrlYLjUPLaxWOLbA7 oZxAqHHa8yFxAeCft8AbMy2jPnuqDH6oAEwQONPP1vb5sNgMvqVFaAWo3z7fvBfq3pA= X-Gm-Gg: ASbGnctwEQhw+f0qDWPjxMM43ov8pFXvDheSkYn1WPnXvNuwrgBOW6vhV0XwySOzIyf hD8Pny5Vg49a9Hq856GAOLPKHVGgtd0hmwRyz03Jx1T3oiRX0Rd8PXdBOfdyxUMYW9iCaHRp0wM k4ccFwKadkXYHVm7y/8CasoJCxVA7U39Y5U10DndXwsSEWQn8WEDH45OXlyBm2Ev8FMyRPei2WE LBay+GyJ9QkmQaFzaIMs7xWx3e41gXUs6DwYTqx5VmuqPuYPqBhbnyCr/45bMM1PEc/aVxHsef/ bFkPmbL/QuMGy6YumpGbzlSuULuw9lC/9A0wXtumgME8tcVWUq07MyJb0r34qRNtZl8jOzI/Xbf cOAS6FgVEFipjAj1yw4slDftiYH1XO9445MY4HhS3bg83vvVLqHpvjSpoJnbj1HqiVu4IW+P+Ot ZlBkHstlc4UKVoN8cBxCCJGozDaFHbawIFnfp4D0xhLjvyDjVDLh8cQoOj5rliAw== X-Google-Smtp-Source: AGHT+IHcdl9806UMrwglMZG1aHqmPvLQdf+VQbSzgAu5DJFQssa/NquKlpP8teax8wZVRRDqtY75+w== X-Received: by 2002:a17:90b:2788:b0:341:719b:768e with SMTP id 98e67ed59e1d1-3436cb7b675mr788281a91.2.1762556782417; Fri, 07 Nov 2025 15:06:22 -0800 (PST) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::888a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a69b626csm10526282a91.19.2025.11.07.15.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 15:06:21 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 3/6] compiler-rt: Always build c runtime (crt) files Date: Fri, 7 Nov 2025 15:06:14 -0800 Message-ID: <20251107230617.364804-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251107230617.364804-1-raj.khem@gmail.com> References: <20251107230617.364804-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Nov 2025 23:06:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226070 Makes llvm runtime provide another step towards providing platform C/C++ runtime Signed-off-by: Khem Raj --- meta/recipes-devtools/clang/compiler-rt_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index f42f17e9ba6..b849b64515a 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -41,7 +41,7 @@ UNWINDLIB:class-target = "--unwindlib=libgcc" COMPILER_RT:class-target = "-rtlib=libgcc" LIBCPLUSPLUS:class-target = "-stdlib=libstdc++" -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "crt" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" PACKAGECONFIG[profile] = "-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" # Context Profiling, might need to enable 'profile' too From patchwork Fri Nov 7 23:06:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 73983 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 F082ACCF9F8 for ; Fri, 7 Nov 2025 23:06:33 +0000 (UTC) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1146.1762556784487285731 for ; Fri, 07 Nov 2025 15:06:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ggEdvS9r; spf=pass (domain: gmail.com, ip: 209.85.216.42, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-3414de5b27eso990192a91.0 for ; Fri, 07 Nov 2025 15:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762556784; x=1763161584; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MSLxkLkGRUnVwwE5/hmrbzstWBNNkJ+nQgum/BsKohQ=; b=ggEdvS9riVLegBRfEQ+MzMBmpz1jNWSoj0I7/mNmqCIhQlbalLbIYPDaEmGWNyuBeL vjODtDE/2QEzSfq2LNUcQDgOUnyfSSJcP8V2j6WLHR/4hOT3do3943VCt9GtuUOTu3y1 neXEwRzMTkgaAvNjhnGP+i4ts/TJxLK+wP6ru2OLVIZ3zyGCV1PmnghkvY2Ei2+ellJ9 +DKaKctYh3cZ4k0OvUEcMtbM+E0V4xjZwCsOVkBxwPPioHMGXpaqIDb1vGYa/xMxa11z XH4tZfh5Znmn8fXrTOF8b5xfVMwriwxU+XWlsytY+NCa7RmYdPlD+UGesRDbY3Qbxz8E QdXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762556784; x=1763161584; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MSLxkLkGRUnVwwE5/hmrbzstWBNNkJ+nQgum/BsKohQ=; b=p0V/DzgBBFMpM/dFOkGeobbni4OaHWjq/HJg+t6VcRn0610ped8HK/f2R302T7foZH dFRmoKkWGIAYrJM+W01hu7ehnEpo3Y1kFA8xpkCsJDJ774uVjCP6dgj8iw5MFa4qvTUi 1klGeTOemRdD3dqRoPsHSZ6GcQFooc7ZJux+PzSOheQgcj3G+pw88Bd+SBjLaP6nQWU9 aFutMxLEM/PgietJQsSAtfkSG0HJWabBpEbB2oSPJkWMahAorAubGUbmCc9ev/p32gT3 EcpkGOQvb71GW5/nrYwjV2SfTULGOiagzb0onCbdD6qLkvbDPTQZZFIqpYeDzE/eN+EM 7uJQ== X-Gm-Message-State: AOJu0Yy77a7LKtMQBVE/zErV/hD6Uxoy8jzEcYbKSK19n/TTOoPBiz3U 6CvWZfbwpYbhrKrF9Mh7L30z7w+rsW1N/1hpUECd1F8MN9CUynRph66rQaRjm41LczI= X-Gm-Gg: ASbGnctmkHEMLEKfov8G5+BuKmwxfB4ozsDbk86dB6bLngxXGzsB1DHVLZ4WRbUPrLk BqZSFM5/UU/CuwfJvNphdR+i0H1wCFrQzETBVfV+vOfUoTlf2RDsdNHnvnyGKeMq48IA2duCjl3 jOafkCU6ON+CfDMcFp6bePFIy7nFJ0ITs11Y0sGyf95k+HIs41okCk/rtOV5kAsFnC2fre72W1o Vs8CeWazVyYww+kqCuToWnTifBntTsES6JwU7H9UIdI5MV7xWh9bwkl2r7Xy5o/ftpx6Lbdc+Y9 AKfTyloQ8jhPP6yD4HoipcYfVdYHHvyOPOwwjS8bc9i8Fai/1c0iGV4Cm5hsgOI5TKncLONHdVz yluz7ZhgVC7phB2oLhovj2Ok8i1/VbwuTAzSRbiNke4qb1OPApAZ0u4fPfJeTujErZ+iy+XwPto 2iQ+/x3FPGqTdVNdqxXII4ONJnsCyQxcxxphAXZ+2aUSvcZRVcTfynWQTDydfIAQObs3vED9Sy X-Google-Smtp-Source: AGHT+IHwtSGQcGRXGJFaMGW2/K8mFOxUN1c5+QLAfcWM7SXgRrMBPzbMQM0Xfvg0scj3w0JhhE406w== X-Received: by 2002:a17:90b:3904:b0:341:8c15:959e with SMTP id 98e67ed59e1d1-3436cb91af6mr1144529a91.17.1762556783559; Fri, 07 Nov 2025 15:06:23 -0800 (PST) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::888a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a69b626csm10526282a91.19.2025.11.07.15.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 15:06:22 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 4/6] libcxx: Remove gnu runtime from dependencies Date: Fri, 7 Nov 2025 15:06:15 -0800 Message-ID: <20251107230617.364804-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251107230617.364804-1-raj.khem@gmail.com> References: <20251107230617.364804-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Nov 2025 23:06:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226071 There is no need to have these dependencies if we can cache some of cmake values, it really does not need these packages to build or run It also simplifies the depchain a bit. Signed-off-by: Khem Raj --- meta/recipes-devtools/clang/libcxx_git.bb | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb index c630bd973ea..1cea430e6ba 100644 --- a/meta/recipes-devtools/clang/libcxx_git.bb +++ b/meta/recipes-devtools/clang/libcxx_git.bb @@ -12,7 +12,7 @@ inherit cmake BPN = "libcxx" -PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind unwind-shared", "", d)}" +PACKAGECONFIG ??= "compiler-rt exceptions unwind ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind unwind-shared", "", d)}" PACKAGECONFIG:append:armv5 = " no-atomics" PACKAGECONFIG:remove:class-native = "compiler-rt" PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," @@ -22,19 +22,20 @@ PACKAGECONFIG[compiler-rt] = "-DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_USE_COMPIL PACKAGECONFIG[unwind-shared] = "-DLIBUNWIND_ENABLE_SHARED=ON,-DLIBUNWIND_ENABLE_SHARED=OFF,," PACKAGECONFIG[unwind-cross] = "-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON,-DLIBUNWIND_ENABLE_CROSS_UNWINDING=OFF,," -DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${MLPREFIX}compilerlibs" -DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt" +DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc" +DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt virtual/nativesdk-libc" DEPENDS:append:class-native = " clang-native compiler-rt-native" DEPENDS:remove:class-native = "libcxx-native" COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" -LIBCPLUSPLUS ?= "-stdlib=libstdc++" +LIBCPLUSPLUS ?= "" +#LIBCPLUSPLUS ?= "-stdlib=libstdc++" # Trick clang.bbclass into not creating circular dependencies -UNWINDLIB:class-nativesdk = "-unwindlib=libgcc" -LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" +#UNWINDLIB:class-nativesdk = "-unwindlib=libgcc" +#LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" UNWINDLIB:class-native = "-unwindlib=libgcc" -LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" +#LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" LDFLAGS:append = " ${UNWINDLIB}" @@ -65,7 +66,7 @@ EXTRA_OECMAKE += "\ -DCMAKE_CROSSCOMPILING=ON \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -DLLVM_ENABLE_RTTI=ON \ - -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=OFF \ -DLIBCXXABI_INCLUDE_TESTS=OFF \ -DLIBCXXABI_ENABLE_SHARED=ON \ -DLIBCXXABI_LIBCXX_INCLUDES=${S}/libcxx/include \ @@ -80,6 +81,10 @@ EXTRA_OECMAKE += "\ " EXTRA_OECMAKE:append:class-target = " \ + -DCMAKE_C_COMPILER_WORKS=ON \ + -DCMAKE_CXX_COMPILER_WORKS=ON \ + -DCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG=ON \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ @@ -88,6 +93,10 @@ EXTRA_OECMAKE:append:class-target = " \ " EXTRA_OECMAKE:append:class-nativesdk = " \ + -DCMAKE_C_COMPILER_WORKS=ON \ + -DCMAKE_CXX_COMPILER_WORKS=ON \ + -DCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG=ON \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ From patchwork Fri Nov 7 23:06:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 73982 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 0540FCCFA1E for ; Fri, 7 Nov 2025 23:06:34 +0000 (UTC) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1147.1762556785754628227 for ; Fri, 07 Nov 2025 15:06:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kxQBeEa4; spf=pass (domain: gmail.com, ip: 209.85.216.49, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-3418ac74bffso956783a91.1 for ; Fri, 07 Nov 2025 15:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762556785; x=1763161585; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B7Yr2Ny2IsJOdkieFEcwVBP8i78piakz/2a9dXQ41Ek=; b=kxQBeEa4PVqvsEruK+MalOuxyH00lDupdJrOfzxnpiWoqm3+OtddjuXU3sHyQQXIma JGeMyvnh94LcrYity+JHyrz+cA1tEIreUzRK3s22y1yg7rQGzyHcAiY9z2gprZdtkMo7 J1VWKhiG8rsbs2AGacvjKiMd9l/p2uDjKqrN7nz7ZzYziUfuhqra5h26z+JsaHNRRX+G Fjn7DfjnbyPpgw0JzJfUh4RUbmI99QFxKvHp0/r3MFuaWwwKYH0g3a4jVwE2ksueDE1u v/ycfXe7NvuIdFCgAaJMYWQRY6BNarrBVBcHC9e3ERT6LQx3Wr0iemADKZKBH0VzvF3P NJ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762556785; x=1763161585; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=B7Yr2Ny2IsJOdkieFEcwVBP8i78piakz/2a9dXQ41Ek=; b=URonwBfTOtViD8YHwtmR92CKpbklZ04hipBKnwkbUllyImmpaVnm5wkRIumfh3kpBP kZyNebSrcRBuPSdAxXPpXMW5AHQ8HEKdt1wVFhiPMfXyGilmXYfEGUbmEsoPYkH8AAO8 LwdwwNP6Moqbl2pCPM90PEu5zOfhKQOolD5xiWSUQWvjqv7RJJBf2cVHU4YHSg4ooRDq f/x2emZxhcX+EI7PGjulvalx/Z8vHyeYy7yA48lFNMo0ZIzwZukLca+xTfQD1rIcBAfH jF6w+VeKbM797WRoeWoRbUKfxyDW4hL6GW/vU+C/LGF1y6VwWxAXuYoW1m/huUe7BE34 S5tg== X-Gm-Message-State: AOJu0YzGvNbyWKXn4klPqKBY29ZKoAB2wyYxMYEoOBuhocvsPa3uBvHq R/2iK1JUdSiB/CxCErZM+IiN5naW32IsCrSoqk8mXOkXNb571Jq4AgmWXvbD8RmoaKI= X-Gm-Gg: ASbGncvctCWsRhxTnkiHuhCAr3nJ7PpG1quy+cZXgs0sfaQ1PdEXHQYSClMmZlr8zLD +0YxS1x/ahY03tRBZgjeZna1lkHMNiAHSUoeka9opBNhHU2q+ldFpaWcF1zVRqSYXfabhQL3/qb hbt53rrd5T6+wHBJKrS8+++SpS1OpyfS0tZAFxjVEoieppi4/K3YehuSQzAwUv/WO8E8LTCqnoK ovFbxaQwYnMbAp0SFwivq4bXJNJRxHTJPNM5G7G8W3K/KwI2tkmmb5vUkcIUwOooXvWPc/g7ykG 13x77dcHZf1TJV73/6YhsEdtvC8o3A9kVpYVDsBBS+djBVym0R3UaSbcpnDMG/oOfzVfR/Vy+FQ EHKCxfD9DzBi7P5pTSPD2F2nizqdfWDx7SRu9WWo5R5bsyXQTGVZ/vGUKtDi+vmZD+zaFlX6HrE a2xYvhgY6FayJn2wqWb+1WF9oqaImS+sxa9ngcXcxKqzPiVMb3RBo1Oe13nnYKww== X-Google-Smtp-Source: AGHT+IFc2hAL6d9dNlJJOH49a9ML62LKZ/j9DyyzCzndFUEnO6u2e0PZLUAMZTuX2Kk+78eIHf4otQ== X-Received: by 2002:a17:90b:3c0e:b0:33f:ebdd:9961 with SMTP id 98e67ed59e1d1-3436ccfe1e9mr663171a91.28.1762556784816; Fri, 07 Nov 2025 15:06:24 -0800 (PST) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::888a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a69b626csm10526282a91.19.2025.11.07.15.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 15:06:23 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 5/6] compiler-rt-sanitizers: Adjust for compiler-rt changes Date: Fri, 7 Nov 2025 15:06:16 -0800 Message-ID: <20251107230617.364804-5-raj.khem@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251107230617.364804-1-raj.khem@gmail.com> References: <20251107230617.364804-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Nov 2025 23:06:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226072 * ORC is not built with compiler-rt anymore, hence package it here * Avoid duplication in specifying cmake sourcedir, use OECMAKE_SOURCEPATH * Since RUNTIMES are bounded there is no need to specify build targets explicitly Signed-off-by: Khem Raj --- .../clang/compiler-rt-sanitizers_git.bb | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index 588320a1407..53d0d63169c 100644 --- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -25,24 +25,20 @@ def get_compiler_rt_arch(bb, d): LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" -TUNE_CCARGS:remove = "-no-integrated-as" -COMPILER_RT ??= "-rtlib=libgcc -unwindlib=libgcc" -LIBCPLUSPLUS ??= "-stdlib=libstdc++" - CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" BUILD_CC = "${CCACHE}${HOST_PREFIX}clang ${BUILD_CC_ARCH}" BUILD_CXX = "${CCACHE}${HOST_PREFIX}clang++ ${BUILD_CC_ARCH}$" -CFLAGS += "${COMPILER_RT}" -CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" TOOLCHAIN = "clang" TOOLCHAIN_NATIVE = "clang" DEPENDS += "virtual/crypt compiler-rt" DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" -DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt nativesdk-gcc-runtime" -DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" +DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-libxcrypt" +DEPENDS:append:class-nativesdk = " ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "nativesdk-libcxx", "nativesdk-gcc-runtime", d)}" +DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc" +DEPENDS:append:class-target = " ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libcxx", "gcc-runtime", d)}" PACKAGECONFIG ??= "" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" @@ -52,9 +48,7 @@ PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_B CXXFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE" -OECMAKE_TARGET_COMPILE = "compiler-rt" -OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" -OECMAKE_SOURCEPATH = "${S}/llvm" +OECMAKE_SOURCEPATH = "${S}/runtimes" INSTALL_VER ?= "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" INSTALL_VER:class-native = "${@oe.utils.trim_version("${PV}", 1)}" @@ -75,7 +69,6 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -DLLVM_APPEND_VC_REV=OFF \ -DCOMPILER_RT_INSTALL_PATH=${nonarch_libdir}/clang/${INSTALL_VER} \ - -S ${S}/runtimes \ " EXTRA_OECMAKE:append:class-native = "\ @@ -106,12 +99,6 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " -do_install:append () { - # Already shipped with compile-rt Orc support - rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/liborc_rt-*.a - rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}/include/orc/ -} - FILES_SOLIBSDEV = "" FILES:${PN} += "${nonarch_libdir}/clang/${INSTALL_VER} \ ${nonarch_libdir}/clang/${MAJOR_VER}/lib/linux/lib*${SOLIBSDEV} \ From patchwork Fri Nov 7 23:06:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 73984 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 0A6D7CCFA1A for ; Fri, 7 Nov 2025 23:06:34 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1148.1762556787148468834 for ; Fri, 07 Nov 2025 15:06:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iH5LBYgd; spf=pass (domain: gmail.com, ip: 209.85.216.48, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-33067909400so1050589a91.2 for ; Fri, 07 Nov 2025 15:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762556786; x=1763161586; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=57n/OdFtQ8dCk74viqM3qM/bv8XaLlDj7O3/h+oIJkU=; b=iH5LBYgdCxM32EVluakHLzqHZVCSctGIAv4Oos3lppU3vyI9UYY+lg0Z6xCb7tYlSh 9AUwqv+F/1nDWUma26thGrUlPep/PvSWq5343scATiT6kM6JvqI5VQRmQ3AfTizazTce kjfbYrmX5TaqI72g8M+h827KliGzQedZcIl6I/dG2oUZe6Ls5PfkRNV5TP0jHwVUIfIE cQbaZlJcFdJFBPiuu1TOvLGB7DE1BtZ9hb8YXGVZqcSXHwzyeNVwYnzckTti+xWgG9Cj gRZgGawmpD12klPEQ/a9SMkvdgm6mk5wAB3DwfKluDOQ6E867jIC7O8/waAwM2ApNAgX ynhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762556786; x=1763161586; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=57n/OdFtQ8dCk74viqM3qM/bv8XaLlDj7O3/h+oIJkU=; b=cOY4I4lOufob/+ERXU8w5F3pw89QWGCawKc/7Y5NmQ1ym9uORpAh3YwS+35zmayNT/ MtTv4y/zcQUj6zLMl0zPXB8Emf4YAyF++Ots0JdwpCHyDjd0HdcKkVN1RO1lx4FBQOxI x7aUorVMC9Nbh5vUwyiLDyTsfrlk4vlnrqHpZXTlHh+4+obaWT1HzR3pLHstOt3gDHpx I4xc9upqTXu3GCmiZb1OXa5CPCfHptxpEHmyITNFb3Ha2nCCJQq2qoj5oLEUoFVAKzOu 4aaXcCZsIxCcbFOf4jFSuqe1FMkf1Nr9dDD99xC9+hvigbUFh2hMuOzbly3KMQoYcUMU ZNBA== X-Gm-Message-State: AOJu0YyFxVOajqf8HYct6LOAggTxAJRc7NfKEJRmbqpCPD7fIpBCpN+H CcO0xM2r7515e2X4ydNDYAN+CRw80Usqy0u5MnSQ4hhftMew7Z37daBfLCsrs2WfsUc= X-Gm-Gg: ASbGncsdp+LszRSdv3QIaG5YwVMy0yNmBt+NETN//K+I1zbgSiJzyXQxNhQwJ3hHOVL Z4Wyz2O09iWvaQ+zV3UVmPVl3iDU1mPpYom71OvTn3Hf7HJbdDAHyfrBzuGel60zZPlhCPKpQ4h +AsuegOx23n5ymbUP3l0QicsZblNYlHvx/0IzEYhszrjk7ep9C7pwbJo6LyiCwBBPTsoeB93QPY 2nV/6afIhEKHJ1rBHOgrwd1CxFzudEdnS/wyUtRRee1CY/Obdq85UfXi5ToVJTPMJZLqmxKqUOB swPcI8/ZqKW6gdyqQShdPEmA88ZNYfjiZ/UUAfgtQq1kt6FDnNjoSGMnKmN0p1CGG9m2bxwWneo LRwnEecKvDZqB7xwbLqRSZfLSZYn/ZFvC9tjyLEZkCAlXC3fxspm4IcVI+fzTufN1PlqtOo/vf7 +dftYYH/akgZxrLyWVa8+LJQRgOY+rfqvRH1LYe46Qpgn6CF+Guub+8cb3nS8cbw== X-Google-Smtp-Source: AGHT+IEXk+KEYnuKLy/aJCJZucO/KIntsChwcsl7Uuz5xKzL1O63zk/Vk/T+L05uOWxgXlQZsiOOcA== X-Received: by 2002:a17:90b:5403:b0:341:ad7a:8f83 with SMTP id 98e67ed59e1d1-3436cb26367mr1073939a91.9.1762556786005; Fri, 07 Nov 2025 15:06:26 -0800 (PST) Received: from apollo.tail3ccdd3.ts.net ([2601:646:8201:fd20::888a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a69b626csm10526282a91.19.2025.11.07.15.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 15:06:25 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 6/6] libcxx/compiler-rt: Add support for llvm-libgcc Date: Fri, 7 Nov 2025 15:06:17 -0800 Message-ID: <20251107230617.364804-6-raj.khem@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251107230617.364804-1-raj.khem@gmail.com> References: <20251107230617.364804-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 07 Nov 2025 23:06:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226073 llvm-libgcc is a drop-in replacement for libgcc and crt* files and its API compatible as well, built out of compiler-rt and libunwind projects. Its only enabled when TC_CXX_RUNTIME is set to 'llvm' since user intends to use LLVM provided runtime packages as default platform/system runtime. Move libunwind out of libcxx recipe into compiler-rt recipe, to facilicate building llvm-libgcc Package and build crt* files, creating symlinks for names as they are expected by gcc, to help build packages with gcc when and where needed. Always use LLD linker to build compiler-rt since the versioning script to generate libgcc compatibility expects it to be LLD and not BFD linker doing the link Signed-off-by: Khem Raj --- .../recipes-devtools/clang/compiler-rt_git.bb | 84 +++++++++---------- meta/recipes-devtools/clang/libcxx_git.bb | 57 +++---------- 2 files changed, 50 insertions(+), 91 deletions(-) diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index b849b64515a..a265c2aa938 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -16,32 +16,25 @@ BPN = "compiler-rt" inherit cmake pkgconfig -LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" - -LIBCPLUSPLUS = "" -COMPILER_RT = "" - -TUNE_CCARGS:remove = "-no-integrated-as" +LIC_FILES_CHKSUM = "\ + file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a \ + file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ +" INHIBIT_DEFAULT_DEPS = "1" DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc libcxx-native compiler-rt-native" DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS}" DEPENDS:append:class-native = " clang-native" +DEPENDS:append:class-native = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", " lld-native", "", d)}" DEPENDS:remove:class-native = "libcxx-native compiler-rt-native" -# Trick clang.bbclass into not creating circular dependencies -UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" -COMPILER_RT:class-nativesdk = "-rtlib=libgcc" -LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" -UNWINDLIB:class-native = "--unwindlib=libgcc" -COMPILER_RT:class-native = "-rtlib=libgcc" -LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" -UNWINDLIB:class-target = "--unwindlib=libgcc" -COMPILER_RT:class-target = "-rtlib=libgcc" -LIBCPLUSPLUS:class-target = "-stdlib=libstdc++" - -PACKAGECONFIG ??= "crt" +PROVIDES += "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libgcc", "", d)}" +RPROVIDES:${PN} += "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libgcc", "", d)}" +RPROVIDES:${PN}-dev += "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libgcc-dev", "", d)}" +RPROVIDES:${PN}-dbg += "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libgcc-dbg", "", d)}" + +PACKAGECONFIG ??= "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "crt", "", d)}" PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" PACKAGECONFIG[profile] = "-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" # Context Profiling, might need to enable 'profile' too @@ -50,10 +43,7 @@ PACKAGECONFIG[ctx-profile] = "-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_B HF = "" HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" -CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" -CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" -LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" -CXXFLAGS += "${LIBCPLUSPLUS}" +LDFLAGS += "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", " -fuse-ld=lld -unwindlib=none -nostdlib -lpthread -lc", "", d)}" TOOLCHAIN = "clang" TOOLCHAIN_NATIVE = "clang" @@ -67,41 +57,43 @@ def get_compiler_rt_arch(bb, d): return 'armhf' return d.getVar('HOST_ARCH') -OECMAKE_TARGET_COMPILE = "compiler-rt" -OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" -OECMAKE_SOURCEPATH = "${S}/llvm" - INSTALL_VER ?= "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" INSTALL_VER:class-native = "${@oe.utils.trim_version("${PV}", 1)}" +OECMAKE_SOURCEPATH = "${S}/runtimes" + +RUNTIMES ?= "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "llvm-libgcc", "compiler-rt", d)}" + +LLVMLIBGCCOPTS = "-DLLVM_LIBGCC_EXPLICIT_OPT_IN=Yes" + EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_C_COMPILER_WORKS=ON \ -DCMAKE_CXX_COMPILER_WORKS=ON \ + -DCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG=ON \ + -DCXX_SUPPORTS_FUNWIND_TABLES_FLAG=ON \ -DCOMPILER_RT_STANDALONE_BUILD=ON \ + -DLLVM_LIBGCC_STANDALONE_BUILD=ON \ -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_BUILD_XRAY=OFF \ -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ -DCOMPILER_RT_BUILD_MEMPROF=OFF \ -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ -DCOMPILER_RT_DEFAULT_TARGET_ARCH=${@get_compiler_rt_arch(bb, d)} \ - -DLLVM_ENABLE_RUNTIMES='compiler-rt' \ + -DLLVM_ENABLE_RUNTIMES=${RUNTIMES} \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -DLLVM_APPEND_VC_REV=OFF \ + -DCOMPILER_RT_BUILD_ORC=OFF \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ -DCOMPILER_RT_INSTALL_PATH=${nonarch_libdir}/clang/${INSTALL_VER} \ - -S ${S}/runtimes \ -" -EXTRA_OECMAKE:append:class-native = "\ - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \ + ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "${LLVMLIBGCCOPTS}", "", d)} \ " EXTRA_OECMAKE:append:class-target = "\ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ - -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ - -DCOMPILER_RT_BUILD_ORC=OFF \ " EXTRA_OECMAKE:append:class-nativesdk = "\ @@ -110,28 +102,30 @@ EXTRA_OECMAKE:append:class-nativesdk = "\ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ - -DCMAKE_C_COMPILER_TARGET=${HOST_SYS} \ - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ - -DCOMPILER_RT_BUILD_ORC=OFF \ " do_install:append () { if [ "${HF}" = "hf" ]; then - mv -f ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/libclang_rt.builtins-arm.a \ + install -Dm 0644 ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/libclang_rt.builtins-arm.a \ ${D}${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/libclang_rt.builtins-armhf.a fi + if ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'true', 'false', d)}; then + ln -sf clang/${INSTALL_VER}/lib/linux/clang_rt.crtbegin-${@get_compiler_rt_arch(bb, d)}.o ${D}${nonarch_libdir}/crtbegin.o + ln -sf clang/${INSTALL_VER}/lib/linux/clang_rt.crtbegin-${@get_compiler_rt_arch(bb, d)}.o ${D}${nonarch_libdir}/crtbeginS.o + ln -sf clang/${INSTALL_VER}/lib/linux/clang_rt.crtend-${@get_compiler_rt_arch(bb, d)}.o ${D}${nonarch_libdir}/crtend.o + ln -sf clang/${INSTALL_VER}/lib/linux/clang_rt.crtend-${@get_compiler_rt_arch(bb, d)}.o ${D}${nonarch_libdir}/crtendS.o + fi } -FILES_SOLIBSDEV = "" - FILES:${PN} += "${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/lib*${SOLIBSDEV} \ ${nonarch_libdir}/clang/${INSTALL_VER}/*.txt \ - ${nonarch_libdir}/clang/${INSTALL_VER}/share/*.txt" + ${nonarch_libdir}/clang/${INSTALL_VER}/share/*.txt \ + ${nonarch_libdir}/*.so" FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/*.a" FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/*.syms \ ${nonarch_libdir}/clang/${INSTALL_VER}/include \ ${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/clang_rt.crt*.o \ + ${nonarch_libdir}/crt*.o \ ${nonarch_libdir}/clang/${INSTALL_VER}/lib/linux/libclang_rt.asan-preinit*.a" INSANE_SKIP:${PN} = "dev-so libdir" @@ -141,6 +135,4 @@ RDEPENDS:${PN}-dev += "${PN}-staticdev" BBCLASSEXTEND = "native nativesdk" -ALLOW_EMPTY:${PN} = "1" - SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb index 1cea430e6ba..fee7cfc9ea1 100644 --- a/meta/recipes-devtools/clang/libcxx_git.bb +++ b/meta/recipes-devtools/clang/libcxx_git.bb @@ -12,60 +12,46 @@ inherit cmake BPN = "libcxx" -PACKAGECONFIG ??= "compiler-rt exceptions unwind ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind unwind-shared", "", d)}" +PACKAGECONFIG ??= "exceptions ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "llvm-unwind", "", d)}" PACKAGECONFIG:append:armv5 = " no-atomics" -PACKAGECONFIG:remove:class-native = "compiler-rt" -PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," + PACKAGECONFIG[exceptions] = "-DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DLIBCXX_ENABLE_EXCEPTIONS=ON,-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF -DLIBCXX_ENABLE_EXCEPTIONS=OFF -DCMAKE_REQUIRED_FLAGS='-fno-exceptions'," PACKAGECONFIG[no-atomics] = "-D_LIBCXXABI_HAS_ATOMIC_BUILTINS=OFF -DCMAKE_SHARED_LINKER_FLAGS='-latomic',," -PACKAGECONFIG[compiler-rt] = "-DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBUNWIND_USE_COMPILER_RT=ON,,compiler-rt" -PACKAGECONFIG[unwind-shared] = "-DLIBUNWIND_ENABLE_SHARED=ON,-DLIBUNWIND_ENABLE_SHARED=OFF,," -PACKAGECONFIG[unwind-cross] = "-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON,-DLIBUNWIND_ENABLE_CROSS_UNWINDING=OFF,," +PACKAGECONFIG[llvm-unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF" -DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc" -DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt virtual/nativesdk-libc" +DEPENDS:append:class-target = " virtual/cross-c++ ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc compiler-rt libgcc" +DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt virtual/nativesdk-libc nativesdk-compiler-rt nativesdk-libgcc" DEPENDS:append:class-native = " clang-native compiler-rt-native" DEPENDS:remove:class-native = "libcxx-native" -COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}" -UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}" -LIBCPLUSPLUS ?= "" -#LIBCPLUSPLUS ?= "-stdlib=libstdc++" -# Trick clang.bbclass into not creating circular dependencies -#UNWINDLIB:class-nativesdk = "-unwindlib=libgcc" -#LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" -UNWINDLIB:class-native = "-unwindlib=libgcc" -#LIBCPLUSPLUS:class-native = "-stdlib=libstdc++" - -LDFLAGS:append = " ${UNWINDLIB}" - INHIBIT_DEFAULT_DEPS = "1" LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da3953 \ file://libcxxabi/LICENSE.TXT;md5=7b9334635b542c56868400a46b272b1e \ - file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ " -OECMAKE_TARGET_COMPILE = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind", "", d)} cxxabi cxx" -OECMAKE_TARGET_INSTALL = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "install-unwind", "", d)} install-cxxabi install-cxx" +OECMAKE_TARGET_COMPILE = "cxxabi cxx" +OECMAKE_TARGET_INSTALL = "install-cxxabi install-cxx" CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" CXX = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" BUILD_CC = "${CCACHE}clang ${BUILD_CC_ARCH}" BUILD_CXX = "${CCACHE}clang++ ${BUILD_CC_ARCH}" -LDFLAGS += "${COMPILER_RT} ${UNWINDLIB} ${LIBCPLUSPLUS}" -CXXFLAGS += "${LIBCPLUSPLUS}" TOOLCHAIN = "clang" TOOLCHAIN_NATIVE = "clang" -OECMAKE_SOURCEPATH = "${S}/llvm" +LDFLAGS:append:class-target = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", " -fuse-ld=lld -lpthread -lc", "", d)}" +LDFLAGS:append:class-nativesdk = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", " -fuse-ld=lld -lpthread -lc", "", d)}" + +OECMAKE_SOURCEPATH = "${S}/runtimes" EXTRA_OECMAKE += "\ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ -DCMAKE_CROSSCOMPILING=ON \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -DLLVM_ENABLE_RTTI=ON \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=OFF \ -DLIBCXXABI_INCLUDE_TESTS=OFF \ -DLIBCXXABI_ENABLE_SHARED=ON \ @@ -73,7 +59,6 @@ EXTRA_OECMAKE += "\ -DLIBCXX_CXX_ABI=libcxxabi \ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/libcxxabi/include \ -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib${LLVM_LIBDIR_SUFFIX} \ - -S ${S}/runtimes \ -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \ -DLLVM_RUNTIME_TARGETS=${HOST_ARCH} \ -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ @@ -84,7 +69,6 @@ EXTRA_OECMAKE:append:class-target = " \ -DCMAKE_C_COMPILER_WORKS=ON \ -DCMAKE_CXX_COMPILER_WORKS=ON \ -DCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG=ON \ - -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ @@ -96,7 +80,6 @@ EXTRA_OECMAKE:append:class-nativesdk = " \ -DCMAKE_C_COMPILER_WORKS=ON \ -DCMAKE_CXX_COMPILER_WORKS=ON \ -DCXX_SUPPORTS_FNO_EXCEPTIONS_FLAG=ON \ - -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ @@ -109,22 +92,6 @@ CXXFLAGS:append:armv5 = " -mfpu=vfp2" ALLOW_EMPTY:${PN} = "1" -PROVIDES:append = " ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libunwind", "false", d)}" - -do_install:append() { - if ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "true", "false", d)} - then - for f in libunwind.h __libunwind_config.h unwind.h unwind_itanium.h unwind_arm_ehabi.h - do - install -Dm 0644 ${S}/libunwind/include/$f ${D}${includedir}/$f - done - install -d ${D}${libdir}/pkgconfig - sed -e 's,@LIBDIR@,${libdir},g;s,@VERSION@,${PV},g' ${S}/libunwind/libunwind.pc.in > ${D}${libdir}/pkgconfig/libunwind.pc - fi -} - -PACKAGES:append = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", " libunwind", "", d)}" -FILES:libunwind = "${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", " ${libdir}/libunwind.so.*", "", d)}" # Package library module manifest path FILES:${PN}-dev += "${datadir}/libc++/v1/ ${libdir}/libc++.modules.json"