Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2496269pxj; Mon, 10 May 2021 04:31:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP3buiilaNV8gBcNJ7dyhQPdn/7slsE13VEfg2rXRdlZyL/gx3q9VpjJ7ZO07eCgXbx4UD X-Received: by 2002:a17:906:f8cf:: with SMTP id lh15mr24686452ejb.121.1620646268567; Mon, 10 May 2021 04:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620646268; cv=none; d=google.com; s=arc-20160816; b=nnrggW5W0XSUwn9J6GvaTc+VCKLpQjDvrhLCU/sF110ZJJ/u8t49cNfUuLRIzdnptP is7JaO34ovoKg+T0lOHEE1p1wTmVTI4lIQXDUZj2W2c+7j6NK9SayUzsr5gg9VRY0FLv qUFhQjhNuMYJWiCVQ9djvYoWcdL3Ns4UlnSj1MsOfUyU6/BQtie71ib7laWT/5RW4Ovf JJyrequaAwKvBZMMqgtd2vRQkxTZ30+KyJPsWeP2X68UkgVr9oYGUEoBKxq62BoaDGLc sAh1/T/+/B+n6yP+g4di9/k6wLvst5BM8RWuQ3V7HXUmNTnfirBrYVVlFWnaWaHbHddt OK8A== 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=CRwUrw1y+Xl7iC9UIY07VbkCrkQZPwXQ9Xis58Gc8bM=; b=v15SsOg6tP2SYULCRXaGchVLcgCWZK7LOkJyND1IGVIZ9mqSIcoLX1SC484Qi9CaOe YVFZ8467+rS+eBYm0fl8aYjw/kjUPXFEABf5GLxzDTajA/yx9OgOTHcFdeoHLvvrwFex oryvETt+qGxgAU7bRdaU+/oE2BwR9hjMJyzavUeYoXLMlGYBxgsZ6nAMaVaIBGJYhuee KCSE3XH0erl3Q/6Iv7/uTgjbFJxNmztAmSlJS5P8/1lx+TbbzEPshqhRhRMwkpcMUFdy 5sgj5ZXouG+r4fSv20+B7wqDodgQcMYenTX+hDr9qh4GmHALbe8fqUaXJri5vljtbK70 dXDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YaTMvYdY; 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 gt25si5352695ejb.168.2021.05.10.04.30.44; Mon, 10 May 2021 04:31:08 -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=YaTMvYdY; 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 S239722AbhEJL1h (ORCPT + 99 others); Mon, 10 May 2021 07:27:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234543AbhEJK4i (ORCPT ); Mon, 10 May 2021 06:56:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6622261932; Mon, 10 May 2021 10:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643618; bh=4mxuqyCEXFXKOYcs/KXX/g+YKtyaSXxBm6esFdHtqic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YaTMvYdYHOP2mltc2t7WYixSWISpzPMFupucHnIcCOyA9O5CS7wlFwMvvJhO7tpBF LR5YB5+CiF2xX/YTHn0vVHfR0IeQAFhMhVcjH5dHFtWp7a2R4NDIegKoSgLshTU1rf bWrlpbdvRx7wyOACfpBE33MpfbqJHwe0316mArCQ= 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 087/342] x86/boot: Add $(CLANG_FLAGS) to compressed KBUILD_CFLAGS Date: Mon, 10 May 2021 12:17:57 +0200 Message-Id: <20210510102012.989517335@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 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 e0bc3988c3fa..6e5522aebbbd 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