From patchwork Fri Jan 13 09:09:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 43101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp167275wrt; Fri, 13 Jan 2023 01:16:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXsCS5pZPYceqykBvTfdX7imm+ASC7GpVqq25NgpqzDIpLqSWyN/GJ4X8qIUllHqH/YfseAT X-Received: by 2002:a17:907:d311:b0:86a:2c18:e422 with SMTP id vg17-20020a170907d31100b0086a2c18e422mr2182352ejc.77.1673601412199; Fri, 13 Jan 2023 01:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673601412; cv=none; d=google.com; s=arc-20160816; b=cqeSnOUV+AJbhm8QjZgK20vEGsQBT+nEOUVmv2/x7HsoHPXdrE2mkCe8cgzQaezQ/5 TPvpF9zEjW5Jhd6GYLqFSAu8FOn1RSaFxyidoOm4/FM7W93kPMVcLfQkkUiNLxhZ92ZE GJtcPVeqezuG7my17ksz1DOCkalMD0C1TtPtNXlgT0kAb5/vZciJu3QmOoSj6o0LHDHU JNL9kadEoyNlLXFEwUetXDNycCB8NxHFsbbPvqICCWsUAyNJLq8BNHDPZ5OaqOF2h7qa gnHayopgMQxxeDcB+FVqg81QkVV+j68YJkPbis8NHnstmjF03quk5TAXhn3+0P6c+Sr4 VXuA== 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=RNKQ8lij9GJnJFwIqDvh0GiiDKlQ9djpTpCO2RWvjlI=; b=S69iDtZBpProfYX19HNyxXPBk+q7T5pTbb4hp8KAvhlW98CvUgokTCUOOm1C+MBsE9 YvrSi6SUX9Ecln4mZVV+l/PTvIaF8LYxLJCO27dDx+9ksasgzfYjGYKhu668YXpp1B96 onyuAWWBoWT8kMEreTWGn5KQU68T0F2UIKfg+S8Jskunybo4mHdTo5qgnBQG5V+cdPkC qNu9qX9HuzymVx9mB9Bz3azK/zIv+EuiHKaMtFOObmrXBGAenqhZoeTpFtLvGnUAqsni ZW1XTox0g+pxasTjzN6Wf4bxvL/9AQqErO37BUmwO3PJC+is7L8oqeLXpOEonooItLr/ t7cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="S/BtqWDO"; 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 dn21-20020a17090794d500b0084b9ac8f8a3si24106265ejc.836.2023.01.13.01.16.27; Fri, 13 Jan 2023 01:16:52 -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="S/BtqWDO"; 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 S240331AbjAMJMh (ORCPT + 99 others); Fri, 13 Jan 2023 04:12:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240194AbjAMJMI (ORCPT ); Fri, 13 Jan 2023 04:12:08 -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 3C9297665 for ; Fri, 13 Jan 2023 01:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673600990; 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=RNKQ8lij9GJnJFwIqDvh0GiiDKlQ9djpTpCO2RWvjlI=; b=S/BtqWDOxxfubyXSZb0OPCpZgSjzTf8qZ7QUonW7LogLRpCav4stL91DxqL/zKNq2H3t7z zixc0i+VHUesauWb54ARn0UFDP4JJxWIbRdaHS/ZkuChixhoxSwrYx7aVXepsb3EFWHioy tb+tDu9sX1siU+9qXQ9GS9QXcTogXKQ= 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-623-0FU3mqukMnCQOpQBZwO4bQ-1; Fri, 13 Jan 2023 04:09:45 -0500 X-MC-Unique: 0FU3mqukMnCQOpQBZwO4bQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B322F1C051A8; Fri, 13 Jan 2023 09:09:44 +0000 (UTC) Received: from plouf.redhat.com (ovpn-193-50.brq.redhat.com [10.40.193.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 836801121314; Fri, 13 Jan 2023 09:09: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 v2 2/9] selftests: hid: allow to compile hid_bpf with LLVM Date: Fri, 13 Jan 2023 10:09:28 +0100 Message-Id: <20230113090935.1763477-3-benjamin.tissoires@redhat.com> In-Reply-To: <20230113090935.1763477-1-benjamin.tissoires@redhat.com> References: <20230113090935.1763477-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754898274447418793?= X-GMAIL-MSGID: =?utf-8?q?1754898274447418793?= 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 --- no changes in v2 --- 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 $@