Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3316272pxb; Fri, 5 Nov 2021 13:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLsw1/bpRgAsuEVsKOvP2yT4Or7hn41zlw4M19+PmRDYDujfHwW7kdAKs9HMftv+H08C99 X-Received: by 2002:a05:6e02:b44:: with SMTP id f4mr8721330ilu.98.1636144278545; Fri, 05 Nov 2021 13:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636144278; cv=none; d=google.com; s=arc-20160816; b=in6Eo3+7Ti7TUwoxZ3FwhKYVjJlfz0G3P5lK105OJXuOHjupTBkQIf8XXjsHXS6fuq f3MkQ52xOfwFirdxPwPpqzFP3PnJ+s2BdddgMGebeVw7l7XsFjn4aFGOtyKRUnPvrggK K1hwkSQFaMoRLVX+2XpmER6pNRvKEI7yrifFyEnDd7YjUAhvj7g0Q3QHNZlxzSwU9uNq YVtWzFrN0GKC0hXs4Kk0kljJKm9LWE9HGeo42yY1acYPKVDhVtZdC9lSQvCLlEmtiHdq 4f/kP8lnWHOxhqmOgyeHpPq9htKKxzii9rY9FLqgc28r98Pw4H6pHlOlfe2XFPnlno4j 2ivQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Xctl1x0wAPIpZlnq6f38f2NZp6soUETgtNqOArwJJzM=; b=QAOh4d2lRJD6HKO04/my2+Lp7NTh8ziE/lqskHC1E41onLQ8EPtW3vzqHkPfovTfmy aWjCWoaDhsG32qPsvsYaYXaKRombzXkJwfVtcrY7AYCE0xHv7KfrCHPdtsbnxCIp5DN9 ABW1BbMX4jT4BU2Wckj5tN/Ux/mswmylXeyOhZ36SB6vKR4wwMazckBELdiHR2j8qlEs CyntmbvGRBX4iptirXNDv3F23GfYR+nZMwP6AzxiWpv59THokx7OzpItCzWeg782meWv Oe/WPfgNYfbXZAZHtDUvcUmybSlsfb9/JpKz0QtJQLRKwJlNy6NgTzJp/2enDhMpPeDB LqMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S901sIe1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si17079441ilv.55.2021.11.05.13.31.06; Fri, 05 Nov 2021 13:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S901sIe1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhKEUNB (ORCPT + 99 others); Fri, 5 Nov 2021 16:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbhKEUNA (ORCPT ); Fri, 5 Nov 2021 16:13:00 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35851C061714 for ; Fri, 5 Nov 2021 13:10:20 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id h11so16872425ljk.1 for ; Fri, 05 Nov 2021 13:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xctl1x0wAPIpZlnq6f38f2NZp6soUETgtNqOArwJJzM=; b=S901sIe1SJGG93aoKfsS855Gm77PThXsiZdupcnF8NawwhnX20BnCJNfQRT7I0TxMO 7NcAAYhXDHJaMszjR1y7zPAZkWv7APWLkT8ZjLXDov83/KLwmoy6vSVUnhLxm7eKCBnK dnez262baGeTrvWDGsfHLH47V/gt1WwLxxsskLRbr4mPEUnmM1M9YLeaTXMjsmUhfvD0 zPTBNTsyQG9JU5oXRLaS2d/xgnmCgHpaUo+yg0DZFT3D9+wtTukXpxUdHVEFlOneVsvW exrKtYaaOXZXXs6rOfxP6fuZjnNVZy5PAbZCtFKzOZ6w4c1y9/WRhoYskeoMslhytMZF qKSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xctl1x0wAPIpZlnq6f38f2NZp6soUETgtNqOArwJJzM=; b=2ErMh5jzlufY80U1e5IWZSRQ9hio0zDrX0lbKSLK7EYM+r2viEXWlIlFaH/beBu/DN ZlaPQb9MolwoAlxfCQlHr6f76Lkx9GK7HRTh1qB5aZ1MLt3DX8pYKFu47WXVtMUyT1RJ YF9pVGNMTDfQFmmv/Wy/lfXCDAlw+JuAPc6oaAFZeQ8dkzdFP5kczml5QuFobpuZzSD3 9vNa6KOVNCjraOgT24GzMueS0uZ2KyuzQWBY/+bGBYQwwm3TWKm4Z0Xkb9IqQlfLrypD m0EFBP9pxbBGYbWw0bvE7GLCqCjFKf+qSqfOTcaNXGBH5MaFg1HbBE6S65nZdIdTMX3p 5w/A== X-Gm-Message-State: AOAM530/7C9gRyFQ+dsCq9pOr8dVNnAv58Ee9IzAhdc8u3cdr4kKOKO8 vj/2FYQfWydvtnvUifgkCDWweg/OsOVLwfxVZrXY5w== X-Received: by 2002:a2e:834b:: with SMTP id l11mr31087388ljh.339.1636143017849; Fri, 05 Nov 2021 13:10:17 -0700 (PDT) MIME-Version: 1.0 References: <20211105162530.3307666-1-anders.roxell@linaro.org> In-Reply-To: <20211105162530.3307666-1-anders.roxell@linaro.org> From: Nick Desaulniers Date: Fri, 5 Nov 2021 13:10:07 -0700 Message-ID: Subject: Re: [PATCH 1/2] selftests: cgroup: build error multiple outpt files To: Anders Roxell Cc: shuah@kernel.org, christian@brauner.io, nathan@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Arnd Bergmann , Andrew Delgadillo Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 5, 2021 at 9:25 AM Anders Roxell wrote: > > When building selftests/cgroup: with clang the following error are seen: Thanks for the patches! typo in subject/oneline, and the `:` above can be dropped. Andrew reported similar failures throughout selftests: https://lore.kernel.org/linux-kselftest/20211005222739.2491124-1-adelg@google.com/ Both patches touch the same part of tools/testing/selftests/lib.mk. This approach looks cleaner to me, but it should reconcile the changes to tools/testing/selftests/filesystems/binderfs/Makefile that Andrew made in the link above. > > clang -Wall -pthread test_memcontrol.c cgroup_util.c ../clone3/clone3_selftests.h -o /home/anders/.cache/tuxmake/builds/current/kselftest/cgroup/test_memcontrol > clang: error: cannot specify -o when generating multiple output files > make[3]: *** [../lib.mk:146: /home/anders/.cache/tuxmake/builds/current/kselftest/cgroup/test_memcontrol] Error 1 > > Rework to add the header files to LOCAL_HDRS before including ../lib.mk, > since the dependency is evaluated in '$(OUTPUT)/%:%.c $(LOCAL_HDRS)' in > file lib.mk. > > Suggested-by: Arnd Bergmann > Signed-off-by: Anders Roxell > --- > tools/testing/selftests/cgroup/Makefile | 12 +++++++----- > tools/testing/selftests/lib.mk | 2 +- > 2 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/Makefile b/tools/testing/selftests/cgroup/Makefile > index 59e222460581..745fe25fa0b9 100644 > --- a/tools/testing/selftests/cgroup/Makefile > +++ b/tools/testing/selftests/cgroup/Makefile > @@ -11,10 +11,12 @@ TEST_GEN_PROGS += test_core > TEST_GEN_PROGS += test_freezer > TEST_GEN_PROGS += test_kill > > +LOCAL_HDRS += $(selfdir)/clone3/clone3_selftests.h $(selfdir)/pidfd/pidfd.h > + > include ../lib.mk > > -$(OUTPUT)/test_memcontrol: cgroup_util.c ../clone3/clone3_selftests.h > -$(OUTPUT)/test_kmem: cgroup_util.c ../clone3/clone3_selftests.h > -$(OUTPUT)/test_core: cgroup_util.c ../clone3/clone3_selftests.h > -$(OUTPUT)/test_freezer: cgroup_util.c ../clone3/clone3_selftests.h > -$(OUTPUT)/test_kill: cgroup_util.c ../clone3/clone3_selftests.h ../pidfd/pidfd.h > +$(OUTPUT)/test_memcontrol: cgroup_util.c > +$(OUTPUT)/test_kmem: cgroup_util.c > +$(OUTPUT)/test_core: cgroup_util.c > +$(OUTPUT)/test_freezer: cgroup_util.c > +$(OUTPUT)/test_kill: cgroup_util.c > diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk > index fe7ee2b0f29c..a40add31a2e3 100644 > --- a/tools/testing/selftests/lib.mk > +++ b/tools/testing/selftests/lib.mk > @@ -141,7 +141,7 @@ endif > # Selftest makefiles can override those targets by setting > # OVERRIDE_TARGETS = 1. > ifeq ($(OVERRIDE_TARGETS),) > -LOCAL_HDRS := $(selfdir)/kselftest_harness.h $(selfdir)/kselftest.h > +LOCAL_HDRS += $(selfdir)/kselftest_harness.h $(selfdir)/kselftest.h > $(OUTPUT)/%:%.c $(LOCAL_HDRS) > $(LINK.c) $(filter-out $(LOCAL_HDRS),$^) $(LDLIBS) -o $@ > > -- > 2.33.0 > -- Thanks, ~Nick Desaulniers