Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp890101pxf; Thu, 25 Mar 2021 17:08:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjwGv1uzHA2ehovxha5lRt3FdZfBj7fPodeim06MiKbh+EG6aGUi13Q1OVaXaaCRPZP4hZ X-Received: by 2002:a17:907:3ea0:: with SMTP id hs32mr12147606ejc.411.1616717280296; Thu, 25 Mar 2021 17:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616717280; cv=none; d=google.com; s=arc-20160816; b=DE+5YS6bSAgPl+VqyAR4nNkCxRNmC7NSs2+283A3IRrkvDupg1mZmIJewilW1k414U blB7217ubM6Z5zgV8gyXOp1SaYG/NGypeRKPNtTmDilbRPJcIijQ8roXcdRcGd0NIRLX L9EeQhglroPuC9L9mqMFd6g7gurbjJDoV9iY7uWar18ocfQT0A5SJG6FUgLd/odn35gc 1kuf89iAdqaR8m14HHkLo9DI/qOuG/NF6rzbjT4kNhIT80vxoIYUDuIuyYFoivXKO4xk J137HonJ5VkWRnnM7/HhwlKh41o8sRe9Y+yFaiJhmFuxJ/l43ZB3k/TbOsyFkCCufCNm 8vbQ== 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=FqdMaxBJhXDI8tb65RxjGyfuGwx0v9rJ5tYUUJ5M7K8=; b=roiTsMDKkw9zt5HmjKcmAFWHe+PCxcvVBxGiL9ZCZWEe8PMS5rmNkHE9FgrAwfDXly jCWbcKkOJ8/uIPwrFpFZoy9E1H3fKvSfcVA5sRrbUesY7aJX4yRRfyPIo21671Y/9us1 iQDHWGoVJDmp12RakyWXpfh4TScz9ktlw6BvDAuYxgbhL8j5LZa3QP+Y7uyv3nPrbM0g rBjmn6wk8IgHL+m/BAaY5uvDmjP/9C6+oZZn2gRFJgNxZPB8QXRe1Q/Qg0gg8AsZUlQl QZT2gNdQ/T8Yi1wTgnUWH0VDvePrAvgUT3klcvmgz5RQS/bm9kRrGzDak01oEYjJoAf3 1LtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aB1LzYuE; 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 hp17si5211977ejc.744.2021.03.25.17.07.37; Thu, 25 Mar 2021 17:08:00 -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=aB1LzYuE; 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 S229854AbhCZAFe (ORCPT + 99 others); Thu, 25 Mar 2021 20:05:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:60224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbhCZAFC (ORCPT ); Thu, 25 Mar 2021 20:05:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3EA7C61A36; Fri, 26 Mar 2021 00:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616717102; bh=9/29N/4yLblEnOYYfPpTSkMrTA51czELTdv1FroKk14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aB1LzYuEPu8fVe1jy4nf23gaZvjSO/LqgsDj9GjIHg0j7vlEYUJqBjzkFoX/E42Sj 4PvO42XhIEcB/okZVfaDGGd92F9SeTDeXL6HzOqQso/BN4sSRqgVoxjm5d6XHrUbrX QpWfg5CEX648X5IAozxW8CUAuQIINXytnL/wadfsUDQYkGqpNfxBW51u+zeE2hvYJN KlGxOYwuXDtygNl3Zh7FivikovMQ9V34f5U32ChpASgZFu+Qj+LY56wdoo/MoU0B+X h5HqPPQIUElcgvoHTC0OhXUJrprNO2BomAAs7gv8L0meoaqWK9yI/Qml1+9h9dfIwH bK9woXfXsfWag== 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 2/3] x86/boot: Add $(CLANG_FLAGS) to compressed KBUILD_CFLAGS Date: Thu, 25 Mar 2021 17:04:34 -0700 Message-Id: <20210326000435.4785-3-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/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 --- 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.31.0