lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch'
Hi,

On Sun, Jul 3, 2022 at 12:51 AM kernel test robot <lkp@intel.com> wrote:
> ...
> config: s390-buildonly-randconfig-r005-20220703 (https://download.01.org/0day-ci/archive/20220703/202207030630.6SZVkrWf-lkp@intel.com/config)
> ...
> s390-linux-ld: lib/crypto/chacha20poly1305.o: in function `chacha_crypt':
> >> include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch'
> >> s390-linux-ld: include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch'
> ...
> Kconfig warnings: (for reference only)
> WARNING: unmet direct dependencies detected for CRYPTO_LIB_CHACHA20POLY1305
> Depends on (CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA && (CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305 && CRYPTO

Ok, this is either weird or I do not understand how the Kconfig system works.

What I look at is CRYPTO_LIB_CHACHA20POLY1305 definition:

[ lib/crypto/Kconfig ]
config CRYPTO_LIB_CHACHA20POLY1305
tristate "ChaCha20-Poly1305 AEAD support (8-byte nonce library version)"
depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA
depends on CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305
depends on CRYPTO

and this test's random config (s390-buildonly-randconfig-r005-20220703):

$ grep -e CRYPTO_LIB_CHACHA20POLY1305 -e CRYPTO_ARCH_HAVE_LIB_CHACHA
-e CRYPTO_ARCH_HAVE_LIB_POLY1305 -e CRYPTO= config
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
// missing CRYPTO_ARCH_HAVE_LIB_POLY1305 implies =n (I guess?)

I'm following the canonical "Kconfig Language" doc (
https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html )
which states:

> - dependencies: “depends on” <expr>
> This defines a dependency for this menu entry. If multiple dependencies are defined, they are connected with ‘&&’.

and

> '!' <expr> (6)
> <expr> '&&' <expr> (7)
> <expr> '||' <expr> (8)
>
> 6. Returns the result of (2-/expr/).
> 7. Returns the result of min(/expr/, /expr/).
> 8. Returns the result of max(/expr/, /expr/).
> An expression can have a value of ‘n’, ‘m’ or ‘y’ (or 0, 1, 2 respectively for calculations).

So calculating:

(CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA) &&
(CRYPTO_ARCH_HAVE_LIB_POLY1305 || !CRYPTO_ARCH_HAVE_LIB_POLY1305) &&
CRYPTO

I find it equal to:

(m || !m) && (n || !n) && y => m && y && y => m

So CRYPTO_LIB_CHACHA20POLY1305 should be no higher than M, but it is
=Y in a config file => weird :\ (or me wrong somewhere).

WDYT?

Best regards,
Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer

\
 
 \ /
  Last update: 2022-07-04 16:36    [W:0.049 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site