Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp889823pxf; Thu, 25 Mar 2021 17:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuUwX6aISfF9PVzDAdxOVj+p8MfJgmtuTY1ERZ9DYOlK/aIfAfG3+OcVdLcpGO4HP892GT X-Received: by 2002:a17:906:2314:: with SMTP id l20mr12577476eja.178.1616717251200; Thu, 25 Mar 2021 17:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616717251; cv=none; d=google.com; s=arc-20160816; b=U7jqLA8ALQVIWXmXq4+vnHFgLxYyt7nMz816Hihr+a2eLbqmxMkapsPn4xoRaOeN9D y4rA1nrvdaA/hfPsqERD417kLtMg2NLMFg1enVffqDdp6UW2+inBKqv/f+y+cqcA8HY3 5u5HrjAjH5I+FygK5lZDwMgzwcGngMjA52iSXKaAmLLA9BO0M+A6Tw8F56k/yr43vrxD TX9K5OTvrnwB1Duy7amf1szUhf/ufzaVR0yDN0/392iNMiYiiLhj9CEOVJyYjRopdrft DKPOkFHuqSJezT/Qyvv8LMrH0dUtlJiBpRGy+6hVu9snXPWP9oBzIkhVEx22Jk7rerFF uxmQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qPtAVi5y2xKSDDRRLGima5K9LNn6oiLLbuJKlk305do=; b=wW+2b1X3586Uis6q1uP3SLBTQ5p1izhJ5iytvO98CmhEJNEWoEKC5xLNy/rXXFe2lK ZyKt9JmNPf1Q8Ph9WMtFQRqoLwPCZ2jU3HLJvmawQ0c/8eMtWnns0glFt5h+vACCp+v1 EZp8nIIVnHxtxJslYKDrt/6v2Lf8dJ+TCilxMdDtzqBER0zQdygzNS5wpmj3qlayXWha JiSHH8saQW2qsG7BxRQiCcV1hJWtmAo7MuB1DjaERHW/8MM/cYsW67bJd16rjt2C/rm1 vbDToRzmGGNrAYuhcpG+uX9pOEcwJ90wV1CUvBYrBNAM9II4HVr7cca+tx903GgytsfL i2QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UeGYgk1X; 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 c8si5556648edq.326.2021.03.25.17.07.08; Thu, 25 Mar 2021 17:07:31 -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=k20201202 header.b=UeGYgk1X; 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 S230139AbhCZAFi (ORCPT + 99 others); Thu, 25 Mar 2021 20:05:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:60294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbhCZAFF (ORCPT ); Thu, 25 Mar 2021 20:05:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 995C261A0A; Fri, 26 Mar 2021 00:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616717105; bh=wK/BFrBTE/0tBXGMmuGyDcFbZJG2Gsid1VRthtJvonc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UeGYgk1XDEILPxorhA3iIVOF9HnzT+TEjpYcjpbwI7twldA4T0jU3SED2npzBIDem fzgPMI+3s5OPIj2jRkkctakVjbfwyW87TLa+P8KBfayXrui20WDjiRMfmGRmCiblec 6IhLRgF/XhD62Ua1REDHkqogfIRwmEkgBJ8Rz1feIy8rM2iPuRZ4raqHtl5c2HfSbw mcFNjzDD7poz5tdSSkXy4bLVWWbsTFp1Z667x+jBEsOiI5tAuSi3YBQPc33TeMuZqE 2xZeAvQB7bP3MzFVs/JtvjO3KBI1awX2vK+xYMj13zu7+izYxFIioK6KDmaiKTOMnM fgUvgzMvUhQag== From: Nathan Chancellor To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Ard Biesheuvel Cc: Nick Desaulniers , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 3/3] efi/libstub: Add $(CLANG_FLAGS) to x86 flags Date: Thu, 25 Mar 2021 17:04:35 -0700 Message-Id: <20210326000435.4785-4-nathan@kernel.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210326000435.4785-1-nathan@kernel.org> References: <20210326000435.4785-1-nathan@kernel.org> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.31.0