Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2701196pxj; Mon, 10 May 2021 08:51:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYzO8Vx0hDxNHIw/E1/v1YI9Sf31fF0dBpqz0NWxUu6qvNDJl7o3hy6bOg6J/zkbqa1SPf X-Received: by 2002:a50:e702:: with SMTP id a2mr30867066edn.3.1620661861973; Mon, 10 May 2021 08:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620661861; cv=none; d=google.com; s=arc-20160816; b=MbrcKm9OYIdZjPkA8KwX+rRUSHHKOFCdLuQY7DqDLX6HTP4Yg7jHQICsH3jkav/6mO c56PPAOJt7XQT2CVYK+AbVudHFR8fao4GPN8Gs3opO3DVqGmA8R7e/8TvK+F6MNSKRFl Tm+eI4sykFx98Af925KJbKN3lQ7NKw7AFDkXO09Pv/+XBe03ThHRIkfWJQAEJqd//Vhn /hKFEa7vFqE30ZTjRwtbE0L2BPUU4+MtbPykSh77rZergX0Kn0vgF4AA1SaTsz1OwdK2 iP7C3yclrrvWyUHT8OcenK9AwuBAc9iO8tXnPFkW0YxrlHijqHlf4LAj7LA1Z91GBqr2 HLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vTuZSiO88rMzC/sr7020ubYcAlRmD9YytpgKYN4rLSQ=; b=B0qKdptyClIQRff+GEhVk0wXG2qpXh1an/a7ZUObbpP4236YzwMNUd4/MARQZCfGva 6g+WhCCOVDjLRckAzpUo0ReD0ZAfOr2iBXhHYt79prOe0qcKyNgtuTGPjFKK3+5yd6JQ E++7G+vmbjISJBZJk9Un0Brl3Mng1L2y5rwy2JtMNysXvUTxMos2QPUt+fHkxrKaIqg2 J7KLUGnd60JhbPO0g0p+mokCwVR7as/eDopjdIsNLgL/3WfHn+BY5R6F66U9wDD/f1Yt p9+kM2g1logV9izo6a/qkhIOhfalomk2gQXCneSXJC9e+s0gRjTcSb9LHMhcZmds3wD+ T5RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uElQqKsI; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds10si17697878ejc.415.2021.05.10.08.50.38; Mon, 10 May 2021 08:51:01 -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=@linuxfoundation.org header.s=korg header.b=uElQqKsI; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239740AbhEJL1j (ORCPT + 99 others); Mon, 10 May 2021 07:27:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234552AbhEJK4j (ORCPT ); Mon, 10 May 2021 06:56:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D111C6199E; Mon, 10 May 2021 10:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643621; bh=8tgUsdn4HF1BGHa0LfXohhQMOdZ30Xjhil89P8jwuBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uElQqKsICw3+UO3+famINSZKY1ef/ErrkQeePpXJ5U1kcF2qweuSIUX8VJu0UmHlC dtlsBW8FsaFuymcyg1Qb+8V/hWVSc9ZYr/bIANF4ElTKEHVMWAFX2Ow4ELd6+eIT4l I29mZbRI1Q1QDcipn/V3X5Zc4l/doJhreFtEvH80= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Borislav Petkov , Ard Biesheuvel , Sasha Levin Subject: [PATCH 5.11 088/342] efi/libstub: Add $(CLANG_FLAGS) to x86 flags Date: Mon, 10 May 2021 12:17:58 +0200 Message-Id: <20210510102013.020823374@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 58d746c119dfa28e72fc35aacaf3d2a3ac625cd0 ] When cross compiling x86 on an ARM machine with clang, there are several errors along the lines of: arch/x86/include/asm/page_64.h:52:7: error: invalid output constraint '=D' in asm This happens because the x86 flags in the EFI stub are not derived from KBUILD_CFLAGS like the other architectures are and the clang flags that set the target architecture ('--target=') and the path to the GNU cross tools ('--prefix=') are not present, meaning that the host architecture is targeted. These flags are available as $(CLANG_FLAGS) from the main Makefile so add them to the cflags for x86 so that cross compiling works as expected. Signed-off-by: Nathan Chancellor Signed-off-by: Borislav Petkov Acked-by: Ard Biesheuvel Link: https://lkml.kernel.org/r/20210326000435.4785-4-nathan@kernel.org Signed-off-by: Sasha Levin --- drivers/firmware/efi/libstub/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 8a94388e38b3..a2ae9c3b9579 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -13,7 +13,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \ -Wno-pointer-sign \ $(call cc-disable-warning, address-of-packed-member) \ $(call cc-disable-warning, gnu) \ - -fno-asynchronous-unwind-tables + -fno-asynchronous-unwind-tables \ + $(CLANG_FLAGS) # arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly # disable the stackleak plugin -- 2.30.2