Subject: Re: randconfig build error with next-20151009, in lib/zlib_deflate/deftree.c

From: Andrew Morton <[email-masked]>
Date: Mon, 12 Oct 2015 14:55:42 -0700

On Fri, 9 Oct 2015 13:38:25 -0700 Jim Davis <[email-masked]> wrote:

> Building with the attached random configuration file,
> 
> lib/built-in.o: In function `__bitrev32':
> deftree.c:(.text+0x1e799): undefined reference to `byte_rev_table'
> deftree.c:(.text+0x1e7a0): undefined reference to `byte_rev_table'
> deftree.c:(.text+0x1e7b4): undefined reference to `byte_rev_table'
> deftree.c:(.text+0x1e7c1): undefined reference to `byte_rev_table'

This is really irritating.  We save 287 bytes in kernels which don't
use bitrev.  It isn't worth the hassle, but let's keep plugging.

From: Andrew Morton <[email-masked]>
Subject: lib/Kconfig: ZLIB_DEFLATE must select BITREVERSE

lib/built-in.o: In function `__bitrev32':
deftree.c:(.text+0x1e799): undefined reference to `byte_rev_table'
deftree.c:(.text+0x1e7a0): undefined reference to `byte_rev_table'
deftree.c:(.text+0x1e7b4): undefined reference to `byte_rev_table'
deftree.c:(.text+0x1e7c1): undefined reference to `byte_rev_table'

Anything which uses bitrevX() has to select BITREVERSE, to grab
lib/bitrev.o.

Reported-by: Jim Davis <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 lib/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff -puN lib/Kconfig~lib-kconfig-zlib_deflate-must-select-bitreverse lib/Kconfig
--- a/lib/Kconfig~lib-kconfig-zlib_deflate-must-select-bitreverse
+++ a/lib/Kconfig
@@ -220,6 +220,7 @@ config ZLIB_INFLATE
 
 config ZLIB_DEFLATE
 	tristate
+	select BITREVERSE
 
 config LZO_COMPRESS
 	tristate
_