Messages in this thread | | | From | Vlad Dronov <> | Date | Mon, 4 Jul 2022 16:58:44 +0200 | Subject | Re: include/crypto/chacha.h:100: undefined reference to `chacha_crypt_arch' |
| |
Hi,
On Mon, Jul 4, 2022 at 4:35 PM Vlad Dronov <vdronov@redhat.com> wrote: > > 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?
Ok, I should have tested this beforehand. With the configs set as above:
CONFIG_CRYPTO=y CONFIG_CRYPTO_CHACHA20_X86_64=m // implies the next line =m CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305 is not set // =n
"make menuconfig" allows only =n and =m for CRYPTO_LIB_CHACHA20POLY1305 indeed. So the test robot has fed an invalid config to a build process. Let me forward this thread to lkp@lists.01.org to report this issue.
Best regards, Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer
| |