From patchwork Fri Mar 4 00:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 12768437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBAF1C433EF for ; Fri, 4 Mar 2022 03:56:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E2F38D0002; Thu, 3 Mar 2022 22:56:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 391F58D0001; Thu, 3 Mar 2022 22:56:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 281998D0002; Thu, 3 Mar 2022 22:56:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 151A38D0001 for ; Thu, 3 Mar 2022 22:56:51 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BBC8B8249980 for ; Fri, 4 Mar 2022 03:56:50 +0000 (UTC) X-FDA: 79205342580.23.FC1CE09 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf28.hostedemail.com (Postfix) with ESMTP id 2B77DC0007 for ; Fri, 4 Mar 2022 03:56:49 +0000 (UTC) Received: by mail-pf1-f202.google.com with SMTP id k130-20020a628488000000b004f362b45f28so4361002pfd.9 for ; Thu, 03 Mar 2022 19:56:49 -0800 (PST) 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=L2EqmECeGnDxBTpQsY7qBHnNCdpRu+0gpxLs2lR25VM=; b=Od6sUIoBeI6YLIHz8dugjZNkV2e1G9ybEJ+EtPnZaPldHnMI495OSQXixpu5cD8MIL LftkXHa1bDXNL/O7LVOgt6AQJJvJ0Z2+X/vMsRdavLJfC5JpSufc7XnPYGoIJYPFiMxt SAHSYAxwfxCNp+0SYsc4xSvU7KTsOv2itMiPEVdMknFAsmNfYdZJ/rWBKFh0Bnhmv5ce T7BDGlgmj141JJuCh9WvVnH0a0SXb+fEAuA4BXQieWuqf+pR/BtURhwmoeNU27CHClQb kp55gbk1n8GvC5i6hbNFSqVC5JYHoxiOtNPthp61DnahHJj9bxhC570JzV2IIQQMnQY5 Co3A== 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=L2EqmECeGnDxBTpQsY7qBHnNCdpRu+0gpxLs2lR25VM=; b=RtByS+yr2vizIlvgRXTNABifNG1/tDl9ziDvud5/wgC4dvdRXNaJYj7MdRdLqVcY2p CHqRjMuYAz2vIK6AypEvs5AymV8hUCkv3wrcFAo5h6hTSZLjIMMTCs36bSROKWCZtZSF JPC+JASVTPS0ls+aKR++ksugTWgDxU+AP/SNTgVV5rVYGcAfRjOVS6fzepnuTdP/RBa8 hFRDAEuSSzw29dswaO99GFFPmxFbZmBk4nnJG+Otwls4pM4gno+bTa+RjUOXN5+36x5V bGEmcAVHIFOIUHHrNWOw/GxAxkROIdBRbSP5Tw3yg0wa5smRvbDxeHTYU+FfMRd8sCmD OzXA== X-Gm-Message-State: AOAM532TpvD/KiRfXoVQmQiwoMDOn5IGPL9xPQ+Lj3lBHyTGYe279YFp tZptwL6Omac1Qxg926a1EP+3QSYI1Nfrveif X-Google-Smtp-Source: ABdhPJwf+20lur8uv++KBdcOVEbgmjgiEAuuWAsUNu0PrpdZBGP1HHD9FdhGtIOfDG0Vu8bdNEN7h6tsuFuUnliQ X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2327]) (user=yosryahmed job=sendgmr) by 2002:a05:6a00:de:b0:4e0:ca1a:9f07 with SMTP id e30-20020a056a0000de00b004e0ca1a9f07mr41091497pfj.11.1646352412683; Thu, 03 Mar 2022 16:06:52 -0800 (PST) Date: Fri, 4 Mar 2022 00:06:45 +0000 Message-Id: <20220304000645.1888133-1-yosryahmed@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.616.g0bdcbb4464-goog Subject: [PATCH] selftests: vm: fix clang build error multiple output files From: Yosry Ahmed To: Andrew Morton , Shuah Khan , Nathan Chancellor , Nick Desaulniers Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Yosry Ahmed X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2B77DC0007 X-Stat-Signature: c3ynugbw9betikyxa6xz6ejojo9qtico Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=Od6sUIoB; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of 3HFghYgoKCGkfVZYfHOTLKNVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--yosryahmed.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=3HFghYgoKCGkfVZYfHOTLKNVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--yosryahmed.bounces.google.com X-HE-Tag: 1646366209-515352 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When building the vm selftests using clang, some errors are seen due to having headers in the compilation command: clang -Wall -I ../../../../usr/include -no-pie gup_test.c ../../../../mm/gup_test.h -lrt -lpthread -o .../tools/testing/selftests/vm/gup_test clang: error: cannot specify -o when generating multiple output files make[1]: *** [../lib.mk:146: .../tools/testing/selftests/vm/gup_test] 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. Signed-off-by: Yosry Ahmed --- This patch was inspired by: https://lore.kernel.org/lkml/20211105162530.3307666-1-anders.roxell@linaro.org/ --- tools/testing/selftests/vm/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 1607322a112c..a14b5b800897 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for vm selftests +LOCAL_HDRS += $(selfdir)/vm/local_config.h $(top_srcdir)/mm/gup_test.h + include local_config.mk uname_M := $(shell uname -m 2>/dev/null || echo not) @@ -140,10 +142,6 @@ endif $(OUTPUT)/mlock-random-test $(OUTPUT)/memfd_secret: LDLIBS += -lcap -$(OUTPUT)/gup_test: ../../../../mm/gup_test.h - -$(OUTPUT)/hmm-tests: local_config.h - # HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty. $(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)