Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2163744rwl; Fri, 6 Jan 2023 02:48:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtPHalA3+YoWH2W2nKJ9I/1t17Oq7093H1Yz0469yXz31kz36jLNcQ3DS4V5Feo4VQolQOp X-Received: by 2002:a17:902:f392:b0:189:eaae:a19c with SMTP id f18-20020a170902f39200b00189eaaea19cmr48487835ple.30.1673002101619; Fri, 06 Jan 2023 02:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673002101; cv=none; d=google.com; s=arc-20160816; b=D8sHsTjZ5TxS4BNa9jRmun1mXoh/bynl4T7t2IR+exOzE2xs4Z6pJmVnFdu3teajLF oyA5m+fzPUAfvilcoNDUBsE4Og9Qgzq0lpkUZMb0+EYyGZ/Kpjxl1SxObKhlPQEDY97C ODxxgHBTulQMch1DUMEin/TqNX0pII1cZ5dnaXxSUhxd3eN7CV0m0R94JID0OBP+CdRp CRqzvM2t/8rzACbLCVh2mIyxmp9eMnotJPbOzSlot0ENCA820Q0btnPPj/rtAgNFyljv fVf1uRT7D4uHhex3THv8baBwjLOxrzdRT6QTbICyQyT7pTXPOaBkDaPOCMYyzs+9Vwaj BiBw== 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=PziZJrBZEmAJ2mCxXBb9H2GVdzSAZnr8fRD1vWo64L8=; b=MLLsomuPhClHMOxqqXRdFaBKU2PUuxJcpDU25KbS3MMTAPjWS0x2w6X+f0tT1QnqtL DWpX1eMmnwo/2bw9pEMqCY5f5x85DAHxV444zWQeJRlMECaHTt7/wX7Z/wR3PlLh4P/P 0JeZFjYWXJc+z02YfATqOmvEpk4GEq/cIs6/NLJRP9ihWzhrSqJfDlrFV8ScPCDxaTm5 XFEe5hxEKN+ToxqzHSvb83SqKtPChza3jbSAgx3uoc6G/wQDojoWKzljvVCxxa4z/k4n qmOARw7xaKlkppDaR7Rcu+ndQK6vpfs+SmEQD4BJbyCW8S2k6U1Nk2bHHMAYsQnNYFN0 iw0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RxyjeyLZ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k6-20020a170902c40600b001914601fe68si889156plk.164.2023.01.06.02.48.14; Fri, 06 Jan 2023 02:48:21 -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=RxyjeyLZ; 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 S229634AbjAFKZT (ORCPT + 54 others); Fri, 6 Jan 2023 05:25:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233747AbjAFKYh (ORCPT ); Fri, 6 Jan 2023 05:24:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B21746A0CA for ; Fri, 6 Jan 2023 02:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673000628; 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=PziZJrBZEmAJ2mCxXBb9H2GVdzSAZnr8fRD1vWo64L8=; b=RxyjeyLZojTSm37QhhkPqcGT+A8tSghW3KOMqxVTaBI9W+iDXpmSb3tyh9XrCjNtCbQqBu MyGThob1zxBPQ8ottD9r9ugFwkDZMOSRzeXh7IkvlFpLNCC8gMxpbyzZc4TaDBMCcXrsR/ +qK8hpK2+UlD2tC9kBHMn+7WzxTsmdw= 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-112-k44jRNtVMl-k4sI-WSFmwg-1; Fri, 06 Jan 2023 05:23:44 -0500 X-MC-Unique: k44jRNtVMl-k4sI-WSFmwg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 430BD1871D9A; Fri, 6 Jan 2023 10:23:44 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.192.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50775C15BAD; Fri, 6 Jan 2023 10:23:42 +0000 (UTC) From: Benjamin Tissoires To: Greg KH , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Dmitry Torokhov Cc: Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, Benjamin Tissoires Subject: [PATCH HID for-next v1 2/9] selftests: hid: allow to compile hid_bpf with LLVM Date: Fri, 6 Jan 2023 11:23:25 +0100 Message-Id: <20230106102332.1019632-3-benjamin.tissoires@redhat.com> In-Reply-To: <20230106102332.1019632-1-benjamin.tissoires@redhat.com> References: <20230106102332.1019632-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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 clang doesn't like to compile a source to the final binary directly: clang-14: error: cannot specify -o when generating multiple output files So split the final rule in 2, and ensure we compile all dependencies before. Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/hid/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile index f6fc5cfff770..83e8f87d643a 100644 --- a/tools/testing/selftests/hid/Makefile +++ b/tools/testing/selftests/hid/Makefile @@ -91,10 +91,6 @@ $(MAKE_DIRS): $(call msg,MKDIR,,$@) $(Q)mkdir -p $@ -$(OUTPUT)/%.o: %.c - $(call msg,CC,,$@) - $(Q)$(CC) $(CFLAGS) -c $(filter %.c,$^) $(LDLIBS) -o $@ - # LLVM's ld.lld doesn't support all the architectures, so use it only on x86 ifeq ($(SRCARCH),x86) LLD := lld @@ -223,7 +219,11 @@ $(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) $(KHDR_INCLUDES)/linux/hid.h +$(OUTPUT)/%.o: %.c $(BPF_SKELS) $(KHDR_INCLUDES)/linux/hid.h + $(call msg,CC,,$@) + $(Q)$(CC) $(CFLAGS) -c $(filter %.c,$^) $(LDLIBS) -o $@ + +$(OUTPUT)/%: $(OUTPUT)/%.o $(call msg,BINARY,,$@) $(Q)$(LINK.c) $^ $(LDLIBS) -o $@ -- 2.38.1