Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp581643pxb; Thu, 21 Oct 2021 05:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQWtSYluD1V8KebngHSK/qzacd9s/T2kP6I3cmfo50/vTW8nwPBvn0oUka9lU00tuXDbOG X-Received: by 2002:a17:906:bceb:: with SMTP id op11mr7185660ejb.449.1634819978349; Thu, 21 Oct 2021 05:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634819978; cv=none; d=google.com; s=arc-20160816; b=uDam+9VTryxoX+E3Z3zf24fLt4JTVrVyo73uVZ5PUZMLvZmRyOx31T9PXYsOvAxMzr /pzq4ecYg765y4WQsKRT+tn9/9+VM/q4PA7CDD5LDQ3hcnCJtQQEnFofARPJnK6T6CaN k/3Zp+ECJEglgCm4dYBXl5niQCTsKLm/0ZSmUJCM27fM3bRPLADRIuzBzUIxPrJzqAth 136aK1BAAwsdVYxrzw8eUCcWF+Nx8F9akQxa7KavwtjQBqpKlfKX8yASjLtqqdjHYCc1 VAWPJBU6OlfMs8F4SgTLBkMq95XTGVpBelPUgUENtl5ErBwQL2zsR8JDgNYg6ClHvXqQ MK6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=9B3sY2jard03K9fYv0NfQj2GJT7nFcy1REW5rDG7vr0=; b=zXl+2g2HAFn9GrHaUmYJ+Mkg7r/7mT1TonuNZrnk2z4M0OdrIWm+wX0xDcVRv9G5el 9J6llqRMxvKiWXP6KuiikIaQt8Qz9IluZeZHa/IVUbMV9BI+lFZ1lGgzgQnZimjoq/na Gd61mxeSdj/6g/MvdxeI/DzCyKl6IYr+swLuv8oACFJxC5aPS4yOXsvXc8/A1G4SvoiS NilKb1B24kwABIGrrqSeqtTs5E0ONLxucG4Lqw7y+eXv0q8kAjXGPEFQ6SIoxWaU7n3h wyBHZ0EKEiQvX6ChgiXHjMtFVkXkiLi/v96o2ODk2fR1Dd0IRympm1vs/ymHBjxXmisp uOBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si8154144ejq.512.2021.10.21.05.39.14; Thu, 21 Oct 2021 05:39:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbhJUMjj (ORCPT + 99 others); Thu, 21 Oct 2021 08:39:39 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:25307 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230508AbhJUMji (ORCPT ); Thu, 21 Oct 2021 08:39:38 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HZn1n73CVzbglW; Thu, 21 Oct 2021 20:32:45 +0800 (CST) Received: from dggpemm500019.china.huawei.com (7.185.36.180) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 21 Oct 2021 20:37:20 +0800 Received: from ubuntu1804.huawei.com (10.67.174.98) by dggpemm500019.china.huawei.com (7.185.36.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 21 Oct 2021 20:37:20 +0800 From: Pu Lehui To: , , , , , , , , , CC: , , , , Subject: [PATCH bpf-next] samples: bpf: Suppress readelf stderr when probing for BTF support Date: Thu, 21 Oct 2021 20:39:13 +0800 Message-ID: <20211021123913.48833-1-pulehui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.98] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500019.china.huawei.com (7.185.36.180) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When compiling bpf samples, the following warning appears: readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF sections of machine number 247 readelf: Warning: unable to apply unsupported reloc type 10 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 1 to section .debug_info readelf: Warning: unable to apply unsupported reloc type 10 to section .debug_info Same problem was mentioned in commit 2f0921262ba9 ("selftests/bpf: suppress readelf stderr when probing for BTF support"), let's use readelf that supports btf. Signed-off-by: Pu Lehui --- samples/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 2366242edb7c..a886dff1ba89 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -229,6 +229,7 @@ CLANG ?= clang OPT ?= opt LLVM_DIS ?= llvm-dis LLVM_OBJCOPY ?= llvm-objcopy +LLVM_READELF ?= llvm-readelf BTF_PAHOLE ?= pahole # Detect that we're cross compiling and use the cross compiler @@ -252,7 +253,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF) BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm') BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \ $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \ - readelf -S ./llvm_btf_verify.o | grep BTF; \ + $(LLVM_READELF) -S ./llvm_btf_verify.o | grep BTF; \ /bin/rm -f ./llvm_btf_verify.o) BPF_EXTRA_CFLAGS += -fno-stack-protector -- 2.17.1