Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2473373pxj; Mon, 10 May 2021 03:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpdhXTSuiqoWGU68hNQxhUDH5/OkyI26OSmn0ykZrZdZgTF7NoNCK0V53tO+MR6I083QIT X-Received: by 2002:a05:6638:37a6:: with SMTP id w38mr20637452jal.106.1620644259635; Mon, 10 May 2021 03:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644259; cv=none; d=google.com; s=arc-20160816; b=eWhHXtkcCxajes17ZfK3qMVnyu1iWaa1+WegJEINTyLi50nw+J762CWU4obcfY/LNo 64wJZxHsAWO7L379z0oEv9DE5ryMUFn0rxWnmQd01HvcUIQXIOSSnaPBXAv22SDcT/XT Rmcy9sGy5GAg31Vy1XQFz0sOiBg05y96QxAlAXsqRkF0/vLaxXHFm96gD3jroFLyO4r0 zVwGK1SXFhkNqQbyccpsLNLU2z2Jefnak9KNd7hW15POtwThPzmBojMKsWqre6mSqadE JQlqI/QxH/s65BfAUPhgnPjVVmKGo55OrMsoeKWzqawRd2b0auLMtQ0cBDQoZbK7yTPu VAyw== 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=qwKQ7FI6WFgWzqVwzp/+z3L3jRuA8BDxcL7S70TqoSc=; b=oVdL8W9x6vDcPLlS/xhkGVnnDE/pScqLz3OjgunwqpJwF82R87cFclXmRUN588Njyb xtfPMPhKhSweKhsuUjt+3qpZdJN7IdlUVxj60YQpJShg+/4pIbZDFBLdSayzr6AYaa4N 0S1uWhV1r5JDpOrj3Mz/lZrN0eKYxDx+S5KX3hoZ6n3FabSzYsvdtmT0B+EYJcVlTEKp coJg/dnFumwtoFCQdA/iUkpe0mex267KuilNbuepHauwyElibjnwJJFwsL4ibYxnCtAE O5JX+glvZEZL8Ej8glliG6oT8RazpPAV7QQeB2NFICXXAdfkmPA1IJnf+lTwMuSBf2CT mvSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=btZeBsWo; 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 7si16106507ilj.22.2021.05.10.03.57.27; Mon, 10 May 2021 03:57:39 -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=btZeBsWo; 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 S234637AbhEJK4n (ORCPT + 99 others); Mon, 10 May 2021 06:56:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:59360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232919AbhEJKos (ORCPT ); Mon, 10 May 2021 06:44:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 863B06144F; Mon, 10 May 2021 10:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642845; bh=UB6rGC1hWa+SpXBF0qxDRUjT1wp4vp9vM/ZgpzcP+iY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=btZeBsWoTfOq5sjdZ/hWhrEomomIAOkS0Xlx8zfyxehEcC+w7RMbJ940R77OiE/ci 5ZjPTI0CFUAO+ujhD9n919IfKYkFyGx6GhWVnTCOnQdoL6D/OlDRApXTxbxPc1xfBS tyfKh/2j0pvctouhq9A06mC/n6SV074Iuck3rX4M= 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 074/299] x86/boot: Add $(CLANG_FLAGS) to compressed KBUILD_CFLAGS Date: Mon, 10 May 2021 12:17:51 +0200 Message-Id: <20210510102007.366346992@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 d5cbd80e302dfea59726c44c56ab7957f822409f ] When cross compiling x86 on an ARM machine with clang, there are several errors along the lines of: arch/x86/include/asm/string_64.h:27:10: error: invalid output constraint '=&c' in asm This happens because the compressed boot Makefile reassigns KBUILD_CFLAGS and drops the clang flags that set the target architecture ('--target=') and the path to the GNU cross tools ('--prefix='), meaning that the host architecture is targeted. These flags are available as $(CLANG_FLAGS) from the main Makefile so add them to the compressed boot folder's KBUILD_CFLAGS 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-3-nathan@kernel.org Signed-off-by: Sasha Levin --- arch/x86/boot/compressed/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 40b8fd375d52..6004047d25fd 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -46,6 +46,7 @@ KBUILD_CFLAGS += -D__DISABLE_EXPORTS # Disable relocation relaxation in case the link is not PIE. KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no) KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h +KBUILD_CFLAGS += $(CLANG_FLAGS) # sev-es.c indirectly inludes inat-table.h which is generated during # compilation and stored in $(objtree). Add the directory to the includes so -- 2.30.2