Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2472564pxj; Mon, 10 May 2021 03:57:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXskq8xwffJMGGxLKqF+wiF0ihJv2RgNl0YKlLPL+qfeyjln+3yE3uoRM2StuQ0KvkJyVf X-Received: by 2002:a05:6638:cad:: with SMTP id x13mr21327222jad.40.1620644256529; Mon, 10 May 2021 03:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644256; cv=none; d=google.com; s=arc-20160816; b=sPQrKh43x/+vnnwDIccjOmtJ5QyZ9FtORw17dy4n5vf4HhocMZ9v7uTefNSw2k/MfR bQfQRxuv7Ov30iIDPglVPSawSnVK0tni+nt+DNKAOKbWZJcdJHUNdwO8ii9qF6u+2TJM 952U/jLAr9WIuCkAWXJ5nJBp3UMcj8Ti11w4R+lNy50kcxkRFOR6tvllZl5kY1F74hYU Y6oE7jPuy5T3NW9dOb/fS6qeKMSzBYa0rvOSezF67aKq9i6+5wxaIrvb3ZnqpNApl/yc he3lfxRL75i6nJZ4+lHcgikHpXR1L+W5cF56ergvQEZkcJJcxeZDbuN9v2QDZghXCycu 5Mfg== 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=o+U/N1kP67CWV89jmE7nHggPmyxusZAB5cWhKqt8/ALmfPDemmmNS0XLsIqIJLNPMH AHNxV7UQH0hhwf3UpR1j1EFSdSu5c9n4ZTynFfvpU97rINhgbR9SH04gjJSANmUuLqzX vHmMrs3Yfl4Kj4Db+b2VvUh3jQbn4vMC2yEYoiIoEnMWy6hFjh8bAcHbV5hzSzchbakw OhTL6IE9jErcEHeM/SwgrjlG7IaC+w0EQXboJHLixHHfgazgxjeOdtZdu0VBWCZt/b8x DzfvgSrItl/gcdccW/ikOPsMNWUKGQla7ev1jIsBmO1oOrfH9QKRyiFesGl0fi/nGoX5 dFkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Kf+QhZKV; 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 d7si18930364jak.52.2021.05.10.03.57.24; Mon, 10 May 2021 03:57:36 -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=Kf+QhZKV; 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 S234563AbhEJK4j (ORCPT + 99 others); Mon, 10 May 2021 06:56:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:59362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232913AbhEJKos (ORCPT ); Mon, 10 May 2021 06:44:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F16E461574; Mon, 10 May 2021 10:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642847; bh=8tgUsdn4HF1BGHa0LfXohhQMOdZ30Xjhil89P8jwuBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kf+QhZKV9of3rpMbqu+LW/nx27CEgM6gUx5y1A4T5wYcRH8YZIKxFY/KgkyZ2GWm2 DFPzRWFVoE4ZIcTJkQdDR08WzCseLaZ0UwcEwTJbX3LNquW9YTjryERFFoY4wxXhsV KnBuZraSkKbfA9CktpeglSG2YsnyjuTqIM2umscA= 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.10 075/299] efi/libstub: Add $(CLANG_FLAGS) to x86 flags Date: Mon, 10 May 2021 12:17:52 +0200 Message-Id: <20210510102007.404325257@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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