1

I encountered an error while trying to cross-compile Linux kernel v.5.0.0 on Ubuntu 18.04.

I tested two different versions of aarch64-linux-gnu-gcc: v7.4.0 and v5.5.0, but both results in the same error.

Here are the dependencies I have installed and the commands I ran to compile the kernel:

$ sudo apt install libssl-dev libelf-dev build-essentials libncurses5-dev flex bison gcc-arm-linux-gnueabi gcc-arm-none-eabi gcc-arm-linux-gnueabihf   gcc-arm-none-eabi-source
$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make defconfig
$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j

And this is the error messages that I got:

  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  AR      built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.o
arch/arm64/crypto/sha2-ce-glue.o: In function `sha256_base_do_update':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82:(.text+0x220): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75:(.text+0x2bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
arch/arm64/crypto/sha2-ce-glue.o: In function `sha256_base_do_finalize':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:111: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:111:(.text+0x4ec): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:106: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:106:(.text+0x598): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
arch/arm64/crypto/sha2-ce-glue.o: In function `sha256_base_do_update':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82:(.text+0x694): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
arch/arm64/crypto/sha2-ce-glue.o:/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75: more undefined references to `sha256_block_data_order' follow
arch/arm64/crypto/sha2-ce-glue.o: In function `sha256_base_do_update':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75:(.text+0x6cc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
arch/arm64/crypto/sha2-ce-glue.o: In function `sha256_base_do_finalize':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:111:(.text+0x79c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:106:(.text+0x908): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
arch/arm64/crypto/sha256-glue.o: In function `sha256_base_do_update':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82:(.text+0x158): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75:(.text+0x190): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `sha256_block_data_order'
arch/arm64/crypto/sha256-glue.o: In function `sha256_base_do_finalize':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:111:(.text+0x218): additional relocation overflows omitted from the output
arch/arm64/crypto/sha256-glue.o: In function `sha256_base_do_update':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82: undefined reference to `sha256_block_neon'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75: undefined reference to `sha256_block_neon'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75: undefined reference to `sha256_block_data_order'
arch/arm64/crypto/sha256-glue.o: In function `sha256_base_do_finalize':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:111: undefined reference to `sha256_block_neon'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:111: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:106: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:106: undefined reference to `sha256_block_neon'
arch/arm64/crypto/sha256-glue.o: In function `sha256_base_do_update':
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:82: undefined reference to `sha256_block_data_order'
/home/shpark/git.kernel.org/arm64/linux/./include/crypto/sha256_base.h:75: undefined reference to `sha256_block_data_order'
arch/arm64/crypto/sha256-glue.o: In function `__ksymtab_sha256_block_data_order':
sha256-glue.c:(___ksymtab+sha256_block_data_order+0x0): undefined reference to `sha256_block_data_order'
Makefile:1021: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

How can I fix this problem? I don't see the reason why is is failing ;)

Thanks!

  • This is not the first time I tried to cross-compile the kernel. But this time I got an unique error. That's why I am stuck – shpark Jun 14 '19 at 2:00
  • I found out my .config was different from defconfig. It was somehow configured to compile files in arch/arm64/crypto – shpark Jun 17 '19 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.