linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	kernel test robot <lkp@intel.com>
Cc: PowerPC <linuxppc-dev@lists.ozlabs.org>,
	kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: Re: mmu.c:undefined reference to `patch__hash_page_A0'
Date: Wed, 21 Apr 2021 19:16:04 -0700	[thread overview]
Message-ID: <bcc70465-78fa-3b2e-6506-2b9917f21e0d@infradead.org> (raw)
In-Reply-To: <fce1f2a1-a4ea-03d1-20ab-f0c716884819@csgroup.eu>

On 4/21/21 1:43 AM, Christophe Leroy wrote:
> 
> 
> Le 18/04/2021 à 19:15, Randy Dunlap a écrit :
>> On 4/18/21 3:43 AM, Christophe Leroy wrote:
>>>
>>>
>>> Le 18/04/2021 à 02:02, Randy Dunlap a écrit :
>>>> HI--
>>>>
>>>> I no longer see this build error.
>>>
>>> Fixed by https://github.com/torvalds/linux/commit/acdad8fb4a1574323db88f98a38b630691574e16
>>>
>>>> However:
>>>>

...

>>>>
>>>> I do see this build error:
>>>>
>>>> powerpc-linux-ld: arch/powerpc/boot/wrapper.a(decompress.o): in function `partial_decompress':
>>>> decompress.c:(.text+0x1f0): undefined reference to `__decompress'
>>>>
>>>> when either
>>>> CONFIG_KERNEL_LZO=y
>>>> or
>>>> CONFIG_KERNEL_LZMA=y
>>>>
>>>> but the build succeeds when either
>>>> CONFIG_KERNEL_GZIP=y
>>>> or
>>>> CONFIG_KERNEL_XZ=y
>>>>
>>>> I guess that is due to arch/powerpc/boot/decompress.c doing this:
>>>>
>>>> #ifdef CONFIG_KERNEL_GZIP
>>>> #    include "decompress_inflate.c"
>>>> #endif
>>>>
>>>> #ifdef CONFIG_KERNEL_XZ
>>>> #    include "xz_config.h"
>>>> #    include "../../../lib/decompress_unxz.c"
>>>> #endif
>>>>
>>>>
>>>> It would be nice to require one of KERNEL_GZIP or KERNEL_XZ
>>>> to be set/enabled (maybe unless a uImage is being built?).
>>>
>>>
>>> Can you test by https://patchwork.ozlabs.org/project/linuxppc-dev/patch/a74fce4dfc9fa32da6ce3470bbedcecf795de1ec.1591189069.git.christophe.leroy@csgroup.eu/ ?
>>
>> Hi Christophe,
>>
>> I get build errors for both LZO and LZMA:
>>
> 
> Can you check with the following changes on top of my patch:
> 
> diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c
> index a8dbde4b32d4..f06f925385c0 100644
> --- a/lib/decompress_unlzo.c
> +++ b/lib/decompress_unlzo.c
> @@ -23,13 +23,15 @@
>  #include <linux/decompress/unlzo.h>
>  #endif
> 
> -#include <linux/lzo.h>
>  #ifdef __KERNEL__
>  #include <linux/types.h>
> +#endif
> +#include <linux/lzo.h>
> +#ifdef __KERNEL__
>  #include <linux/decompress/mm.h>
> +#include <linux/compiler.h>
>  #endif
> 
> -#include <linux/compiler.h>
>  #include <asm/unaligned.h>
> 
>  static const unsigned char lzop_magic[] = {

Hi Christophe,
Sorry for the delay -- it's been a very busy day here.

For CONFIG_KERNEL_LZMA=y, I get a couple of warnings:

  BOOTCC  arch/powerpc/boot/decompress.o
In file included from ../arch/powerpc/boot/decompress.c:38:
../arch/powerpc/boot/../../../lib/decompress_unlzma.c: In function 'unlzma':
../arch/powerpc/boot/../../../lib/decompress_unlzma.c:582:21: warning: pointer targets in passing argument 3 of 'rc_init' differ in signedness [-Wpointer-sign]
  582 |  rc_init(&rc, fill, inbuf, in_len);
      |                     ^~~~~
      |                     |
      |                     unsigned char *
../arch/powerpc/boot/../../../lib/decompress_unlzma.c:107:18: note: expected 'char *' but argument is of type 'unsigned char *'
  107 |            char *buffer, long buffer_size)
      |            ~~~~~~^~~~~~


and for CONFIG_KERNEL_LZO=y, this one warning:

  BOOTCC  arch/powerpc/boot/decompress.o
In file included from ../arch/powerpc/boot/decompress.c:43:
../arch/powerpc/boot/../../../lib/decompress_unlzo.c: In function 'parse_header':
../arch/powerpc/boot/../../../lib/decompress_unlzo.c:51:5: warning: variable 'level' set but not used [-Wunused-but-set-variable]
   51 |  u8 level = 0;
      |     ^~~~~

Note: the patch above did not apply cleanly for me so any problems
above could be due to my mangling the patch.
The patch that I used is below.

Thanks.
---
---
 lib/decompress_unlzo.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- linux-next-20210421.orig/lib/decompress_unlzo.c
+++ linux-next-20210421/lib/decompress_unlzo.c
@@ -23,13 +23,16 @@
 #include <linux/decompress/unlzo.h>
 #endif
 
-#include <linux/lzo.h>
 #ifdef __KERNEL__
 #include <linux/types.h>
-#include <linux/decompress/mm.h>
 #endif
+#include <linux/lzo.h>
 
+#ifdef __KERNEL__
+#include <linux/decompress/mm.h>
 #include <linux/compiler.h>
+#endif
+
 #include <asm/unaligned.h>
 
 static const unsigned char lzop_magic[] = {


      reply	other threads:[~2021-04-22  2:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202102271820.WlZCxtzY-lkp@intel.com>
2021-04-18  0:02 ` mmu.c:undefined reference to `patch__hash_page_A0' Randy Dunlap
2021-04-18 10:43   ` Christophe Leroy
2021-04-18 17:15     ` Randy Dunlap
2021-04-18 18:35       ` Christophe Leroy
2021-04-21  8:43       ` Christophe Leroy
2021-04-22  2:16         ` Randy Dunlap [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcc70465-78fa-3b2e-6506-2b9917f21e0d@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).