Message ID | 20221213001653.3852042-11-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2544883wrr; Mon, 12 Dec 2022 16:19:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Eh/OuOnfBIPe4VINDUCthVaNm2qXMZT0ky2bW9YDKMKC1VQKxnohsH1969a6zEbPAFCOD X-Received: by 2002:a17:902:7603:b0:18f:f3e4:3912 with SMTP id k3-20020a170902760300b0018ff3e43912mr1499832pll.34.1670890752817; Mon, 12 Dec 2022 16:19:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670890752; cv=none; d=google.com; s=arc-20160816; b=WG+jexFjcARZ1WKJ3cgW+gIvJYKjcMxpds6Bjuh7cGlP+Ut2m77Qn1ovWeOYAKpwrE VC/zTBlqF+N/JaLUpB/V0z5tVNh2DFiy1i34unc5DAnQALfeXmA18h3WPk9dbIJHS20Z CPVDvUIKamLDcn3mk/QenJIjFOPvo0CNXKCMuICa7jfkmEJMscuaXsiYgp5+iotoCqgs WC9DRUW1YuWEmohfH/Ow3ZUi1iy1TfLXoiGF2RADpLBrZOMU8OnJrwkgHvk/8Qieoeyn q6FQWSrGtHSx5nCkFPqvuc44xBTPPbAhw6kvP75/lZ8rXYqQ6d7uJa5UWn9IB1P6bAsd 4axw== 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:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=8EoQ5xUEc1FhkDzFjTM8ar5jGOrCyi+Uxx/y/QqNxRU=; b=TVYNsCG6jI1KIjPe48XFl4iewxN6myraMWMVLTMxGnLM3REh3mSUQI4TSyqidT2myg aNP2e8LvSzBEF4JlF+TCqiZVfTDzFm52ZhNn9HYiza7iQ/4SQH9alDkMN263CP7BRyCk AQS+/ELOeyB/GIzhnc5KPiE89RDNSyUBuOqhDkEVj/wORwerm2rVwtYFdfvv1sq8+qbV 7B+nrJBvwNHZhJ9gB4pElkcZiaJZSo5oA8xH5ijLugfWr4ftyLQuCyiELPLWrf8A20mq XtW9glF+46ZWuR8XwL4PnZxsYl4Az3+hnmYEVSb9QX0DvQmI5HEWinZaVmtl29xl21IO qeUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ipDKG2JV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a170902ce9100b00186a397324asi11856867plg.373.2022.12.12.16.18.59; Mon, 12 Dec 2022 16:19:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ipDKG2JV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234120AbiLMARv (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Mon, 12 Dec 2022 19:17:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbiLMARX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 12 Dec 2022 19:17:23 -0500 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BBC21C137 for <linux-kernel@vger.kernel.org>; Mon, 12 Dec 2022 16:17:14 -0800 (PST) Received: by mail-pf1-x44a.google.com with SMTP id 67-20020a621946000000b00575f8210320so911354pfz.10 for <linux-kernel@vger.kernel.org>; Mon, 12 Dec 2022 16:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=8EoQ5xUEc1FhkDzFjTM8ar5jGOrCyi+Uxx/y/QqNxRU=; b=ipDKG2JVkVU4OEFWDzPMjQvpwLjKrvLtAsE0Q12Ig0QpxJrg8GZmiIm/+azC7Rsqa2 1pdKNzn7q+j8SVvNFFE1MwcgltFtLpVT1j20hR2QXC2Javgns9JomPzKxX8az0MVR8Lr xwxNQ4L+57LcZAeNwj6COf48lC0gORWpzAAh4EHs1sxnOZZrp+oLMfA4c+3AeRny/IkJ jwTjCm1aa2Xqxkk8MuRjUDMVdOpUJRa/4/CvkiRx5C364j7RnnRN0GmaWDsiuRVgQoLD 8mXK/UHXSQfeZuLkyN4NIw4jy3LAgiOHXlbk3sYihSHK7Kz3E1BePP1k4h5mJdMfm87Z NXaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8EoQ5xUEc1FhkDzFjTM8ar5jGOrCyi+Uxx/y/QqNxRU=; b=5yjWzMdw3EL3sLwYbI2/VXCNWutBhcyyZeGVHZyIYlvruG2sJmjG7OKgqpJL1VWRcI gf6VN2TWCL+gZAZzA2hzpL1RNF18azOMIHTlTyTPI6DwnC8s26WSKrwJBGZNClQo4z8H 9LcgqN2J2t/ZADlaxi/cMlpm7gb5hkg6NrbGuM+dUXeyS37OKrQMyFqbwijVEa2UbluI gq97Kg4HIg6I7XMV5o8QFfjxf+Q2tgy4E4ezVNm5ZXKIpD70CJK9AX55WbpOv1d4Eqd+ 3mfNEQdBg4tD1GTY/S/z3kji+rRXmypZWfjXEdvMSp+ofdIBornnYvX7jH0cHwACZJKw PUcw== X-Gm-Message-State: ANoB5plOR9sK1f6OH92SsRl9Oyg6CmgbXgmBAEuXxAggT1eni9f7q1sX 7u8+ZacMRYGWBS2QqGAN+nzhLhTfCpI= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:bc86:b0:189:6ab:a97c with SMTP id bb6-20020a170902bc8600b0018906aba97cmr77809422plb.39.1670890633860; Mon, 12 Dec 2022 16:17:13 -0800 (PST) Reply-To: Sean Christopherson <seanjc@google.com> Date: Tue, 13 Dec 2022 00:16:49 +0000 In-Reply-To: <20221213001653.3852042-1-seanjc@google.com> Mime-Version: 1.0 References: <20221213001653.3852042-1-seanjc@google.com> X-Mailer: git-send-email 2.39.0.rc1.256.g54fd8350bd-goog Message-ID: <20221213001653.3852042-11-seanjc@google.com> Subject: [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC) From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com> Cc: James Morse <james.morse@arm.com>, Alexandru Elisei <alexandru.elisei@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Tom Rix <trix@redhat.com>, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ricardo Koller <ricarkol@google.com>, Sean Christopherson <seanjc@google.com>, Aaron Lewis <aaronlewis@google.com>, Raghavendra Rao Ananta <rananta@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752055942182692723?= X-GMAIL-MSGID: =?utf-8?q?1752055942182692723?= |
Series |
KVM: selftests: Clang fixes, Makefile cleanup
|
|
Commit Message
Sean Christopherson
Dec. 13, 2022, 12:16 a.m. UTC
Include lib.mk before consuming $(CC) and document that lib.mk overwrites
$(CC) unless make was invoked with -e or $(CC) was specified after make
(which apparently makes the environment override the Makefile?!?!).
Including lib.mk after using it for probing, e.g. for -no-pie, can lead
to weirdness.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
tools/testing/selftests/kvm/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Comments
On 12/13/22 01:16, Sean Christopherson wrote: > Include lib.mk before consuming $(CC) and document that lib.mk overwrites > $(CC) unless make was invoked with -e or $(CC) was specified after make > (which apparently makes the environment override the Makefile?!?!). Yes, it does. In projects that don't use configure or similar, you might have seen CFLAGS = -O2 -g to be overridden with "make CFLAGS=-g" if optimization is undesirable. Paolo > Including lib.mk after using it for probing, e.g. for -no-pie, can lead > to weirdness.
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 6594ed51eeea..2487db21b177 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -182,6 +182,11 @@ TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(ARCH_DIR)) TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(ARCH_DIR)) LIBKVM += $(LIBKVM_$(ARCH_DIR)) +# lib.mak defines $(OUTPUT), prepends $(OUTPUT)/ to $(TEST_GEN_PROGS), and most +# importantly defines, i.e. overwrites, $(CC) (unless `make -e` or `make CC=`, +# which causes the environment variable to override the makefile). +include ../lib.mk + INSTALL_HDR_PATH = $(top_srcdir)/usr LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include @@ -207,10 +212,6 @@ pgste-option = $(call try-run, echo 'int main(void) { return 0; }' | \ LDLIBS += -ldl LDFLAGS += -pthread $(no-pie-option) $(pgste-option) -# After inclusion, $(OUTPUT) is defined and -# $(TEST_GEN_PROGS) starts with $(OUTPUT)/ -include ../lib.mk - LIBKVM_C := $(filter %.c,$(LIBKVM)) LIBKVM_S := $(filter %.S,$(LIBKVM)) LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))