Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp622431pxv; Thu, 15 Jul 2021 11:46:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy74Fd/ZjKud09YzLYeMNqWQpf3CiveY0cIgm2qFvxfo0QEl+TsGolHQa3qux9t/R5ZzYVX X-Received: by 2002:a92:d083:: with SMTP id h3mr3686307ilh.157.1626374818510; Thu, 15 Jul 2021 11:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626374818; cv=none; d=google.com; s=arc-20160816; b=drfkv47fg6LWLWw5GsEGj9/f5ufvAgXvrVMbW8Loj1Sze5yfxYiQvAPfQ33o1uYm5B 1vROq67tFdYR8eREs3QcQ2JwLHoMsbcCutwHjOCNdc6h5fKBXeWEfhXNarE42ksUiYa9 RdZu37GWxME8k5Rz9MkXMjFJS122fjktCbwApr68iCX0l3MhzuqDlLQgqKXCAmyARb2F thUGOezjzii1O32a0kzs/Hm5hzrgsq5EwuflVW7WdQIjh94BM72bHHvk243aK8xbu5Sf xzPxjMpEDS7eykx70FyU6PIKY/x2KTtyl4bhB5ccpQbxsccXj5x29VNXa3yLcqvf40wO tiTw== 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=Cu0hu38eDlBCUx9tD62prgsfHdoP4s8SdfV70VGE+U0=; b=dlZuFI1yeVO8siM6kNvDdX4J9zAftgeeADbC/u0XOC8CTxXsaVQ1wR8f0bOmp1aSh7 B/zhZ9aVn/hJMENmVoTsoOfmbKy85Kc7pHOle6bg3txI3e6ylChFECw+GxqC8Bkh1N21 7C8aB/IAQVTY3hpLbZS19W22TJ4iLemqH8JDv+tfBnQbEU+Bko2ZjZsgRCipYrd1Lqiw ZD925luTh+b1Ff4FyQwHhNOXQqV1irS1oDn8L6Fc98F893yv3ViCgF/o4eC/WKM7M15c kSyyUSssTiHL797PypGaIQoocksgvO0klNRSqUl07DHF4sBZETDM1R0UVwp7rN8r5auC wTTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ruPZuhjA; 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 b8si7917436jav.94.2021.07.15.11.46.45; Thu, 15 Jul 2021 11:46:58 -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=ruPZuhjA; 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 S240023AbhGOSs6 (ORCPT + 99 others); Thu, 15 Jul 2021 14:48:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:49090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238645AbhGOSrN (ORCPT ); Thu, 15 Jul 2021 14:47:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3D7F613D1; Thu, 15 Jul 2021 18:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626374659; bh=YsgUxFkAQIZU3ZVISzNLMdUo6s3I6zNTSY1lPTFkK+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ruPZuhjALrCxXo3JItpNp/gXaI0eRjASuWbOPnv77WxIJ5VrC5xHoT10VN92tZzuQ yElWmLjNeDQvRm2bWcTQjoJjPecKP1/We2loHkgo52cqdr89V+XhGNuRcke+ELCF5P GiWEfiKzWvN9hVhiUyr3q2pd7d1TIc2VifAutYAo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Gao Xiang Subject: [PATCH 5.4 093/122] MIPS: fix "mipsel-linux-ld: decompress.c:undefined reference to `memmove" Date: Thu, 15 Jul 2021 20:39:00 +0200 Message-Id: <20210715182515.933919315@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182448.393443551@linuxfoundation.org> References: <20210715182448.393443551@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: Gao Xiang This is _not_ an upstream commit and just for 5.4.y only. kernel test robot reported a 5.4.y build issue found by randconfig [1] after backporting commit 89b158635ad7 ("lib/lz4: explicitly support in-place decompression"") due to "undefined reference to `memmove'". However, upstream and 5.10 LTS seem fine. After digging further, I found commit a510b616131f ("MIPS: Add support for ZSTD-compressed kernels") introduced memmove() occasionally and it has been included since v5.10. This partially cherry-picks the memmove() part of commit a510b616131f to fix the reported build regression since we don't need the whole patch for 5.4 LTS at all. [1] https://lore.kernel.org/r/202107070120.6dOj1kB7-lkp@intel.com/ Fixes: defcc2b5e54a ("lib/lz4: explicitly support in-place decompression") # 5.4.y Reported-by: kernel test robot Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman --- arch/mips/boot/compressed/string.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/arch/mips/boot/compressed/string.c +++ b/arch/mips/boot/compressed/string.c @@ -5,6 +5,7 @@ * Very small subset of simple string routines */ +#include #include void *memcpy(void *dest, const void *src, size_t n) @@ -27,3 +28,19 @@ void *memset(void *s, int c, size_t n) ss[i] = c; return s; } + +void * __weak memmove(void *dest, const void *src, size_t n) +{ + unsigned int i; + const char *s = src; + char *d = dest; + + if ((uintptr_t)dest < (uintptr_t)src) { + for (i = 0; i < n; i++) + d[i] = s[i]; + } else { + for (i = n; i > 0; i--) + d[i - 1] = s[i - 1]; + } + return dest; +}