Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2531185pxj; Mon, 10 May 2021 05:18:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxLewIRwoVESVfTpmF17VsLvDjkfB/1WKf/4EdM9GU1fRVfy/qyDhqPrIXqImKR5Gk7CBl X-Received: by 2002:a17:906:2746:: with SMTP id a6mr25207617ejd.265.1620649102659; Mon, 10 May 2021 05:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620649102; cv=none; d=google.com; s=arc-20160816; b=hA7wus6naukcZRkqX0tXp4XuwGEbf8/zA7O7w8cu9eKEBqDEn0x4H21cNSjqFtoqg4 A2q4i3A6FVOGp17TGBVW/q9MmZHjGv688xvOSA6UKPpJfyWQPTbdFJTinEG6M0OM9QoO v19YW0YJoKeyV2/DHlpc7PnxDRwv/nDuMrfLtU0+P3YtJWc3lmyd6m0kU5+F5WUpLbGN JuE1Zpa366jlaTmpXTu0HvuGTlzN/AaxS5gBZS/AzXgt5xZzjhKtHM9Q+GcNIy3HHqaX S4XUWsfn17wD8O7kLOhytwwPHeTXPVcLKaAwV0zi9+ch7XqRFYa1ulBFJWcI8nGWnCEA i6SA== 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=oEc+YAcB7pt77ldCxSDVfLsFygC/k0Jh/98TMgJmn9I=; b=uItqKmlUESa5yU8YyENq7thoZgmM5h6nda/V1Yhow3lJl0YQNbOxwCm4Ux4s2gRp1k TomJRG9YMKmz9AXbjasL99LNeaPFYFDltVMxvTPCiRcjPGIXyHT8bXRZD25OlqUApefm tmUWbKleAtnJNt4VW33DEpaLcjnYvz96grITC0vavRakEunA+8E1IbxNMqqcj4fcpkpW WgNpUMpXXem3AcS1Eh8Y6sftDLdEITXwPXGbRJG9oDTXBz9mhg93+Fm0mX2309FrACWI M68k9G3Gc39DlmxYqTnHXjEtvsUWj4LK5JQq1qqF44F1ln0ytmZqZga4Gc0JgT86hx3L 6uQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cPUUWit4; 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 ch13si7905233ejb.419.2021.05.10.05.17.59; Mon, 10 May 2021 05:18:22 -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=cPUUWit4; 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 S1344479AbhEJMPr (ORCPT + 99 others); Mon, 10 May 2021 08:15:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236417AbhEJLIF (ORCPT ); Mon, 10 May 2021 07:08:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C644F6198F; Mon, 10 May 2021 11:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644464; bh=Fs3cA8uLaskIXlaUyKjGvpP0THEkhw85AucOlgP48fE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cPUUWit4z4UXJoj2dGoiWvkv4XSXMQr/S5l11MFVkAEOj/N4AbXwntQUx+pPrGVL5 m4jfUiULT99PLNqfy8aMk1XiZ0oesPnkRge8OxQ1uhNu2hO/Z9sLkv8s7ESDp93My8 dBVwXouatChP6iNLMCgCk4be4keoxABL3go/o7Oc= 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.12 093/384] efi/libstub: Add $(CLANG_FLAGS) to x86 flags Date: Mon, 10 May 2021 12:18:02 +0200 Message-Id: <20210510102017.954912185@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@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 c23466e05e60..d0537573501e 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