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: 30367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2876543wrr; Tue, 6 Dec 2022 07:10:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6YSGw94ekqzR37SpuyCb5czLf+ISylCjwUS/k3ImFicnWIPFN2U9zJrG1FV2d/E8O6Date X-Received: by 2002:a17:906:2d49:b0:7ae:16a9:e4d7 with SMTP id e9-20020a1709062d4900b007ae16a9e4d7mr72116386eji.574.1670339427211; Tue, 06 Dec 2022 07:10:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670339427; cv=none; d=google.com; s=arc-20160816; b=sxYi6gJzThw1H3b8dcrShQwkGbXl6fOFSx1Z5wjNBUtxlpD2obAHyn/YEyzCcGvGdA wwXPY0cv/yWKjmuQFb/z6jnopamX+i7fnW/survsH+LYvEly2ZBzY76Z3UmEs4Yr1aRF uX3suWx3w7dyhcfFTC9i/WVzgoxoK71xiedCnIh5aKWOjltWnCX9pZSDqVeZPnNWLVMO py1nMHVcQmJ/viigud1HggLAIJHD8zTSgwzbCH/2OjWadalR90lZgtHrY5oL+nXL+26y fnioH5JwBeDssla/VJT8hM//xjwQsrWTdMxhKMAiwIVKrQepVp/ByA/KIDQWYln4XXVl Yu4w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=j0Cs3s9/XrNdXYu1iTbXoXBPyJJ8fDscz+47ISINcok=; b=kZBd4ZL4KS5hnzK90iY3MxTIo5OwBhD9ybQ0Z1U0Yvx2gnCaZ7jsckZie2vFuYM2aT hF38jbJCA4wNdllAeD+imZH4Mq944p1tz4zqOH+9ziKND4bm+m7qYApXpg8so+4Bg8HS ybfvB4EMZy1MySVv1aOk8Dp/XBhBvRADRr+GMyHVHBzKMgD1b+mJZ41dzWs0XUyijRBl u1NYTJ/eXpZPtTr2+K1iqCSJCgiTxl0D0wiEaBXrWI9AIjL/L7sKlAY+q78dMK1VSNj0 yCigdFFuKdVKzdVVmBAcewk17KJkT6hhtg6ui2xWWtEaVC4wwgfAv+YYgvnnehtPRs4p u9NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GGJhlrh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020aa7c3cc000000b0046107f951f9si1914452edr.237.2022.12.06.07.09.47; Tue, 06 Dec 2022 07:10:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GGJhlrh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234995AbiLFPHz (ORCPT + 99 others); Tue, 6 Dec 2022 10:07:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235257AbiLFPGh (ORCPT ); Tue, 6 Dec 2022 10:06:37 -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 69E362E9DC for ; Tue, 6 Dec 2022 06:59:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670338796; 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=GGJhlrh5byor3DLfFJMNA8EDaVxu16EGP56caK5eV+68a4qdrVQXgcfew6Oe2n2segqHYX 7HeSW4nyLWmTJ1sHxnm0ZftgWs3F4Z59JFfFyUzUBjoGxl/Lx8DLEW5giNcHy9iivNmOEF HC7UCYG3vjCS+O8WxUUYeb1YVWBa80g= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751477835062035850?= X-GMAIL-MSGID: =?utf-8?q?1751477835062035850?= 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 $@