Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3791582pxv; Mon, 19 Jul 2021 08:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrKTNQQ5lfWuCoPgrfvIEwET19IL0AabkrJ8czvk3u4k4N1lY3w3OULBao4ADm0xgxB54E X-Received: by 2002:a92:dcc2:: with SMTP id b2mr17510491ilr.84.1626709857924; Mon, 19 Jul 2021 08:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626709857; cv=none; d=google.com; s=arc-20160816; b=T0/nQ8jG941iPYSERp+VKi08lyjj8hjcYa2ADYkf4R2/4PNQDxSoUl3aj+HUwLLP9z kgpLaO+NOtXmT7SuDfnx/rS8MgSc4RkiBLrHDwFhigwu583EfqqFR+4lH93ROP0raEHb QNDnLs5TR2cwmh2x+RVkPsIWwfw6nNCXdc9tR4HnR47+7HQURULjYFoxHN2kVdsVM0+0 dK/bECNcE0ZZHmKCukj5V0JA3rL7tYqz3WQa65IMKWSKD+fDPCpCLS9vKY/CuMjsLq5p mR4ZS8+Y73Am3f+5mSLURIfIiQi7QweIdHfej9vRSyJ7UW5muAcEYymhjDz/0NKrNaS0 frBw== 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=PcP3Ig/qX54mSFONNQZXobKYbo4Gi7qdDegACde7/KQ=; b=p+JhWI3zDZMsd7prRp+BfSjOzQF1LytOX1Sa+sTOLtaECb//BSCVh1T185CxQUuo5b Z3tY2X49evDegxRTf2GJ8yPPaSgsaP8VL/Bw0a1XO47VQHe5QuNsJRb4TsTkXKuGZIVY O04xYqtk/CtRCKWsEPqVh9pwunyGOd6+Gc6n3ovzSE07Dp7ihV20OZ2WQCBd64iDH7eq 76C/GsihkKWp7uR+Dd/MZEEtcny/JF/apRbb03kb5cpdD3Anfab0a2dke26CfXG7Rq/5 SknEQnWoLr45ItpXCJHzRjxzG8VkCtsGwmuy9q7YB/DuIACL647NYAIklM5l8De2b1sw mLJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zL0G2NoW; 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 f2si13685696ilu.12.2021.07.19.08.50.45; Mon, 19 Jul 2021 08:50:57 -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=zL0G2NoW; 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 S1345087AbhGSPHy (ORCPT + 99 others); Mon, 19 Jul 2021 11:07:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:40444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344236AbhGSOsn (ORCPT ); Mon, 19 Jul 2021 10:48:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4006F60FED; Mon, 19 Jul 2021 15:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626708442; bh=MHBxAPKyqc+lJw8lq8G4ATINV2DINglleA8QB3vIpRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zL0G2NoWIE+B7HVyjrLgHw2nQv79QI5nKaPkgqhIptxDy1iYzEXV3XUtiugyjVWJQ e7f66+HqnTGKf/T/Zg7bzvimIYEUietrr3XCri9kdngBUakL5G5ha2clmXOBRYXD4u 0vZRGh1cHkNW07KNWTly81eqZRIaHEPnc2ZlJJvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.14 312/315] mips: always link byteswap helpers into decompressor Date: Mon, 19 Jul 2021 16:53:21 +0200 Message-Id: <20210719144953.740204246@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@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: Arnd Bergmann [ Upstream commit cddc40f5617e53f97ef019d5b29c1bd6cbb031ec ] My series to clean up the unaligned access implementation across architectures caused some mips randconfig builds to fail with: mips64-linux-ld: arch/mips/boot/compressed/decompress.o: in function `decompress_kernel': decompress.c:(.text.decompress_kernel+0x54): undefined reference to `__bswapsi2' It turns out that this problem has already been fixed for the XZ decompressor but now it also shows up in (at least) LZO and LZ4. From my analysis I concluded that the compiler could always have emitted those calls, but the different implementation allowed it to make otherwise better decisions about not inlining the byteswap, which results in the link error when the out-of-line code is missing. While it could be addressed by adding it to the two decompressor implementations that are known to be affected, but as this only adds 112 bytes to the kernel, the safer choice is to always add them. Fixes: c50ec6787536 ("MIPS: zboot: Fix the build with XZ compression on older GCC versions") Fixes: 0652035a5794 ("asm-generic: unaligned: remove byteshift helpers") Link: https://lore.kernel.org/linux-mm/202106301304.gz2wVY9w-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202106260659.TyMe8mjr-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202106172016.onWT6Tza-lkp@intel.com/ Link: https://lore.kernel.org/linux-mm/202105231743.JJcALnhS-lkp@intel.com/ Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/boot/compressed/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index 516e593a8ee9..b5f08fac5ddc 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -33,7 +33,7 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ KCOV_INSTRUMENT := n # decompressor objects (linked with vmlinuz) -vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o +vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o ifdef CONFIG_DEBUG_ZBOOT vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT) += $(obj)/dbg.o @@ -47,7 +47,7 @@ extra-y += uart-ath79.c $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c $(call cmd,shipped) -vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o +vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o extra-y += ashldi3.c bswapsi.c $(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib -- 2.30.2