LinuxPPC-Dev Archive on lore.kernel.org
 help / color / Atom feed
* Re: mmu.c:undefined reference to `patch__hash_page_A0'
       [not found] <202102271820.WlZCxtzY-lkp@intel.com>
@ 2021-04-18  0:02 ` Randy Dunlap
  2021-04-18 10:43   ` Christophe Leroy
  0 siblings, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2021-04-18  0:02 UTC (permalink / raw)
  To: kernel test robot, Christophe Leroy; +Cc: PowerPC, kbuild-all, linux-kernel

HI--

I no longer see this build error.
However:

On 2/27/21 2:24 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   3fb6d0e00efc958d01c2f109c8453033a2d96796
> commit: 259149cf7c3c6195e6199e045ca988c31d081cab powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
> date:   4 weeks ago
> config: powerpc64-randconfig-r013-20210227 (attached as .config)

ktr/lkp, this is a PPC32 .config file that is attached, not PPC64.

Also:

> compiler: powerpc-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 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/torvalds/linux.git/commit/?id=259149cf7c3c6195e6199e045ca988c31d081cab
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 259149cf7c3c6195e6199e045ca988c31d081cab
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    powerpc-linux-ld: arch/powerpc/mm/book3s32/mmu.o: in function `MMU_init_hw_patch':
>>> mmu.c:(.init.text+0x75e): undefined reference to `patch__hash_page_A0'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x76a): undefined reference to `patch__hash_page_A0'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x776): undefined reference to `patch__hash_page_A1'
>    powerpc-linux-ld: mmu.c:(.init.text+0x782): undefined reference to `patch__hash_page_A1'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x78e): undefined reference to `patch__hash_page_A2'
>    powerpc-linux-ld: mmu.c:(.init.text+0x79a): undefined reference to `patch__hash_page_A2'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x7aa): undefined reference to `patch__hash_page_B'
>    powerpc-linux-ld: mmu.c:(.init.text+0x7b6): undefined reference to `patch__hash_page_B'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x7c2): undefined reference to `patch__hash_page_C'
>    powerpc-linux-ld: mmu.c:(.init.text+0x7ce): undefined reference to `patch__hash_page_C'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x7da): undefined reference to `patch__flush_hash_A0'
>    powerpc-linux-ld: mmu.c:(.init.text+0x7e6): undefined reference to `patch__flush_hash_A0'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x7f2): undefined reference to `patch__flush_hash_A1'
>    powerpc-linux-ld: mmu.c:(.init.text+0x7fe): undefined reference to `patch__flush_hash_A1'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x80a): undefined reference to `patch__flush_hash_A2'
>    powerpc-linux-ld: mmu.c:(.init.text+0x816): undefined reference to `patch__flush_hash_A2'
>>> powerpc-linux-ld: mmu.c:(.init.text+0x83e): undefined reference to `patch__flush_hash_B'
>    powerpc-linux-ld: mmu.c:(.init.text+0x84e): undefined reference to `patch__flush_hash_B'
>    powerpc-linux-ld: arch/powerpc/mm/book3s32/mmu.o: in function `update_mmu_cache':
>>> mmu.c:(.text.update_mmu_cache+0xa0): undefined reference to `add_hash_page'

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?).

ta.
-- 
~Randy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mmu.c:undefined reference to `patch__hash_page_A0'
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2021-04-18 10:43 UTC (permalink / raw)
  To: Randy Dunlap, kernel test robot; +Cc: PowerPC, kbuild-all, linux-kernel



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:
> 
> On 2/27/21 2:24 AM, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   3fb6d0e00efc958d01c2f109c8453033a2d96796
>> commit: 259149cf7c3c6195e6199e045ca988c31d081cab powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
>> date:   4 weeks ago
>> config: powerpc64-randconfig-r013-20210227 (attached as .config)
> 
> ktr/lkp, this is a PPC32 .config file that is attached, not PPC64.
> 
> Also:
> 
>> compiler: powerpc-linux-gcc (GCC) 9.3.0

...

> 
> 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/ 
?

Thanks
Christophe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mmu.c:undefined reference to `patch__hash_page_A0'
  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
  0 siblings, 2 replies; 6+ messages in thread
From: Randy Dunlap @ 2021-04-18 17:15 UTC (permalink / raw)
  To: Christophe Leroy, kernel test robot; +Cc: PowerPC, kbuild-all, linux-kernel

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:
>>
>> On 2/27/21 2:24 AM, kernel test robot wrote:
>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>> head:   3fb6d0e00efc958d01c2f109c8453033a2d96796
>>> commit: 259149cf7c3c6195e6199e045ca988c31d081cab powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
>>> date:   4 weeks ago
>>> config: powerpc64-randconfig-r013-20210227 (attached as .config)
>>
>> ktr/lkp, this is a PPC32 .config file that is attached, not PPC64.
>>
>> Also:
>>
>>> compiler: powerpc-linux-gcc (GCC) 9.3.0
> 
> ...
> 
>>
>> 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:

for CONFIG_KERNEL_LZO=y:

In file included from ../lib/decompress_unlzo.c:26:
../include/linux/lzo.h:24:48: error: unknown type name 'size_t'
   24 | int lzo1x_1_compress(const unsigned char *src, size_t src_len,
      |                                                ^~~~~~
../include/linux/lzo.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | /* SPDX-License-Identifier: GPL-2.0 */
../include/linux/lzo.h:25:28: error: unknown type name 'size_t'
   25 |        unsigned char *dst, size_t *dst_len, void *wrkmem);
      |                            ^~~~~~
../include/linux/lzo.h:25:28: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:28:51: error: unknown type name 'size_t'
   28 | int lzorle1x_1_compress(const unsigned char *src, size_t src_len,
      |                                                   ^~~~~~
../include/linux/lzo.h:28:51: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:29:28: error: unknown type name 'size_t'
   29 |        unsigned char *dst, size_t *dst_len, void *wrkmem);
      |                            ^~~~~~
../include/linux/lzo.h:29:28: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:32:53: error: unknown type name 'size_t'
   32 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
      |                                                     ^~~~~~
../include/linux/lzo.h:32:53: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:33:26: error: unknown type name 'size_t'
   33 |      unsigned char *dst, size_t *dst_len);
      |                          ^~~~~~
../include/linux/lzo.h:33:26: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  CC      drivers/char/tpm/tpm2-space.o
  CC [M]  drivers/regulator/da9121-regulator.o
  AR      drivers/iommu/built-in.a
../lib/decompress_unlzo.c: In function 'unlzo':
../lib/decompress_unlzo.c:237:8: error: implicit declaration of function 'lzo1x_decompress_safe' [-Werror=implicit-function-declaration]
  237 |    r = lzo1x_decompress_safe((u8 *) in_buf, src_len,
      |        ^~~~~~~~~~~~~~~~~~~~~

In file included from ../arch/powerpc/boot/ops.h:15,
                 from ../arch/powerpc/boot/decompress.c:12:
../arch/powerpc/boot/types.h:50:15: error: expected identifier before numeric constant
   50 | #define false 0
      |               ^
../include/linux/stddef.h:11:2: note: in expansion of macro 'false'
   11 |  false = 0,
      |  ^~~~~
In file included from ../include/linux/kasan-checks.h:5,
                 from ../include/asm-generic/rwonce.h:26,
                 from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                 from ../include/linux/compiler.h:248,
                 from ../arch/powerpc/boot/../../../lib/decompress_unlzo.c:32,
                 from ../arch/powerpc/boot/decompress.c:43:
../include/linux/types.h:30:17: error: conflicting types for 'bool'
   30 | typedef _Bool   bool;
      |                 ^~~~
In file included from ../arch/powerpc/boot/ops.h:15,
                 from ../arch/powerpc/boot/decompress.c:12:
../arch/powerpc/boot/types.h:43:13: note: previous declaration of 'bool' was here
   43 | typedef int bool;
      |             ^~~~
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                 from ../include/linux/compiler.h:248,
                 from ../arch/powerpc/boot/../../../lib/decompress_unlzo.c:32,
                 from ../arch/powerpc/boot/decompress.c:43:
../include/asm-generic/rwonce.h:64:31: error: expected ';' before 'unsigned'
   64 | static __no_sanitize_or_inline
      |                               ^
      |                               ;
   65 | unsigned long __read_once_word_nocheck(const void *addr)
      | ~~~~~~~~                       
../include/asm-generic/rwonce.h:82:28: error: expected ';' before 'unsigned'
   82 | static __no_kasan_or_inline
      |                            ^
      |                            ;
   83 | unsigned long read_word_at_a_time(const void *addr)
      | ~~~~~~~~                    
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:48:5: warning: variable 'level' set but not used [-Wunused-but-set-variable]
   48 |  u8 level = 0;
      |     ^~~~~


and for CONFIG_KERNEL_LZMA=y:
(this looks odd to me since it says "unlzo", but I repeated it
after a 'make clean' and got the same errors.)

In file included from ../lib/decompress_unlzo.c:26:
../include/linux/lzo.h:24:48: error: unknown type name 'size_t'
   24 | int lzo1x_1_compress(const unsigned char *src, size_t src_len,
      |                                                ^~~~~~
../include/linux/lzo.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | /* SPDX-License-Identifier: GPL-2.0 */
../include/linux/lzo.h:25:28: error: unknown type name 'size_t'
   25 |        unsigned char *dst, size_t *dst_len, void *wrkmem);
      |                            ^~~~~~
../include/linux/lzo.h:25:28: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:28:51: error: unknown type name 'size_t'
   28 | int lzorle1x_1_compress(const unsigned char *src, size_t src_len,
      |                                                   ^~~~~~
../include/linux/lzo.h:28:51: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:29:28: error: unknown type name 'size_t'
   29 |        unsigned char *dst, size_t *dst_len, void *wrkmem);
      |                            ^~~~~~
../include/linux/lzo.h:29:28: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:32:53: error: unknown type name 'size_t'
   32 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
      |                                                     ^~~~~~
../include/linux/lzo.h:32:53: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../include/linux/lzo.h:33:26: error: unknown type name 'size_t'
   33 |      unsigned char *dst, size_t *dst_len);
      |                          ^~~~~~
../include/linux/lzo.h:33:26: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
../lib/decompress_unlzo.c: In function 'unlzo':
../lib/decompress_unlzo.c:237:8: error: implicit declaration of function 'lzo1x_decompress_safe' [-Werror=implicit-function-declaration]
  237 |    r = lzo1x_decompress_safe((u8 *) in_buf, src_len,
      |        ^~~~~~~~~~~~~~~~~~~~~


-- 
~Randy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mmu.c:undefined reference to `patch__hash_page_A0'
  2021-04-18 17:15     ` Randy Dunlap
@ 2021-04-18 18:35       ` Christophe Leroy
  2021-04-21  8:43       ` Christophe Leroy
  1 sibling, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2021-04-18 18:35 UTC (permalink / raw)
  To: Randy Dunlap, kernel test robot; +Cc: PowerPC, kbuild-all, linux-kernel



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:
>>>
>>> On 2/27/21 2:24 AM, kernel test robot wrote:
>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>> head:   3fb6d0e00efc958d01c2f109c8453033a2d96796
>>>> commit: 259149cf7c3c6195e6199e045ca988c31d081cab powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
>>>> date:   4 weeks ago
>>>> config: powerpc64-randconfig-r013-20210227 (attached as .config)
>>>
>>> ktr/lkp, this is a PPC32 .config file that is attached, not PPC64.
>>>
>>> Also:
>>>
>>>> compiler: powerpc-linux-gcc (GCC) 9.3.0
>>
>> ...
>>
>>>
>>> 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:

Ok, the patch is almost 1 year old, I guess there has been changes that break it. Will see if I can 
find some time to look at it.

Christophe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mmu.c:undefined reference to `patch__hash_page_A0'
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2021-04-21  8:43 UTC (permalink / raw)
  To: Randy Dunlap, kernel test robot; +Cc: PowerPC, kbuild-all, linux-kernel



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:
>>>
>>> On 2/27/21 2:24 AM, kernel test robot wrote:
>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>> head:   3fb6d0e00efc958d01c2f109c8453033a2d96796
>>>> commit: 259149cf7c3c6195e6199e045ca988c31d081cab powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected
>>>> date:   4 weeks ago
>>>> config: powerpc64-randconfig-r013-20210227 (attached as .config)
>>>
>>> ktr/lkp, this is a PPC32 .config file that is attached, not PPC64.
>>>
>>> Also:
>>>
>>>> compiler: powerpc-linux-gcc (GCC) 9.3.0
>>
>> ...
>>
>>>
>>> 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[] = {



Thanks
Christophe

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mmu.c:undefined reference to `patch__hash_page_A0'
  2021-04-21  8:43       ` Christophe Leroy
@ 2021-04-22  2:16         ` Randy Dunlap
  0 siblings, 0 replies; 6+ messages in thread
From: Randy Dunlap @ 2021-04-22  2:16 UTC (permalink / raw)
  To: Christophe Leroy, kernel test robot; +Cc: PowerPC, kbuild-all, linux-kernel

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[] = {


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git