Content-Type: multipart/mixed; boundary="===============2583620008865940124==" MIME-Version: 1.0 From: Greg Kroah-Hartman To: kbuild-all@lists.01.org Subject: Re: [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove' Date: Fri, 09 Jul 2021 12:31:12 +0200 Message-ID: In-Reply-To: List-Id: --===============2583620008865940124== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, Jul 09, 2021 at 03:20:41PM +0800, Gao Xiang wrote: > Hi Greg, stable all, > = > On Fri, Jul 09, 2021 at 01:50:16PM +0800, Gao Xiang wrote: > > On Wed, Jul 07, 2021 at 01:15:28AM +0800, kernel test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-= stable-rc.git linux-5.4.y > > > head: 3909e2374335335c9504467caabc906d3f7487e4 > > > commit: defcc2b5e54a4724fb5733f802edf5dd596018b6 [7045/7049] lib/lz4:= explicitly support in-place decompression > > > config: mips-randconfig-r036-20210706 (attached as .config) > > > compiler: mipsel-linux-gcc (GCC) 9.3.0 > > > reproduce (this is a W=3D1 build): > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master= /sbin/make.cross -O ~/bin/make.cross > > > chmod +x ~/bin/make.cross > > > # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linu= x-stable-rc.git/commit/?id=3Ddefcc2b5e54a4724fb5733f802edf5dd596018b6 > > > git remote add linux-stable-rc https://git.kernel.org/pub/scm= /linux/kernel/git/stable/linux-stable-rc.git > > > git fetch --no-tags linux-stable-rc linux-5.4.y > > > git checkout defcc2b5e54a4724fb5733f802edf5dd596018b6 > > > # save the attached .config to linux build tree > > > mkdir build_dir > > > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-9.3.0 make.= cross O=3Dbuild_dir ARCH=3Dmips SHELL=3D/bin/bash > > > = > > > If you fix the issue, kindly add following tag as appropriate > > > Reported-by: kernel test robot > > = > > Which is weird, does the preboot environment miss memmove() on mipsel? > > Just a guess, I may look into that myself later... > > = > = > After manually checking, I found memmove() for the mips preboot environme= nt > was incidentally introduced by commit a510b616131f ("MIPS: Add support for > ZSTD-compressed kernels") which wasn't included in v5.4, but included in > v5.10 as below (so v5.10.y is fine): > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /arch/mips/boot/compressed?h=3Dv5.10&id=3Da510b616131f85215ba156ed67e5ed1c0= 701f80f > = > And when I applied the following patch partially from the original > commit, the compile error with the command lines mentioned above was gone: > = > diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compress= ed/string.c > index 43beecc3587c..e9ab7ea592ba 100644 > --- a/arch/mips/boot/compressed/string.c > +++ b/arch/mips/boot/compressed/string.c > @@ -27,3 +27,19 @@ void *memset(void *s, int c, size_t n) > ss[i] =3D c; > return s; > } > + > +void * __weak memmove(void *dest, const void *src, size_t n) > +{ > + unsigned int i; > + const char *s =3D src; > + char *d =3D dest; > + > + if ((uintptr_t)dest < (uintptr_t)src) { > + for (i =3D 0; i < n; i++) > + d[i] =3D s[i]; > + } else { > + for (i =3D n; i > 0; i--) > + d[i - 1] =3D s[i - 1]; > + } > + return dest; > +} > = > How to backport such commit partially to the v5.4.y stable kernel? Please submit it in a format which we can apply it. > ... Also, it would be better to check other mips compile combinations > automatically since it's hard for me to check all such combinations > one-by-one... That's what kernelci is for, can you use that? thanks, greg k-h --===============2583620008865940124==--