Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2136978pxb; Fri, 25 Mar 2022 11:44:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgOLlHiRBkIYrhHFDFBe2gsJprKu8LMRCPuLUDuubRG49NQtoefHciqX2xRo029Ea6YQTl X-Received: by 2002:a05:6a00:170c:b0:4f7:260b:297a with SMTP id h12-20020a056a00170c00b004f7260b297amr11466670pfc.12.1648233898999; Fri, 25 Mar 2022 11:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648233898; cv=none; d=google.com; s=arc-20160816; b=mXaCJAqnQI2JX4AGFjztVwzeoSihWpv8AtZQIU45ROmtmsv7Qjwaratho3+4Zrwoxs fhHrq5m4eumK/8XA31unjm8mFO2DL5bQC8lGHn1rxwxNvQhvWuEM777G5mWY0FB0duk+ JBwsbNYYwe/RRowNu3Y2JtLYn8mq/wwFHneCk2vWG34VfRL/qrk+u0tKeaz8/uNuqWGO BtceGpfXzyZIGLoGBUJEky39kLIfq0jSjs1h9Xyu7eD6WiZqpwWkKz5r3MF0PwsBONqi Mv2rz4h5aE+E4+G2m3Wgkg5u2ICRDTbvhsbPwGhkUZssjQgTSCN2Tr+LYV7IGCRPTczg 6fyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=2UXOWK4H/ABoSS6KabIKT0cRAkKR0ZUPw5leAS4VA2Y=; b=tqrvGLSlmgqxAbAZKjoCrcIVtaUOkpLd0PqackrsccfM02DcKH3Dv5BfvBFFrm6R0D MxzvzMs6iGnXQCLmAT8Vm3NJsuebjqgu6edd+PYr1+Yhqx6+TjYRz+BbnLxciatj5c8X Rjfxtij4o3VnqOnGx6K6XUzdm3FLsVH/uItcqRvRebnxFKlkNXfqve02fbWMRY4UzCTH CMiemRbJjmnLRYXXhBkNCZ8cWvcqvC+q9BTj0Xyga3+XnvMA/1EpaTmymiFjev1sWqNm YK0+H2rI1bngXt55QpaGArTlreN6WGewmqMOw47NmMuelFYKU8VpuxqqwYKNI4BQMxYK mzDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="mFrw/DyL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k2-20020a170902c40200b00153b2d16422si3741747plk.42.2022.03.25.11.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:44:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="mFrw/DyL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 90D9219B04D; Fri, 25 Mar 2022 11:00:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355445AbiCXWlP (ORCPT + 99 others); Thu, 24 Mar 2022 18:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244293AbiCXWlK (ORCPT ); Thu, 24 Mar 2022 18:41:10 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631F6BA32E for ; Thu, 24 Mar 2022 15:39:35 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2dc7bdd666fso47087707b3.7 for ; Thu, 24 Mar 2022 15:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=2UXOWK4H/ABoSS6KabIKT0cRAkKR0ZUPw5leAS4VA2Y=; b=mFrw/DyLpphzNFV0Nr7i6+kDrT0/C9GU5c4FP6bzXJk/QsrgjgdsN5pw+Twz+s6tGi qy25SacKdr9ipsWUo6trNsVmt+dTa/NxO3N5FT6aeXplL6+ZEw1LMGDWTo0PQCwb+Bvv 4GDi1sgE7Jd6QRrZP/c4HReJ6wxGKYe3J8j58vlNKNI0HzHCFnfQgsW07wf12tX5ifUO PkWd0jUpPH/MCtF459clWjsDteS21Ykgbme/qNhmrt1Ttph7wf3EUSy9EX8Ao16PvJnO QLKcOxdXbMcH953M7Bj/sxYtgU4u2dWspJAXKFL7VZLBu7hfRoPYI0AbX+uq/222BMVD SSYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=2UXOWK4H/ABoSS6KabIKT0cRAkKR0ZUPw5leAS4VA2Y=; b=IYBYusjXhG7MlRPiDWUEq3FlaKgoFlrW9wIMt7lIhU+wPGRA3xRZ2uD6bLxOyhf0+s JyUtyKZjqAv4JCT8aSGOE9zKnT9sUzpwkEZ9PIT2n8KhV4QiT+POUJsSYpxQ964JTAbs R8s9cj1EL9JS+6cdynSuKR3Ap+5nF4B6wzfCnYO9QO3cz6VQ4LxCcK6tNCP2VTAaJ6GQ CVut12b1R4U6F01ZacfyhS9fgLukOpWKkgDq31F+GO96ajbpdsN/vvsp/jmaeHSWAI8C KHZErqTYjPoktnTqRpHtkHRBpZUzpOFlIkAAbb5XtD6GlEQp/NYzTAlQN0rWSai7g7Hv 44lA== X-Gm-Message-State: AOAM533I67Q+SabjvB2KLnHBXowGkzEB3ETJvlVx+ymoUnstYbMyB1nQ P2pxCK02DOtAHH8n0eeazgG6EduSIVMANdRxAQVE X-Received: from ajr0.svl.corp.google.com ([2620:15c:2cd:203:9892:9f7f:2c27:2968]) (user=axelrasmussen job=sendgmr) by 2002:a25:5f11:0:b0:633:ee0c:ab79 with SMTP id t17-20020a255f11000000b00633ee0cab79mr6599611ybb.491.1648161574585; Thu, 24 Mar 2022 15:39:34 -0700 (PDT) Date: Thu, 24 Mar 2022 15:39:28 -0700 Message-Id: <20220324223929.1893741-1-axelrasmussen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog Subject: [PATCH 1/2] selftests: fix header dependency for pid_namespace selftests From: Axel Rasmussen To: Christian Brauner , Shuah Khan , Nathan Chancellor , Nick Desaulniers Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Axel Rasmussen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 The way the test target was defined before, when building with clang we get a command line like this: clang -Wall -Werror -g -I../../../../usr/include/ \ regression_enomem.c ../pidfd/pidfd.h -o regression_enomem This yields an error, because clang thinks we want to produce both a *.o file, as well as a precompiled header: clang: error: cannot specify -o when generating multiple output files gcc, for whatever reason, doesn't exhibit the same behavior which I suspect is why the problem wasn't noticed before. This can be fixed simply by using the LOCAL_HDRS infrastructure the selftests lib.mk provides. It does the right think and marks the target as depending on the header (so if the header changes, we rebuild), but it filters the header out of the compiler command line, so we don't get the error described above. Signed-off-by: Axel Rasmussen --- tools/testing/selftests/pid_namespace/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/pid_namespace/Makefile b/tools/testing/selftests/pid_namespace/Makefile index dcaefa224ca0..edafaca1aeb3 100644 --- a/tools/testing/selftests/pid_namespace/Makefile +++ b/tools/testing/selftests/pid_namespace/Makefile @@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -g -I../../../../usr/include/ -TEST_GEN_PROGS := regression_enomem +TEST_GEN_PROGS = regression_enomem -include ../lib.mk +LOCAL_HDRS += $(selfdir)/pidfd/pidfd.h -$(OUTPUT)/regression_enomem: regression_enomem.c ../pidfd/pidfd.h +include ../lib.mk -- 2.35.1.1021.g381101b075-goog