From patchwork Wed Jul 2 05:32: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: 66083 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 D7468C83038 for ; Wed, 2 Jul 2025 05:32:31 +0000 (UTC) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web10.16693.1751434343514608302 for ; Tue, 01 Jul 2025 22:32:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Sou8JmW6; spf=pass (domain: gmail.com, ip: 209.85.214.174, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-235ef62066eso80598135ad.3 for ; Tue, 01 Jul 2025 22:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751434342; x=1752039142; 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=z0Ymy59ZPMw3jKRo6R4Afi0oSmCxyQNAR7WHXs5qSCs=; b=Sou8JmW68J3f8OiTPOqp2eZERHYrWDi30C6CwUwwhOXHqnUGkHy7eu4/qWzFV4pWab jARds2BslyqVr31d2uPhtf5nKiCC9CHKFOamAxtrs2GRUUsFhwLBgjyT7WCNnAEvPOtG FHodxIE5q0W6DumhpqdD/pgIFZtBZZqs2h3HveuWSNMOynQJnILupf8oVjT3LxPOcNhu lSY4md88bIOLupDVaZI+QY6e9HpUW/IKLlQ6JWBglJSFEaGxdAVl/2LnIJzUPAS0K2Ku CGqmTbKBCbvVL2AX8OpQ6TVBaPeFpCEOp0eSDUCxD26c+/Bj9kgE6TJVEpmyMOaFXYMS GKug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751434342; x=1752039142; 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=z0Ymy59ZPMw3jKRo6R4Afi0oSmCxyQNAR7WHXs5qSCs=; b=YmEN/Y6BHf0AdACUWJ3mORnkRbF1ch3ncwhYANmOFCMbj0yB/wUXElb+h9STp/kbnh WGLkMzRAgreBL2UB77DifqWpkuVuP7rSbCYzn0g2pQx5jEyaYIoijeD+epqbEe49b3g8 9csrscxDG5XICb7D9D4MI2UM3tpPgbFKneDqTEkshs0juSkzz0m6iJL+nPwxb/9mbXrO lw4eNLJ9qDZbJwBO7Ut17Qm2d6XjW+0CXg39AkAErAyv51+hDmyzorjnRHNyTmTx7Qq4 32wr3OK7zYjb+lZrJ0odKqUpbLV0OqPFbs8Ryg4FI21FLxWLHqJWi0fKLPpg47nFAtJV A0Qw== X-Gm-Message-State: AOJu0YzIF6y7YoMZnyKbZUVQtFCKdI21qszxiXEc4AYiyK835d0XqdW4 vwgq29914fgc5+lj24QXbzA4iRg6Up7thSkq6Y1/L9kVi2SFxktUVkUhL0SEo124 X-Gm-Gg: ASbGncvMm/ULYXJlqlZK8tzinde2qS7ZH63nIU/QKO71+6J8Z+SVrcfvjMerWxMR9Km 7j8viiqxtUCGUoo+fgSjbm00WdYlS1I/cjvCo/zXDSZTJ10xJnFAIIKvQ+VbMZs9kLq/Rx0rxYH TrWq0kbAUTAV9xsapaL7h2np3LnYMK+SezByicorQ9PeAkCOeEWJUp5LoV1JajiLkxJ9wA1MDmk tE00Si4rR/ufrLEH/0i0G0zhvVuX6PSkcbmJPgFrG4ibPhMU9sCE36DvmKMnMZ+XC/Ss329R4pZ vC/O2kp7EgdTDWt4IPqFsWZrcX4eNx/ezYIwCjJ2JAiJq3sCUCUN+JapGZ/rFonA X-Google-Smtp-Source: AGHT+IFEa+0onJkfMaKsXKEQ9K/uTG0yWnydUZxRNPSigwCfv+8icz6WooydqlK2n8gxzUfW88O4bw== X-Received: by 2002:a17:902:d603:b0:235:779:edfe with SMTP id d9443c01a7336-23c6e5ca09fmr21619525ad.43.1751434342483; Tue, 01 Jul 2025 22:32:22 -0700 (PDT) Received: from apollo.localdomain ([2601:646:8201:fd20::aa8c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2e2423sm120125985ad.37.2025.07.01.22.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 22:32:21 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Date: Tue, 1 Jul 2025 22:32:16 -0700 Message-ID: <20250702053220.4104358-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.0 MIME-Version: 1.0 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, 02 Jul 2025 05:32:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219774 Some recipes demand full clang/llvm builds e.g. chromium we need to use clang as native toolchain. This class collects all needed bits to enable OE built clang to provide the clang native toolchain Setting TOOLCHAIN_NATIVE = "clang" in recipe will chose clang for native toolchain Signed-off-by: Khem Raj --- meta/classes/toolchain/clang-native.bbclass | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 meta/classes/toolchain/clang-native.bbclass diff --git a/meta/classes/toolchain/clang-native.bbclass b/meta/classes/toolchain/clang-native.bbclass new file mode 100644 index 00000000000..4de491a1cb5 --- /dev/null +++ b/meta/classes/toolchain/clang-native.bbclass @@ -0,0 +1,18 @@ +BUILD_CC = "${CCACHE}${BUILD_PREFIX}clang ${BUILD_CC_ARCH}" +BUILD_CXX = "${CCACHE}${BUILD_PREFIX}clang++ ${BUILD_CC_ARCH}" +BUILD_FC = "${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}" +BUILD_CPP = "${BUILD_PREFIX}clang ${BUILD_CC_ARCH} -E" +BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}" +BUILD_CCLD = "${BUILD_PREFIX}clang ${BUILD_CC_ARCH}" +BUILD_AR = "${BUILD_PREFIX}llvm-ar" +BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}" +BUILD_RANLIB = "${BUILD_PREFIX}llvm-ranlib -D" +BUILD_STRIP = "${BUILD_PREFIX}llvm-strip" +BUILD_OBJCOPY = "${BUILD_PREFIX}llvm-objcopy" +BUILD_OBJDUMP = "${BUILD_PREFIX}llvm-objdump" +BUILD_NM = "${BUILD_PREFIX}llvm-nm" +BUILD_READELF = "${BUILD_PREFIX}llvm-readelf" + +DEPENDS += "clang-native libcxx-native compiler-rt-native" + +LDFLAGS += " --rtlib=libgcc --unwindlib=libgcc" From patchwork Wed Jul 2 05:32: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: 66081 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 C5C7BC83013 for ; Wed, 2 Jul 2025 05:32:31 +0000 (UTC) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web11.16673.1751434344480813134 for ; Tue, 01 Jul 2025 22:32:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NUDB401M; spf=pass (domain: gmail.com, ip: 209.85.214.169, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-23636167b30so37363805ad.1 for ; Tue, 01 Jul 2025 22:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751434344; x=1752039144; 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=TdXxI1PzvtCbloJr31Z+42X2RFFS02EnDFVgioTJXwA=; b=NUDB401MxDsSCl3I3Wlo/dnl3FogM9JbO16LtZ0/yg2yPzWPEhlNV/JAaLm6g6q8PE 1tigcTEXe4U9rPNaQQ1bCpnmpknzQ1Xi8zPzRgk57GENZN1Ebz2i/ITHvnZi5+6ZZMT/ 0t4kCmZ8xdm4UP5gSfzO4FRl3ME8dt1EAj0sdBvvpP+7weun5hMIMRV7svJ/p6/dxKaL ajem/x9MDyCwx/IagPYLJ3RAlkYX0eW84D5d4A1eZrpSB1ntnxvup0hjhIfgfhONugKc fGsH003MwGIFh7nJJSAKrcThzedEDCET26EY7mnKJBEMaSC5riQ+FUyOlaM8uL4QUX/h ZITw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751434344; x=1752039144; 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=TdXxI1PzvtCbloJr31Z+42X2RFFS02EnDFVgioTJXwA=; b=Iiioh5dQYHk3W16iT9u1EaPjiQdUeOVNJT2CxB/BzkJxyM0B4GvihBG1nK7lu0nE2z g5ha3AHaVLymZ0CMjz3oGBRsAhSAgGb2nwNxmD+nsUBrynpPFGSF/y9j2GYfiAnLhc1p 6OdAcszX+wvlXZ3XrOYqukl992XIZB8LgRQDlnmekIyMPIcSHMVdP+gAnrLoJE/3xqNe d6ofqklMGeHdX/5iTLUmt+jHnwJFZT/ZgThfGK5+9DMlY+REOvLXoc8CL+hWWOmVmz5V yNKfyz2lCI9gbLCw1eWeQ7YZg2AX9YU+6KR7PDWkJYOn/ihx1AfGVB79sQ9YyzZD6tCF +PMg== X-Gm-Message-State: AOJu0YxnIyvoxrbQNQVD2Sdq2CgaMc8ksOrvMtf7jf/Wk4FNbtRP62x8 pW7MAnFOEmf6Tuo+1VS5/SnksvrwFnYc5NeHLeoWMuymTuYHCgkDxaCvjCXy8pSi X-Gm-Gg: ASbGncunfQRv5HAcRmdVJGyJKQMYEz1vUQAYTBE5pxl2gCJHo0qgEE1St/a+MdHrcOu aKwk+RjRjwT5/mKrUpyZ2c5c5RFaH5PZ1QMaHwgXXg/smEAh0QLUVgfGhq73pxl2uZRCIqeN466 mwjc3RaNwSV3N4xrsDOy35s30yB4ZJwfQ+9tDidqxMkD4rZIzPa/MItcRTVrVaXUuIGx/Nnti6G LGcsohf10shnhtDUneB01ysdc6fGpNnby4ENBc6RAo+yQoRVzKAhI37DTLFX63USHnRgswbQYh5 5tyl4V8JOm1jqNac+okJ7cd9kINKlKBeVCPkOlp07SRbFaXCGYt4EA== X-Google-Smtp-Source: AGHT+IEbJlVh6LXgCMUe9upYR7r4ibGpomoL7xeAr4GlSk0lOJtil+fPzWt1BNbXHN/1x7IS+lBN+g== X-Received: by 2002:a17:902:e787:b0:235:6f7:b918 with SMTP id d9443c01a7336-23c6e55206emr22683505ad.28.1751434343581; Tue, 01 Jul 2025 22:32:23 -0700 (PDT) Received: from apollo.localdomain ([2601:646:8201:fd20::aa8c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2e2423sm120125985ad.37.2025.07.01.22.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 22:32:22 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Date: Tue, 1 Jul 2025 22:32:17 -0700 Message-ID: <20250702053220.4104358-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250702053220.4104358-1-raj.khem@gmail.com> References: <20250702053220.4104358-1-raj.khem@gmail.com> MIME-Version: 1.0 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, 02 Jul 2025 05:32:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219775 use TOOLCHAIN_NATIVE variable for selecting native compiler Default it to PREFERRED_TOOLCHAIN_NATIVE, a recipe which wants to enforce a toolchain can do so with for cross toolchains ( e.g. target, nativesdk ) TOOLCHAIN = "gcc" For native TOOLCHAIN_NATIVE = "gcc" This helps build native recipe with clang as native compiler. Signed-off-by: Khem Raj --- meta/classes-global/base.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index ac145d9fd64..6be1f5c2df2 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -30,8 +30,9 @@ PREFERRED_TOOLCHAIN:class-crosssdk = "${PREFERRED_TOOLCHAIN_SDK}" PREFERRED_TOOLCHAIN:class-nativesdk = "${PREFERRED_TOOLCHAIN_SDK}" TOOLCHAIN ??= "${PREFERRED_TOOLCHAIN}" +TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}" -inherit toolchain/gcc-native +inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native inherit_defer toolchain/${TOOLCHAIN} def lsb_distro_identifier(d): From patchwork Wed Jul 2 05:32:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 66082 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 C9259C8303C for ; Wed, 2 Jul 2025 05:32:31 +0000 (UTC) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.web10.16694.1751434345576669036 for ; Tue, 01 Jul 2025 22:32:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=E+T+/oV3; spf=pass (domain: gmail.com, ip: 209.85.214.171, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-235a3dd4f0dso40085695ad.0 for ; Tue, 01 Jul 2025 22:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751434345; x=1752039145; 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=P4De4DZCX7CI8/PjQHYBc9xmmIfZwJI41VJFne5PB+M=; b=E+T+/oV3MpzqUtIPkD/rWu5nufYdERYAIvsGP/LB6ihc1cXm2j09WGhwKhd48ZVVvO BS2xYkYoiGGTi7RtZwR7k+hUINPlmVl2cZQQq9U1Zmy/YIuRkuo1h80apNIGB8pgXfKW b4578y3trrFuMvi3NmhAm0WY+FrtueIdBBjH8IZCIPq6TxwbEyxtjsIYpaT6m7ZHQ0uS GeVtDkIZckFfwvaDtvvlDP4CwXS2wsv9/uOXdrRtXeDTNo1nOqj4cU/Ml+Lk1+XinYxQ l4djJmQpgx0WgxEhnrXVHu+dKn1jEVp3sUt2YoNz2FRED9eCgr6Obeu9Bw9cW14RDT+A RpKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751434345; x=1752039145; 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=P4De4DZCX7CI8/PjQHYBc9xmmIfZwJI41VJFne5PB+M=; b=k1eBlvWrm7WTlscnb6Vo4YKAZd02Mt1I7LItKkvAAMpOUGtRUF8KcTJqgG8xlpYVT1 agA0bvvoyDK0kD4+tBrP7Wi8mZDI4i9g4BJsqBBnshzQGnxf213UkNcmiO9k2BDrwDXG Vg2JLcbWsVcwYaluj/KtfO6Qr0XR95RViYP9MY3XyIW1UbfY0BpemT9aY7f/IGS4IGAs u195b3v6WRkRxJ+AwwO29jaoR242wRf8GcKcF6RkzuG5iflv4tDCwcXuvUEqyE77Vqgd hhGIhFawDTC5Fw7l97xChqG2UbJehOKnJsr/YTSP+aD14U8wrqH6SXKROtM1/PC6bFUT DIxA== X-Gm-Message-State: AOJu0Ywck0C7jtX4OwvGQLvtKRRkimKCGHtUIJCC8oqy9PmTfCu2W2pJ ZZBtgRGpDIVgZ+az/NgXBJxVjD6EzHTa9FaxhMf+w36geBFOpN784W81cjcDFtcZ X-Gm-Gg: ASbGncvV/2J2SVEnlduW/3SPevzNXKIGD8P9VxEuma8iKGU7E/1+jYifTPWtDi1YEUE sAFlzDPY7Y6qSWfpbjIArNNOhGH4Fl484/Ookipz3YzHeThZeGZB6oKwEGoPI5WUQ9EkiHoB00E VK8qYM871G3WnGZH4wWxZNpIBieQ9QiRtmwgrI0fkcdIIb0FIqQpjkntiuDLBEd9LCMELBuZDBU hV3s1Q+AtV/SxgMgm09GBFQr8NXsPL2bBpeXdo9C7IIbO9LN1cn0snpj/WtvlWLnb93DOglymWo HsOMSgYMyrSPPHP1sU6qe9PK2/lzVFxTfdZKnk8/pSImRA5aXU422A== X-Google-Smtp-Source: AGHT+IH9ntDdq7QN16jLuKFQZchDZq2+NIP8nt8cT6bnuLnQYtLWU1k+ZYcI0SFa2gudjro0w18A5Q== X-Received: by 2002:a17:902:d592:b0:220:ea90:191e with SMTP id d9443c01a7336-23c6e4d3362mr19914665ad.4.1751434344633; Tue, 01 Jul 2025 22:32:24 -0700 (PDT) Received: from apollo.localdomain ([2601:646:8201:fd20::aa8c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2e2423sm120125985ad.37.2025.07.01.22.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 22:32:24 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v5 3/5] compiler-rt,libcxx: Use clang for native versions as well Date: Tue, 1 Jul 2025 22:32:18 -0700 Message-ID: <20250702053220.4104358-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250702053220.4104358-1-raj.khem@gmail.com> References: <20250702053220.4104358-1-raj.khem@gmail.com> MIME-Version: 1.0 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, 02 Jul 2025 05:32:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219776 Set TOOLCHAIN_NATIVE for using clang Signed-off-by: Khem Raj --- meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 1 + meta/recipes-devtools/clang/compiler-rt_git.bb | 2 ++ meta/recipes-devtools/clang/libcxx_git.bb | 2 ++ 3 files changed, 5 insertions(+) diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index 47438014b23..087a7663023 100644 --- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -37,6 +37,7 @@ CFLAGS += "${COMPILER_RT}" CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}" TOOLCHAIN = "clang" +TOOLCHAIN_NATIVE = "clang" DEPENDS += "ninja-native virtual/crypt compiler-rt" DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native" diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index ff6cc29bf32..c7bf38c33d2 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -29,6 +29,7 @@ DEPENDS += "ninja-native libgcc" DEPENDS:append:class-target = " virtual/cross-c++ 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-native = " clang-native" +DEPENDS:remove:class-native = "libcxx-native compiler-rt-native" # Trick clang.bbclass into not creating circular dependencies UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" @@ -58,6 +59,7 @@ LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}" CXXFLAGS += "${LIBCPLUSPLUS}" TOOLCHAIN = "clang" +TOOLCHAIN_NATIVE = "clang" def get_compiler_rt_arch(bb, d): if bb.utils.contains('TUNE_FEATURES', 'armv5 thumb dsp', True, False, d): diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb index f5bf17f30ae..d355fc3a0f8 100644 --- a/meta/recipes-devtools/clang/libcxx_git.bb +++ b/meta/recipes-devtools/clang/libcxx_git.bb @@ -25,6 +25,7 @@ DEPENDS += "ninja-native" DEPENDS:append:class-target = " virtual/cross-c++ 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-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)}" @@ -55,6 +56,7 @@ LDFLAGS += "${COMPILER_RT} ${UNWINDLIB} ${LIBCPLUSPLUS}" CXXFLAGS += "${LIBCPLUSPLUS}" TOOLCHAIN = "clang" +TOOLCHAIN_NATIVE = "clang" OECMAKE_SOURCEPATH = "${S}/llvm" EXTRA_OECMAKE += "\ From patchwork Wed Jul 2 05:32:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 66084 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 E8641C8303F for ; Wed, 2 Jul 2025 05:32:31 +0000 (UTC) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mx.groups.io with SMTP id smtpd.web10.16695.1751434346752562241 for ; Tue, 01 Jul 2025 22:32:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Yk+1hcCa; spf=pass (domain: gmail.com, ip: 209.85.214.174, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-237311f5a54so36505795ad.2 for ; Tue, 01 Jul 2025 22:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751434346; x=1752039146; 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=k3BH9p+1bjBPBbTVsHhdAov30OgxV3XgfeJ14jhagfk=; b=Yk+1hcCayXuWMYnPpdN83b+T/hzXjm0FR24piFl1iu33omYTdBpEA3sgwZfcOzxk2A vvuZmjQm5XI321gVFsTPXaJPEUd+3tOqKet+MEICkcfHTUXl4iolkV03x4sW4laA8kOM snsbhmQFyrFd6s6egJeUECfyKNppZzeWYdDiQD2ycjXG3FCHFG9BQ84meM08yg+gxihG B+SIikPIZ1TQGNOTttfpJuymsFjLp9I51NRrd8kmT2cfAM28iz7hnBdIrhAQu8eHcbzD LAutumeE4obVc/JR0l8ehqYCdJOjSN8RZ206ifxyR0qDCBHSee4bmCpKbtcSKjhbcdeq bTWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751434346; x=1752039146; 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=k3BH9p+1bjBPBbTVsHhdAov30OgxV3XgfeJ14jhagfk=; b=OyN4YnHgrYuK0ihIFu+yZufmWmU/8pHEinsD1YSVdyV79H4M9/NJwixkKzYh3Q5q27 3scASguZPs18/zDKTac5OZSiG7+3VEfKmgNIY07a4cQQZ9KDI02PjHVL+9/JvMzZ7Qs8 mUV/kSfmRDun8JwDi6Y5xrE0ZLXNPoPpLl4DVJomSG9PRG8/v9e8GAMAlhChUDzprCTY t7BtkCp51nkof1obhixg+7Cypo8eQWDA7B3zso1v1CEoiHlq7g1jUy2Xe6kSS7b0es0J occgFZ5PrcyLKWOuLCjSrlfcCFnlOge5EaJKEAr71Oj/aQj8W9bCNWRuN65GW+F855yP jIDg== X-Gm-Message-State: AOJu0Yyqjiv25OfHAcDNX2NTgldE95wPcYD8O7Pp5O8tdew7L6Un/zBa oLVAiCLeLlHPCrjMl+o87LxpEQWr/PBS2r7l83jByu4LjBho8dPpFS3opdrg8R0r X-Gm-Gg: ASbGncu1VHyeGLSL9W1s1j2gdRls0UBZui1FPY2OccKoDTeGGLZ51kjFOQpeQcDMiWe QKYXV+LsobtUiWLhKU0mz7ELsJMjLSdmQaMAUnib3QSGxMXHXapEBjSbtHnMj8VYtRFvibvW8ZD cZbJSPdVb+aNY4JZrdXQf2468dPQXF3/vfsCYkPsCx64c43ZkElm7RIlWwugCikacqA5HzGRU/0 vB0k27fMr5u3Xm1N2hCCMkGNgFChV9zRQxRpbnLfnw1jG8XOo3lSbOQtCdopl6q9qevQB607ViU WMXV78LQV8uU2qfZDJzAQFPz+ArRyNyyu/8hz6+EUnfeSLOqIpuGkhnrO6dkh25/ X-Google-Smtp-Source: AGHT+IFKtDYjEWjBn+QKaQKq5nd6zTsCrTAJSmC0tQSmtt2QKu5rNaM51zpKNpge3hA7Sblz+bc0gQ== X-Received: by 2002:a17:903:190d:b0:235:f298:cbbd with SMTP id d9443c01a7336-23c6e5036e4mr27271415ad.21.1751434345735; Tue, 01 Jul 2025 22:32:25 -0700 (PDT) Received: from apollo.localdomain ([2601:646:8201:fd20::aa8c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2e2423sm120125985ad.37.2025.07.01.22.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 22:32:25 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Richard Purdie , Khem Raj Subject: [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC Date: Tue, 1 Jul 2025 22:32:19 -0700 Message-ID: <20250702053220.4104358-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250702053220.4104358-1-raj.khem@gmail.com> References: <20250702053220.4104358-1-raj.khem@gmail.com> MIME-Version: 1.0 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, 02 Jul 2025 05:32:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219777 From: Richard Purdie The test/helper is written assuming gcc, so just call that and stop accessing BUILD_CC which may be set to clang. Signed-off-by: Richard Purdie Signed-off-by: Khem Raj --- meta/classes-global/sanity.bbclass | 9 +++------ meta/lib/oe/utils.py | 17 ++++++----------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index d1452967fc1..3c103d3bfb3 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass @@ -514,12 +514,9 @@ def check_userns(): # built buildtools-extended-tarball) # def check_gcc_version(sanity_data): - import subprocess - - build_cc, version = oe.utils.get_host_compiler_version(sanity_data) - if build_cc.strip() == "gcc": - if bb.utils.vercmp_string_op(version, "8.0", "<"): - return "Your version of gcc is older than 8.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).\n" + version = oe.utils.get_host_gcc_version(sanity_data) + if bb.utils.vercmp_string_op(version, "8.0", "<"): + return "Your version of gcc is older than 8.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).\n" return None # Tar version 1.24 and onwards handle overwriting symlinks correctly diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index a11db5f3cd9..27d304ec72d 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -415,34 +415,29 @@ def format_pkg_list(pkg_dict, ret_format=None, pkgdata_dir=None): return output_str -# Helper function to get the host compiler version -# Do not assume the compiler is gcc -def get_host_compiler_version(d, taskcontextonly=False): +# Helper function to get the host gcc version +def get_host_gcc_version(d, taskcontextonly=False): import re, subprocess if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1': return - compiler = d.getVar("BUILD_CC") - # Get rid of ccache since it is not present when parsing. - if compiler.startswith('ccache '): - compiler = compiler[7:] try: env = os.environ.copy() # datastore PATH does not contain session PATH as set by environment-setup-... # this breaks the install-buildtools use-case # env["PATH"] = d.getVar("PATH") - output = subprocess.check_output("%s --version" % compiler, \ + output = subprocess.check_output("gcc --version", \ shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8") except subprocess.CalledProcessError as e: - bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8"))) + bb.fatal("Error running gcc --version: %s" % (e.output.decode("utf-8"))) match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0]) if not match: - bb.fatal("Can't get compiler version from %s --version output" % compiler) + bb.fatal("Can't get compiler version from gcc --version output") version = match.group(1) - return compiler, version + return version def host_gcc_version(d, taskcontextonly=False): From patchwork Wed Jul 2 05:32:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 66085 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 006A7C83F05 for ; Wed, 2 Jul 2025 05:32:32 +0000 (UTC) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mx.groups.io with SMTP id smtpd.web11.16674.1751434347803395171 for ; Tue, 01 Jul 2025 22:32:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hvp0TyX8; spf=pass (domain: gmail.com, ip: 209.85.214.177, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-234bfe37cccso77663645ad.0 for ; Tue, 01 Jul 2025 22:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751434347; x=1752039147; 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=0E8k7MUW5DLV2e+UwVZb4eOkEsYVEyQ3UiSk6gs6Bmw=; b=hvp0TyX8fPvqI0/9Nmpp9vhqIdynyvQfD9sxnNBLRcG/RP/J/AyuN0WVcJakmSBzdy surjie9HFVix/sfYo2ZeWKpetP+NUnOWjGImogcsHSh0DWqvoWJX54YTWri0auXFUcht fcIJqOLSiE4/KeratRTQcadtOWe9TPUOMT6BGXrfNzCdKA9LHjLJVxw0lJApSAg/RAyh pssBhss7ODX/gYxEadJ32wCes2xxLkQsDP93AiM48Ikc87vUQ5aCfv/WFz4LAmjRGQtg 2q3byHt/Yrkhq4Mc3DWfsMfOZDFcetB0U5o9gq+Drua/cBsOsZtNWMRPebdSvFLV3aYy 8rjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751434347; x=1752039147; 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=0E8k7MUW5DLV2e+UwVZb4eOkEsYVEyQ3UiSk6gs6Bmw=; b=Q3c3G+6Kl6pqaoHbVegjqC/WwIVZVymAycUJKGIoScvmtQvv2ajXTYtC18d7KZw4Fj Joj4re7XZ4aJJk5lqv36KimCqA5JzOvZFIqZl00+kZtoiRO/nvo2xCUm5Z2QHvMu7jfN CQpmiPhK350JDTygiAgv/8oLpW3j4mBdWtgLWCuWDU8LSivhYFOjTHq6tKn805vsD4fC IT6L0R8Frx9S3M3kyBZ0Z4QGk8RAgRFx7Md9BdqJBHMXvYRjQ1ckZmW2OO/dUAHSW1DJ Tuea7MFij/zwcYtiw96TGcI51vQNc8OcK/jvBIm4d6klkspC+QdBMlKJSTa9Bm11Xn5h //RA== X-Gm-Message-State: AOJu0YwSIuZnvBtE7W5rHcAl77/gLAtU8YXIkj8K2aY0XJCBQUnQyEcb 8QKRfWv1+yEa6ESGJMCpJuO1H3UdNdbmopedi/Pt5eEbwinBKOeGbM4hIftj8LKR X-Gm-Gg: ASbGncvytC4/DVVaZaZPASyAPllXjJviUL8mHXwpv7mT5quoIF7PYvub9LmpGpkpycE fJuhqDtB5sFlpfhv7O3zYVco/HWFEc02RHBz7v8h/tU1z415YUa48Ew8cM84LR+OyvE/w6IEkkr aw2Ho9JZwO9iWV7HmHWYzgBG7/FGzThSP077XIZDGQr8uTvlWowwiAQ93cLbkvcbDto7x5LEcJj BJJrIRlLFog/e2I9f5dfhHzRYeBZ+ZvSmr+MC1v54RrnstnII1IukeWSP5Kcw0xVgi4YjhCYT2v XOmh8jPmlVhc2UsSZEFI0u142xi0XFzVYX5cW5q83RSH7pFbavlJqg== X-Google-Smtp-Source: AGHT+IEkPvJV8L87pI5uCd8lc5uBFKFGio6bLCHkONaagTilE7otuhNIKxo/ozpW81cta6nQaPQ32A== X-Received: by 2002:a17:903:19c5:b0:234:8a4a:adb4 with SMTP id d9443c01a7336-23c6e583883mr25445375ad.21.1751434346897; Tue, 01 Jul 2025 22:32:26 -0700 (PDT) Received: from apollo.localdomain ([2601:646:8201:fd20::aa8c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2e2423sm120125985ad.37.2025.07.01.22.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 22:32:26 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version Date: Tue, 1 Jul 2025 22:32:20 -0700 Message-ID: <20250702053220.4104358-5-raj.khem@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250702053220.4104358-1-raj.khem@gmail.com> References: <20250702053220.4104358-1-raj.khem@gmail.com> MIME-Version: 1.0 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, 02 Jul 2025 05:32:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/219778 This assumes GCC compiler, so feed it one, BUILD_CC might point to clang as well in that case it fails. Signed-off-by: Khem Raj --- meta/lib/oe/utils.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 27d304ec72d..d31f8c3db36 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -446,21 +446,17 @@ def host_gcc_version(d, taskcontextonly=False): if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1': return - compiler = d.getVar("BUILD_CC") - # Get rid of ccache since it is not present when parsing. - if compiler.startswith('ccache '): - compiler = compiler[7:] try: env = os.environ.copy() env["PATH"] = d.getVar("PATH") - output = subprocess.check_output("%s --version" % compiler, \ + output = subprocess.check_output("gcc --version", \ shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8") except subprocess.CalledProcessError as e: - bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8"))) + bb.fatal("Error running gcc --version: %s" % (e.output.decode("utf-8"))) match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0]) if not match: - bb.fatal("Can't get compiler version from %s --version output" % compiler) + bb.fatal("Can't get compiler version from gcc --version output") version = match.group(1) return "-%s" % version if version in ("4.8", "4.9") else ""