Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp227204ybh; Tue, 14 Jul 2020 23:52:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw38BmBioGehhegmPOHNWVrmkuNT/q3uqS4FScR6mlDKQkwGUHcSZ/CEUmvvS+UwfJYAMdP X-Received: by 2002:a17:906:924d:: with SMTP id c13mr7621190ejx.518.1594795949627; Tue, 14 Jul 2020 23:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594795949; cv=none; d=google.com; s=arc-20160816; b=d56YkgET8qkXGYapjhwHR/ZeBWGlFStLvnFo6JkmwVYAQsMT+oyXBsSxSkPSRq1Zz7 taDyvJjGQr+DfupS3bzzzPFnsmK4gV3xaFjsgskDAJvY+vtdVwgrKowVQqSCzjMsU6mb 8+OKho+kh2m/QpnSELQk2X9yu7nCH3Ud3dT+xj3ODfJmR4j4Kj5+bBLKLhJ8b3b4D8RE nr/MDyi3XKFq5vVJF4pCKjpUl/LYkpQmVEbcVeypGYIEptD8nvh270CJnf0L/XnmfgAk 728yWoTuuNH4D2ZnkqRs+MyEK+VEAyrxTv4Eh3laNpjLHmjBNQndxMJdp6wo19d8ecMI 7zKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0lDMhcZ3N8RLXrsNZqroChiS/QOZAgb9rlFuxk1e4Lo=; b=Ix701bwhDubpWqcFgYs44Xxl6+FHetSx3ISBEVMHAWf+LB7Wj5tcTaXymIRM7e64fI zFC/7H2rBv2YyZgatDkmxVOTub/wvHgRjh4PUoyQYfu3zRwOumnAUA/EhPObR3UanFfJ GIhgKC+UtcuOvrpl/ZSZ6ATsUf6eqSwDl1nd9NVCQkoScsKqzmQ7cgeI3tMZADL8CsSG h+YSm7TE8BcS+wfcIW8v6hirDCzT5iq02V8R9yE08pXMvaDNAFfWZxFkh0R1UvHMk8Hm G9KVGjXb07/XBr26IbaAGxIVfySjBnKUd+4OwC6KTjQbeXD9qYuwckgEk3u0w1QGVuDb E08g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ng5t2TWJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si639311eje.610.2020.07.14.23.52.06; Tue, 14 Jul 2020 23:52:29 -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=@kernel.org header.s=default header.b=Ng5t2TWJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728863AbgGOGv0 (ORCPT + 99 others); Wed, 15 Jul 2020 02:51:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:41166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgGOGv0 (ORCPT ); Wed, 15 Jul 2020 02:51:26 -0400 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 574D32067D; Wed, 15 Jul 2020 06:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594795885; bh=5DttlarQkKvK74ioG6I0+VxDllg5IuyUP93tfyKyKgQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Ng5t2TWJzvvsKlj8vhgNYrko2Y/LBVPSqVGt6VfuP/VXJ7kMpneB2xAI4nINZLpni yvIwA6yaxpVwOtzCVOBJThcMsykaZjhWnPvYCjF5SL3kSv294DMupYqxVwiZL2LL3J YOCbJDzS5uoJN1EmKaoSXNbV7qWobORB+Otw6uUs= Received: by mail-ot1-f52.google.com with SMTP id 72so676849otc.3; Tue, 14 Jul 2020 23:51:25 -0700 (PDT) X-Gm-Message-State: AOAM531m8UphKIayCokYP4DDUt4ccuU1249SGBxc4p5XDdaToAQiwOEb fnvz/cxkj6yD+c+Yrc4Bwj9+EKpOq3+CjJ5gWQM= X-Received: by 2002:a9d:7553:: with SMTP id b19mr7955857otl.77.1594795884664; Tue, 14 Jul 2020 23:51:24 -0700 (PDT) MIME-Version: 1.0 References: <20200715032631.1562882-1-nivedita@alum.mit.edu> In-Reply-To: <20200715032631.1562882-1-nivedita@alum.mit.edu> From: Ard Biesheuvel Date: Wed, 15 Jul 2020 09:51:12 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arch/x86/boot: Don't add the EFI stub to targets To: Arvind Sankar Cc: X86 ML , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-efi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Jul 2020 at 06:26, Arvind Sankar wrote: > > vmlinux-objs-y is added to targets, which currently means that the EFI > stub gets added to the targets as well. It shouldn't be added since it > is built elsewhere. > > This confuses Makefile.build which interprets the EFI stub as a target > $(obj)/$(objtree)/drivers/firmware/efi/libstub/lib.a > and will create drivers/firmware/efi/libstub/ underneath > arch/x86/boot/compressed, to hold this supposed target, if building > out-of-tree. [0] > > Fix this by pulling the stub out of vmlinux-objs-y into efi-obj-y. > > [0] See scripts/Makefile.build near the end: > # Create directories for object files if they do not exist > > Signed-off-by: Arvind Sankar Acked-by: Ard Biesheuvel > --- > arch/x86/boot/compressed/Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile > index 7619742f91c9..5a828fde7a42 100644 > --- a/arch/x86/boot/compressed/Makefile > +++ b/arch/x86/boot/compressed/Makefile > @@ -90,8 +90,8 @@ endif > > vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o > > -vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a > vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o > +efi-obj-$(CONFIG_EFI_STUB) = $(objtree)/drivers/firmware/efi/libstub/lib.a > > # The compressed kernel is built with -fPIC/-fPIE so that a boot loader > # can place it anywhere in memory and it will still run. However, since > @@ -115,7 +115,7 @@ endef > quiet_cmd_check-and-link-vmlinux = LD $@ > cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld) > > -$(obj)/vmlinux: $(vmlinux-objs-y) FORCE > +$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE > $(call if_changed,check-and-link-vmlinux) > > OBJCOPYFLAGS_vmlinux.bin := -R .comment -S > -- > 2.26.2 >