Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3901553pxv; Mon, 19 Jul 2021 11:31:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyYO439bbiZx2bkQv9/neKj1FCEMEurFcn7KvWt37O+qMnrgHP+rrkanGeIY2W9F4CGNeG X-Received: by 2002:a17:906:3693:: with SMTP id a19mr29390153ejc.237.1626719376888; Mon, 19 Jul 2021 11:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626719376; cv=none; d=google.com; s=arc-20160816; b=KsUQu4W/d6Z1RwDnT8Qdj7HhAod2BtCGE2tQiphz0nXajdtZZHuwqQTIl3FsmsRyPz 83Lphk1rj8rRS0bxObqfA0NiNkNF1W7uItDmAtmNk40aPTPNHTmlTrRHnqFu5tNWpDXw QZLsqU3hN90XiMVmDBmIy1giX9yiVPJdOup7PB14F4/DCUx7q7LSGOzUCHc1T/Mi6jUx B7Ne/uIKeBTpCh8z313I6+vRz8sHs2QJxV9ftovYmT0xMqSnmgmcp60S3Ec1LNbzXlo7 +S5cgLvYHfAEEHOjCffk7bgPXTBrVCxpyG9eKOLyKLIfAa4Tq3q49m+iv4JQBuQSKvZc 2xvw== 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=yBTTkfQGmtZ0oGFlpLeELa0msG32NRPRRF5zcVSAWDI=; b=Mnnwb/ii2KUIwwzRPeiUGXOR8DF4WKskt9Bwx0IvOqi4rgSs92u+eiDNRUoKRbMi/f 6tHxmxxWNOEkBYQoN/vmotwOn03osz/tqVhGwDlq7W+QkksZLwt2RQc8aCYEdKLikupK ctwbX7PPlJKd2py2UOuTSK8KYPVhYpKo0Oatu9LeTRmP35w/PIQYf6z/nSDCv/dwwzxW c3/TkxY03wcvTso4BrPFo4g+pM68jsohWcb4QYgFParuIJPjWYeRns8kOklp947Rk5FX ddRa5ZU89dGhHlYIxpIGDSgVd7nt1OeMpy55GMyeFLeUwWF2UDHcHFUjztdXPdOWrKBy ey/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ufvh1RBe; 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 kv4si6650782ejc.681.2021.07.19.11.29.12; Mon, 19 Jul 2021 11:29:36 -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=Ufvh1RBe; 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 S1356745AbhGSReZ (ORCPT + 99 others); Mon, 19 Jul 2021 13:34:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:47896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350519AbhGSPvI (ORCPT ); Mon, 19 Jul 2021 11:51:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E04C611C1; Mon, 19 Jul 2021 16:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626712187; bh=/KCBxQWF0HfEEe9UcYTekWulQkV8ICRan1JG9rnJWqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ufvh1RBeFplFPzf6I99C50CoOsQnf+YRhU09XLlbEA6ZjYa+LRLA7JZ1wc83GPxIy dbI+XtrGNbvPkMqxey5ihnhPdsaLHbzDwzT6NEdCXgPovVjfTOzzYrylcpkEpwvEdT W93lCkOomYiL4hpcVJ3hbjq2YN0tsHwEOb+icoQs= 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 5.12 283/292] mips: always link byteswap helpers into decompressor Date: Mon, 19 Jul 2021 16:55:45 +0200 Message-Id: <20210719144952.217366902@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@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 f93f72bcba97..0db5b2c38893 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -40,7 +40,7 @@ GCOV_PROFILE := n UBSAN_SANITIZE := 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 @@ -54,7 +54,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 $(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE -- 2.30.2