From patchwork Tue Dec 6 14:59:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 13066038 X-Patchwork-Delegate: bpf@iogearbox.net 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 108CDC63704 for ; Tue, 6 Dec 2022 15:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234997AbiLFPHb (ORCPT ); Tue, 6 Dec 2022 10:07:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233987AbiLFPGd (ORCPT ); Tue, 6 Dec 2022 10:06:33 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F0382FA72 for ; Tue, 6 Dec 2022 06:59:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670338798; 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: in-reply-to:in-reply-to:references:references; bh=j0Cs3s9/XrNdXYu1iTbXoXBPyJJ8fDscz+47ISINcok=; b=FmkOGya9M5QNAKPsp34ewrDGZf32kv/jhG1zSExbw8sUArnxFcWBGNN6Kr5gf+roJWMkZS ZlFt/3QiCUgOI8WR0UR1kODqGqKcX31tkdWF8rvUAk25kVKmH4ORTOq/AGHf9BauaHY5FI tCLCYoylsX2sWqFe44wil4PsZMUaNZI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-LwnsOCfJMjy305Ga6-HEwg-1; Tue, 06 Dec 2022 09:59:52 -0500 X-MC-Unique: LwnsOCfJMjy305Ga6-HEwg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 29AFA86C15F; Tue, 6 Dec 2022 14:59:52 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.193.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EF304A9254; Tue, 6 Dec 2022 14:59:50 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires , kernel test robot Subject: [PATCH HID for-next v3 5/5] kselftests: hid: fix missing headers_install step Date: Tue, 6 Dec 2022 15:59:36 +0100 Message-Id: <20221206145936.922196-6-benjamin.tissoires@redhat.com> In-Reply-To: <20221206145936.922196-1-benjamin.tissoires@redhat.com> References: <20221206145936.922196-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The Makefile was assuming that headers_install was already done in the top source directory, and was searching for installed uapi headers there. Unfortunately this is not the case and we need to manually call that step. To do so, reorder the declaration of the variables, and reuses top_srcdir provided by lib.mk Reported-by: kernel test robot Link: https://lore.kernel.org/all/202212060216.a6X8Py5H-lkp@intel.com/#t Signed-off-by: Benjamin Tissoires --- new in v3 --- tools/testing/selftests/hid/Makefile | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile index 693f1cb6e47a..f6fc5cfff770 100644 --- a/tools/testing/selftests/hid/Makefile +++ b/tools/testing/selftests/hid/Makefile @@ -7,17 +7,9 @@ include ../../../scripts/Makefile.include CXX ?= $(CROSS_COMPILE)g++ -CURDIR := $(abspath .) -TOOLSDIR := $(abspath ../../..) -TOP_SRCDIR = $(CURDIR)/../../../.. -KHDR_INCLUDES := $(TOP_SRCDIR)/usr/include -LIBDIR := $(TOOLSDIR)/lib -BPFDIR := $(LIBDIR)/bpf -TOOLSINCDIR := $(TOOLSDIR)/include -BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool HOSTPKG_CONFIG := pkg-config -CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(KHDR_INCLUDES) +CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(KHDR_INCLUDES) -I$(OUTPUT) LDLIBS += -lelf -lz -lrt -lpthread # Silence some warnings when compiled with clang @@ -53,9 +45,15 @@ endef include ../lib.mk +TOOLSDIR := $(top_srcdir)/tools +LIBDIR := $(TOOLSDIR)/lib +BPFDIR := $(LIBDIR)/bpf +TOOLSINCDIR := $(TOOLSDIR)/include +BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool SCRATCH_DIR := $(OUTPUT)/tools BUILD_DIR := $(SCRATCH_DIR)/build INCLUDE_DIR := $(SCRATCH_DIR)/include +KHDR_INCLUDES := $(SCRATCH_DIR)/uapi/include BPFOBJ := $(BUILD_DIR)/libbpf/libbpf.a ifneq ($(CROSS_COMPILE),) HOST_BUILD_DIR := $(BUILD_DIR)/host @@ -122,7 +120,6 @@ $(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) \ prefix= DESTDIR=$(HOST_SCRATCH_DIR)/ install-bin $(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ - $(KHDR_INCLUDES)/linux/bpf.h \ | $(BUILD_DIR)/libbpf $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \ EXTRA_CFLAGS='-g -O0' \ @@ -130,7 +127,6 @@ $(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ ifneq ($(BPFOBJ),$(HOST_BPFOBJ)) $(HOST_BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \ - $(KHDR_INCLUDES)/linux/bpf.h \ | $(HOST_BUILD_DIR)/libbpf $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) \ EXTRA_CFLAGS='-g -O0' ARCH= CROSS_COMPILE= \ @@ -147,6 +143,9 @@ else $(Q)cp "$(VMLINUX_H)" $@ endif +$(KHDR_INCLUDES)/linux/hid.h: $(top_srcdir)/include/uapi/linux/hid.h + $(MAKE) -C $(top_srcdir) INSTALL_HDR_PATH=$(SCRATCH_DIR)/uapi headers_install + $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ $(TOOLSDIR)/bpf/resolve_btfids/main.c \ $(TOOLSDIR)/lib/rbtree.c \ @@ -178,8 +177,7 @@ MENDIAN=$(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-mbig-endian) CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ - -I$(INCLUDE_DIR) -I$(CURDIR) -I$(KHDR_INCLUDES) \ - -I$(abspath $(OUTPUT)/../usr/include) + -I$(INCLUDE_DIR) CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \ -Wno-compare-distinct-pointer-types @@ -225,7 +223,7 @@ $(BPF_SKELS): %.skel.h: %.bpf.o $(BPFTOOL) | $(OUTPUT) $(Q)$(BPFTOOL) gen object $(<:.o=.linked1.o) $< $(Q)$(BPFTOOL) gen skeleton $(<:.o=.linked1.o) name $(notdir $(<:.bpf.o=)) > $@ -$(OUTPUT)/%:%.c $(BPF_SKELS) +$(OUTPUT)/%:%.c $(BPF_SKELS) $(KHDR_INCLUDES)/linux/hid.h $(call msg,BINARY,,$@) $(Q)$(LINK.c) $^ $(LDLIBS) -o $@