From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53093C433E7 for ; Tue, 13 Oct 2020 23:53:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D084322201 for ; Tue, 13 Oct 2020 23:53:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rrmReNw0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D084322201 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 766746B00E4; Tue, 13 Oct 2020 19:53:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C6DC900002; Tue, 13 Oct 2020 19:53:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58E366B00E6; Tue, 13 Oct 2020 19:53:22 -0400 (EDT) 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 270CE6B00E4 for ; Tue, 13 Oct 2020 19:53:22 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BEBDB8249980 for ; Tue, 13 Oct 2020 23:53:21 +0000 (UTC) X-FDA: 77368556202.25.neck71_290efda27207 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 8A92F1804E3A0 for ; Tue, 13 Oct 2020 23:53:21 +0000 (UTC) X-HE-Tag: neck71_290efda27207 X-Filterd-Recvd-Size: 3535 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 13 Oct 2020 23:53:21 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BB32208B3; Tue, 13 Oct 2020 23:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602633200; bh=0V1bOQm3v1uZP2SvgmR9PZXSnlGWtLxjzDWIc+gTdcM=; h=Date:From:To:Subject:In-Reply-To:From; b=rrmReNw0U/yq1g0Cv5v2DjAVgJk0YEQVKHXnrsfNAzx88GYislxKxLNRnGSwOL3ej QgoyVFdGFkT2ynMucjnRrciNPinR0EE4s1QbGHdv+ab0PKNSkhK/fteYH+GMv+WXjD EKkP9QQt5op9K2KvqlQp+OmY17YJBSE0GXlGjoho= Date: Tue, 13 Oct 2020 16:53:19 -0700 From: Andrew Morton To: akpm@linux-foundation.org, jgg@ziepe.ca, jhubbard@nvidia.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, shuah@kernel.org, torvalds@linux-foundation.org Subject: [patch 091/181] selftests/vm: fix incorrect gcc invocation in some cases Message-ID: <20201013235319.xHClSggZs%akpm@linux-foundation.org> In-Reply-To: <20201013164658.3bfd96cc224d8923e66a9f4e@linux-foundation.org> User-Agent: s-nail v14.8.16 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: From: John Hubbard Subject: selftests/vm: fix incorrect gcc invocation in some cases Avoid accidental wrong builds, due to built-in rules working just a little bit too well--but not quite as well as required for our situation here. In other words, "make userfaultfd" (for example) is supposed to fail to build at all, because this Makefile only supports either "make" (all), or "make /full/path". However, the built-in rules, if not suppressed, will pick up CFLAGS and the initial LDLIBS (but not the target-specific LDLIBS, because those are only set for the full path target!). This causes it to get pretty far into building things despite using incorrect values such as an *occasionally* incomplete LDLIBS value. Link: https://lkml.kernel.org/r/20200915012901.1655280-3-jhubbard@nvidia.com Signed-off-by: John Hubbard Cc: Shuah Khan Cc: Jason Gunthorpe Signed-off-by: Andrew Morton --- tools/testing/selftests/vm/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/tools/testing/selftests/vm/Makefile~selftests-vm-fix-incorrect-gcc-invocation-in-some-cases +++ a/tools/testing/selftests/vm/Makefile @@ -8,6 +8,18 @@ MACHINE ?= $(shell echo $(uname_M) | sed # make invocations: .DELETE_ON_ERROR: +# Avoid accidental wrong builds, due to built-in rules working just a little +# bit too well--but not quite as well as required for our situation here. +# +# In other words, "make userfaultfd" is supposed to fail to build at all, +# because this Makefile only supports either "make" (all), or "make /full/path". +# However, the built-in rules, if not suppressed, will pick up CFLAGS and the +# initial LDLIBS (but not the target-specific LDLIBS, because those are only +# set for the full path target!). This causes it to get pretty far into building +# things despite using incorrect values such as an *occasionally* incomplete +# LDLIBS. +MAKEFLAGS += --no-builtin-rules + CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) LDLIBS = -lrt TEST_GEN_FILES = compaction_test _