Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82A81C4332F for ; Mon, 13 Dec 2021 22:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243920AbhLMWtl (ORCPT ); Mon, 13 Dec 2021 17:49:41 -0500 Received: from aposti.net ([89.234.176.197]:34472 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243745AbhLMWtk (ORCPT ); Mon, 13 Dec 2021 17:49:40 -0500 From: Paul Cercueil To: Thomas Bogendoerfer , Nathan Chancellor , Nick Desaulniers Cc: list@opendingux.net, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Paul Cercueil Subject: [PATCH 2/3] MIPS: boot/compressed: Build without LTO Date: Mon, 13 Dec 2021 22:49:13 +0000 Message-Id: <20211213224914.1501303-3-paul@crapouillou.net> In-Reply-To: <20211213224914.1501303-1-paul@crapouillou.net> References: <20211213224914.1501303-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need a valid ELF object for dummy.o, so that objcopy can insert the vmlinuz payload. Therefore, we must build the decompresser program without LTO, otherwise dummy.o will be LLVM bytecode instead of a ELF object file. Building the decompresser with LTO wouldn't make much sense anyway, unlike building the vmlinuz itself with LTO. Signed-off-by: Paul Cercueil --- arch/mips/boot/compressed/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index 4c9ecfbb0ef4..2d01c50fb0b1 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -27,6 +27,9 @@ ifdef CONFIG_CPU_LOONGSON64 KBUILD_CFLAGS := $(filter-out -march=loongson3a, $(KBUILD_CFLAGS)) -march=mips64r2 endif +# Disable LTO +KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS)) + KBUILD_CFLAGS := $(KBUILD_CFLAGS) -mno-abicalls -D__KERNEL__ -D__DISABLE_EXPORTS \ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" -- 2.33.0