From patchwork Tue Dec 20 12:52:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 16985 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 3476AC10F1E for ; Tue, 20 Dec 2022 12:52:33 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.49382.1671540746368752893 for ; Tue, 20 Dec 2022 04:52:26 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 449A12F4; Tue, 20 Dec 2022 04:53:06 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6E5D3F703; Tue, 20 Dec 2022 04:52:24 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Cc: nd@arm.com Subject: [PATCH][kirkstone 1/3] ci/get-binary-toolchains: rewrite, slightly Date: Tue, 20 Dec 2022 12:52:18 +0000 Message-Id: <20221220125220.3239346-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 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 ; Tue, 20 Dec 2022 12:52:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4206 Add set -e so errors are fatal. Allow HOST_ARCH and VER to be overridden by the environment, for testing. Pull the tarball basename into a variable to reduce duplication. Turn the wget call into a function to reduce duplication. Drop the big-endian binaries as we never use those. Signed-off-by: Ross Burton --- ci/get-binary-toolchains | 42 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/ci/get-binary-toolchains b/ci/get-binary-toolchains index cd4c25ef..0a68033a 100755 --- a/ci/get-binary-toolchains +++ b/ci/get-binary-toolchains @@ -1,8 +1,9 @@ #!/bin/bash -set -u +set -u -e -HOST_ARCH=$(uname -m) -VER="10.3-2021.07" +BASENAME=gcc-arm +VER=${VER:-10.3-2021.07} +HOST_ARCH=${HOST_ARCH:-$(uname -m)} DOWNLOAD_DIR=$1 TOOLCHAIN_DIR=$2 @@ -11,36 +12,39 @@ TOOLCHAIN_LINK_DIR=$3 # These should be already created by .gitlab-ci.yml, but do here if run outside of that env mkdir -p $DOWNLOAD_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR +download() { + TRIPLE=$1 + URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/$VER/binrel/$BASENAME-$VER-$HOST_ARCH-$TRIPLE.tar.xz + wget -P $DOWNLOAD_DIR -nc $URL +} + if [ $HOST_ARCH = "aarch64" ]; then - #AArch64 Linux hosted cross compilers + # AArch64 Linux hosted cross compilers - #AArch32 target with hard float (arm-none-linux-gnueabihf) - wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz + # AArch32 target with hard float + download arm-none-linux-gnueabihf elif [ $HOST_ARCH = "x86_64" ]; then - #x86_64 Linux hosted cross compilers - - #AArch32 target with hard float (arm-linux-none-gnueabihf) - wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-arm-none-linux-gnueabihf.tar.xz + # x86_64 Linux hosted cross compilers - #AArch64 GNU/Linux target (aarch64-none-linux-gnu) - wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64-none-linux-gnu.tar.xz + # AArch32 target with hard float + download arm-none-linux-gnueabihf - #AArch64 GNU/Linux target (aarch64_be-none-linux-gnu) - wget -P $DOWNLOAD_DIR -nc https://developer.arm.com/-/media/Files/downloads/gnu/$VER/binrel/gcc-arm-$VER-$HOST_ARCH-aarch64_be-none-linux-gnu.tar.xz + # AArch64 GNU/Linux target + download aarch64-none-linux-gnu else echo "ERROR - Unknown build arch of $HOST_ARCH" exit 1 fi -for i in arm aarch64 aarch64_be; do - if [ ! -d $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*/ ]; then - if [ ! -f $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz ]; then +for i in arm aarch64; do + if [ ! -d $TOOLCHAIN_DIR/$BASENAME-$VER-$HOST_ARCH-$i-none-linux-gnu*/ ]; then + if [ ! -f $DOWNLOAD_DIR/$BASENAME-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz ]; then continue fi - tar -C $TOOLCHAIN_DIR -axvf $DOWNLOAD_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz + tar -C $TOOLCHAIN_DIR -axvf $DOWNLOAD_DIR/$BASENAME-$VER-$HOST_ARCH-$i-none-linux-gnu*.tar.xz fi # Setup a link for the toolchain to use local to the building machine (e.g., not in a shared location) - ln -s $TOOLCHAIN_DIR/gcc-arm-$VER-$HOST_ARCH-$i-none-linux-gnu* $TOOLCHAIN_LINK_DIR/$i + ln -s $TOOLCHAIN_DIR/$BASENAME-$VER-$HOST_ARCH-$i-none-linux-gnu* $TOOLCHAIN_LINK_DIR/$i done From patchwork Tue Dec 20 12:52:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 16987 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 35895C46467 for ; Tue, 20 Dec 2022 12:52:33 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.49383.1671540746798930822 for ; Tue, 20 Dec 2022 04:52:26 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E4A69AD7; Tue, 20 Dec 2022 04:53:06 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 846D83F703; Tue, 20 Dec 2022 04:52:25 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Cc: nd@arm.com Subject: [PATCH][kirkstone 2/3] CI: add patches to fix perf with clang Date: Tue, 20 Dec 2022 12:52:19 +0000 Message-Id: <20221220125220.3239346-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220125220.3239346-1-ross.burton@arm.com> References: <20221220125220.3239346-1-ross.burton@arm.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 ; Tue, 20 Dec 2022 12:52:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4207 Apply two in-flight patches to fix the build of perf with clang. Signed-off-by: Ross Burton --- 0001-linux-yocto-fix-perf-with-clang.patch | 132 +++++++++++++++++++++ ci/clang.yml | 5 + 2 files changed, 137 insertions(+) create mode 100644 0001-linux-yocto-fix-perf-with-clang.patch diff --git a/0001-linux-yocto-fix-perf-with-clang.patch b/0001-linux-yocto-fix-perf-with-clang.patch new file mode 100644 index 00000000..6aae7ca3 --- /dev/null +++ b/0001-linux-yocto-fix-perf-with-clang.patch @@ -0,0 +1,132 @@ +From fc2e155f4127935d11a6fc2de2af934f379b5416 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Mon, 19 Dec 2022 12:25:06 +0000 +Subject: [PATCH] linux-yocto: fix perf with clang + +Signed-off-by: Ross Burton +--- + ...hon-Account-for-multiple-words-in-CC.patch | 98 +++++++++++++++++++ + meta/recipes-kernel/linux/linux-yocto_5.15.bb | 2 + + 2 files changed, 100 insertions(+) + create mode 100644 meta/recipes-kernel/linux/files/0001-perf-python-Account-for-multiple-words-in-CC.patch + +diff --git a/meta/recipes-kernel/linux/files/0001-perf-python-Account-for-multiple-words-in-CC.patch b/meta/recipes-kernel/linux/files/0001-perf-python-Account-for-multiple-words-in-CC.patch +new file mode 100644 +index 00000000000..e9f5ab9d836 +--- /dev/null ++++ b/meta/recipes-kernel/linux/files/0001-perf-python-Account-for-multiple-words-in-CC.patch +@@ -0,0 +1,98 @@ ++https://lore.kernel.org/linux-perf-users/Y5d4k7fDxfRP7hcN@kernel.org/T/ ++https://lore.kernel.org/bpf/20221205025039.149139-1-raj.khem@gmail.com/T/ ++ ++Upstream-Status: Submitted ++Signed-off-by: Ross Burton ++ ++From ec36ad2d4842fa324d532fe49ff2aa67f7e3e939 Mon Sep 17 00:00:00 2001 ++From: Khem Raj ++Date: Sun, 4 Dec 2022 18:50:39 -0800 ++Subject: [PATCH 1/2] libbpf: Fix build warning on ref_ctr_off ++ ++Clang warns on 32-bit ARM on this comparision ++ ++libbpf.c:10497:18: error: result of comparison of constant 4294967296 with expression of type 'size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] ++ if (ref_ctr_off >= (1ULL << PERF_UPROBE_REF_CTR_OFFSET_BITS)) ++ ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++ ++Check for platform long int to be larger than 32-bits before enabling ++this check, it false on 32bit anyways. ++ ++Cc: Alexei Starovoitov ++Cc: Daniel Borkmann ++Cc: Song Liu ++Cc: Yonghong Song ++Cc: Jiri Olsa ++Cc: Paul Walmsley ++Cc: Palmer Dabbelt ++Cc: Nathan Chancellor ++Cc: Nick Desaulniers ++ ++Signed-off-by: Khem Raj ++--- ++ tools/lib/bpf/libbpf.c | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c ++index 050622649797..596d9a335652 100644 ++--- a/tools/lib/bpf/libbpf.c +++++ b/tools/lib/bpf/libbpf.c ++@@ -9185,7 +9185,7 @@ static int perf_event_open_probe(bool uprobe, bool retprobe, const char *name, ++ char errmsg[STRERR_BUFSIZE]; ++ int type, pfd, err; ++ ++- if (ref_ctr_off >= (1ULL << PERF_UPROBE_REF_CTR_OFFSET_BITS)) +++ if (BITS_PER_LONG > 32 && ref_ctr_off >= (1ULL << PERF_UPROBE_REF_CTR_OFFSET_BITS)) ++ return -EINVAL; ++ ++ type = uprobe ? determine_uprobe_perf_type() ++-- ++2.34.1 ++ ++ ++From 08bdb3dba2ace03bc48e25b9a6136fc48e1991c9 Mon Sep 17 00:00:00 2001 ++From: Khem Raj ++Date: Sun, 4 Dec 2022 18:55:34 -0800 ++Subject: [PATCH 2/2] perf python: Account for multiple words in CC ++ ++Sometimes build systems may append options e.g. --sysroot etc. to CC ++variable especially in cross-compile environments like yocto project ++where CC varable is composed of cross-compiler name and some needed ++options for it to work in a relocatable environment. Therefore separate ++out the compiler name from rest of the options in CC, then add the ++options via second argument to Popen() API ++ ++Cc: Adrian Hunter ++Cc: Fangrui Song ++Cc: Florian Fainelli ++Cc: Ian Rogers ++Cc: Jiri Olsa ++Cc: John Keeping ++Cc: Leo Yan ++Cc: Michael Petlan ++Cc: Namhyung Kim ++Cc: Nathan Chancellor ++Cc: Nick Desaulniers ++Cc: Sedat Dilek ++Signed-off-by: Khem Raj ++Reviewed-by: Florian Fainelli ++--- ++ tools/perf/util/setup.py | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py ++index c255a2c90cd6..3699b3f8d2d7 100644 ++--- a/tools/perf/util/setup.py +++++ b/tools/perf/util/setup.py ++@@ -7,7 +7,7 @@ cc_is_clang = b"clang version" in Popen([cc.split()[0], "-v"], stderr=PIPE).stde ++ src_feature_tests = getenv('srctree') + '/tools/build/feature' ++ ++ def clang_has_option(option): ++- cc_output = Popen([cc, option, path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines() +++ cc_output = Popen([cc.split()[0], str(cc.split()[1:]) + option, path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines() ++ return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o))] == [ ] ++ ++ if cc_is_clang: ++-- ++2.34.1 ++ +diff --git a/meta/recipes-kernel/linux/linux-yocto_5.15.bb b/meta/recipes-kernel/linux/linux-yocto_5.15.bb +index d5f21daf35b..d9535e65a97 100644 +--- a/meta/recipes-kernel/linux/linux-yocto_5.15.bb ++++ b/meta/recipes-kernel/linux/linux-yocto_5.15.bb +@@ -37,6 +37,8 @@ KBRANCH:class-devupstream = "v5.15/base" + SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \ + git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.15;destsuffix=${KMETA}" + ++SRC_URI += "file://0001-perf-python-Account-for-multiple-words-in-CC.patch" ++ + LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" + LINUX_VERSION ?= "5.15.78" + +-- +2.34.1 + diff --git a/ci/clang.yml b/ci/clang.yml index a2063f19..6aacbff7 100644 --- a/ci/clang.yml +++ b/ci/clang.yml @@ -4,6 +4,11 @@ header: repos: meta-clang: url: https://github.com/kraj/meta-clang + poky: + patches: + perf: + repo: meta-arm + path: 0001-linux-yocto-fix-perf-with-clang.patch local_conf_header: clang: | From patchwork Tue Dec 20 12:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 16986 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 37CF9C4167B for ; Tue, 20 Dec 2022 12:52:33 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.49385.1671540747076135013 for ; Tue, 20 Dec 2022 04:52:27 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 917321688; Tue, 20 Dec 2022 04:53:07 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 313C93F703; Tue, 20 Dec 2022 04:52:26 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Cc: nd@arm.com Subject: [PATCH][kirkstone 3/3] arm-bsp/linux-yocto: temporarily downgrade juno to 5.15.72 Date: Tue, 20 Dec 2022 12:52:20 +0000 Message-Id: <20221220125220.3239346-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221220125220.3239346-1-ross.burton@arm.com> References: <20221220125220.3239346-1-ross.burton@arm.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 ; Tue, 20 Dec 2022 12:52:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4208 The mailbox patches don't apply to 5.15.78 so until they can be rebased and retested, pin the kernel to 5.15.72. Signed-off-by: Ross Burton --- meta-arm-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-arm-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend diff --git a/meta-arm-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend b/meta-arm-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend new file mode 100644 index 00000000..b0bbfeff --- /dev/null +++ b/meta-arm-bsp/recipes-kernel/linux/linux-yocto_5.15.bbappend @@ -0,0 +1,3 @@ +# This is only needed until the juno patches are updated to the latest 5.15 release. +LINUX_VERSION:juno = "5.15.72" +SRCREV_machine:juno = "0b628306d1f9ea28c0e86369ce9bb87a47893c9c"