Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3209272pxb; Fri, 5 Nov 2021 11:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3MAiIhbyfBMm3AT0MiABoq1t319p8eFxNiQ1IbgUCu3JaHwtRvOVjb3kSWPSzo5hg2pmD X-Received: by 2002:a92:d2d1:: with SMTP id w17mr40995003ilg.281.1636137289789; Fri, 05 Nov 2021 11:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636137289; cv=none; d=google.com; s=arc-20160816; b=OLi3qyYwem8A9dk5PWk48/1T9eHq2ZBfkgpgZk0wXSM6HIWIhzPluWoeI+PmCpqPJ3 o/YbDa1XfOfkGyCI6ZRPAjsAn8oA1YJGqWeBYM+4axq+/lGeF4beZuQ23b55KVJRBBK2 ZDaV/aV70b6teiLe8U8Or7kV19b8TdLjy+6H5gtwTKczF9nVJUVt/CRbw5Oi8tatquNw N7+z4q3evYKJaWUuAcs60ag6pSuBO5/AbtyU7NGA+n6C+MM6nvlql4odBTNgoT09Wq1n 1mne0oMb6pb/VDkXwjUqQkzr1sON59avR21Gy7F98/N47FKfDVowatGT4JyCCYKyvqx3 txxw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=UrGzSNLl9hkWQ6FY0wrjlvm9IW4EhNpFnEOVw1+6lI0=; b=jn3Y8fnN8kaOTUul3RR4a0jGWNEUqYIFMZRlpqM5dBzx8wKyIOcuYf5gOlaxVLA49Z WPm+axPImrRLinUMI19OyXX/Vbv1vyEwQn+u9NH/a1MQsHoyLDZZvTXFofXQFkjwd93W p17IxcNJ7eOFQm122DB0JbpHz+9C0rRghjonYKD4CW8FjEjrVGTqIkwX8eG1+pUsfp9q lsa/l7GwfbXgi1Dg7StkzojbHEabMyp49gzcEFyCD40kla7B8n5NgLRkv/S26jVILLSg 42UJN/RX6dRC5fhoAVpr2TJH8EHZmNKSqMKKGd9lKTeMeJgHSPWDYB6KpaQR0XdaChiF ttOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cVjspeqH; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si12938256ilg.120.2021.11.05.11.34.32; Fri, 05 Nov 2021 11:34:49 -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=@linaro.org header.s=google header.b=cVjspeqH; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233102AbhKEQ2a (ORCPT + 99 others); Fri, 5 Nov 2021 12:28:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233113AbhKEQ23 (ORCPT ); Fri, 5 Nov 2021 12:28:29 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 884CFC061205 for ; Fri, 5 Nov 2021 09:25:49 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id j5so15878808lja.9 for ; Fri, 05 Nov 2021 09:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UrGzSNLl9hkWQ6FY0wrjlvm9IW4EhNpFnEOVw1+6lI0=; b=cVjspeqH37diRa4ySe6S2iiA1czmxfOtOWLfHoi5JdPW0nCQu/RUnglVsGr+rjbT6k u7eO1hSzHFioTYrxlCnLamDqmnjFC8lyLVdRPA3WCX56FEwRTsfbrZzX0yFKWlAIC18F 0OTX/yMqnJFwPLjZcYAIEAsY5ncjbglIRVQ0TeWRNyPYuj/m4owkRTqfjkA5IOWPVUhk u4K3Pp4t5kgqyBpmbr0jy3gl3wS8BOJ4pNH3M6cPTnnKsSTWCcty+KuzN7c9gpU/Se5H OgXaAF0fE86e0wiqbxTbPyCRpV4OIwtXpFskRbopwuQ7RWJKvecgZ7YxM37qV7V51xsH o1sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UrGzSNLl9hkWQ6FY0wrjlvm9IW4EhNpFnEOVw1+6lI0=; b=5oZXzWlRhEZ1BfXTq/EuBdATOdkVCg6FbFJK5qPrbSxTuxNQwJGr3uaZWZTxlUMqLC gjt6DYh2RjhU6dNunuv/2THc5/mxBcexw0ZX4tai1+vhG0cGkXgcYyKLaYtNXYBsBi7f DUl4GRlwpAVAg2DiMCsSavI6JOcOcgmAc2xZfdH7MuPsTVEnyt9fX4BsnKKvxeqauWUv Rq3a9im9WOqbvOGK9GSWS3LTc+zt65yV94ikk9XHg+BJWJcVwzKvAakC4gxgz4s95fQ/ 6XO3XHZuKH7R1hlPi0qbciJQF6qctNZ8oBxW6VqisX0+3z2pqOhRLckSII+kvIGDxrj8 VKBA== X-Gm-Message-State: AOAM531g8jHulz4f4aMhVpAxPqroBvQZWcmrrDmUK0Dy+/K67S3FADxv HImiKR/O/dyVaq7daz+gJ16tug== X-Received: by 2002:a2e:b8c3:: with SMTP id s3mr9383633ljp.496.1636129547776; Fri, 05 Nov 2021 09:25:47 -0700 (PDT) Received: from localhost (c-9b28e555.07-21-73746f28.bbcust.telenor.se. [85.229.40.155]) by smtp.gmail.com with ESMTPSA id x20sm874133lfu.196.2021.11.05.09.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 09:25:46 -0700 (PDT) From: Anders Roxell To: shuah@kernel.org, christian@brauner.io Cc: nathan@kernel.org, ndesaulniers@google.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Anders Roxell , Arnd Bergmann Subject: [PATCH 1/2] selftests: cgroup: build error multiple outpt files Date: Fri, 5 Nov 2021 17:25:29 +0100 Message-Id: <20211105162530.3307666-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building selftests/cgroup: with clang the following error are seen: 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