Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4806263iob; Mon, 9 May 2022 02:00:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTbidK1hK6b2oEfsrF2gIo1vEe/szWNa9tthh144QRbM3FaQ4Fsdr4eE5snNrmH6tscxoB X-Received: by 2002:a5e:820a:0:b0:649:5b8:d02c with SMTP id l10-20020a5e820a000000b0064905b8d02cmr6182417iom.50.1652086799896; Mon, 09 May 2022 01:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652086799; cv=none; d=google.com; s=arc-20160816; b=f81wwgYeBjANcs5DD+5ut3hOl9W9KMFESWrfpPMjK5B1GouuAq/m3msRwrU83HM27a CjJ3f5RRhpOwJIPf6EmFWmMEy1theb5H2vG0uvzGLRQP0aVEY4OVQt0YfqrFnogyXYnS Pp234aSXlxUNGN4RFH8irTBlNqf3hTCVmvTdfK1Scwn8ijIWk5+Im5qLas5Xg3p7LK5g ev1iBFu11UsK374tKNK3GIODsFzkC4LkZuDfpdN7plOlIV3huYn45p4NE7UQ91Ki2K79 gL2M40CH31GmkLnAWHBYcG6nT3Y1/vCBE0IylxyQAJUR3Hl9xqghobV0lrAmeKh1oBzo WxJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CUuc+lgOyGwvC+Mjteke+5WNN677eQkpHYS3l7z3q2M=; b=BiPW3ZIyOAFngoV8jocUu17IUra1LTh+MtF8E2SrQa7Zxw4b470jXmhYrNVDTWjUdt bYf6650pxfV/cluIc7+Vy6TwgjXl/JYCO7ZIa4yjcnNyLoxyfchqcdG1X+xvU+6MuRRK ChL0wC7HrIWEbjcr/6mYBV8xV5zuACMahvmJSJSgIWSZKJnpzCWdtA/GFOWby/kU4WO1 43E7s+x81i29ba+amTBUNAOiqJcJ5cTrGI6ylSH5FsDphYx7PCKPWx6q2r2fLfFgUb0I boG5Vuc9Rr7Z/Whl2IhaFjJ3D1uJJY+fCbI3YES2gWf4A6/eDUGzX/L7HUlHi2TXVGy/ TAhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ZqI/hsux"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u10-20020a056e02170a00b002ca618dc8desi11760170ill.103.2022.05.09.01.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:59:59 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ZqI/hsux"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86D0F1660A9; Mon, 9 May 2022 01:46:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386185AbiEGQUl (ORCPT + 99 others); Sat, 7 May 2022 12:20:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386143AbiEGQUg (ORCPT ); Sat, 7 May 2022 12:20:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6CD7C22B08 for ; Sat, 7 May 2022 09:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651940207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CUuc+lgOyGwvC+Mjteke+5WNN677eQkpHYS3l7z3q2M=; b=ZqI/hsuxZ/V+jWULtrpgm8sNp3e/0Hkn75p4J4GGXInGlPlxhCDEabmYS64Zd0sT+dPlUX 4pBoWkIyix7w0zQiwwteC764tn0AFzbagown/rSI2p8gz7JdRItDr7CC+4+DbKaV6H4eNJ 1hPk8c67jBqhuasrJLYrhr8guV/fwrg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-98-GiYN5q7rMb6f8rRsHdpnfw-1; Sat, 07 May 2022 12:16:41 -0400 X-MC-Unique: GiYN5q7rMb6f8rRsHdpnfw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96AD038041E5; Sat, 7 May 2022 16:16:40 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.81]) by smtp.corp.redhat.com (Postfix) with SMTP id B36B240CFD0C; Sat, 7 May 2022 16:16:36 +0000 (UTC) Received: by localhost.localdomain (sSMTP sendmail emulation); Sat, 07 May 2022 18:16:35 +0200 From: "Jerome Marchand" To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Kumar Kartikeya Dwivedi Cc: Jerome Marchand , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] samples: bpf: Don't fail for a missing VMLINUX_BTF when VMLINUX_H is provided Date: Sat, 7 May 2022 18:16:35 +0200 Message-Id: <20220507161635.2219052-1-jmarchan@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org samples/bpf build currently always fails if it can't generate vmlinux.h from vmlinux, even when vmlinux.h is directly provided by VMLINUX_H variable, which makes VMLINUX_H pointless. Only fails when neither method works. Fixes: 384b6b3bbf0d ("samples: bpf: Add vmlinux.h generation support") Reported-by: CKI Project Reported-by: Veronika Kabatova Signed-off-by: Jerome Marchand --- samples/bpf/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 38638845db9d..72bb85c18804 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -368,16 +368,15 @@ VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS)))) $(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) ifeq ($(VMLINUX_H),) +ifeq ($(VMLINUX_BTF),) + $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\ + build the kernel or set VMLINUX_BTF or VMLINUX_H variable) +endif $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ else $(Q)cp "$(VMLINUX_H)" $@ endif -ifeq ($(VMLINUX_BTF),) - $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\ - build the kernel or set VMLINUX_BTF variable) -endif - clean-files += vmlinux.h # Get Clang's default includes on this system, as opposed to those seen by -- 2.35.1