Re: arm-linux-gnueabi-ld: error: .btf.vmlinux.bin.o is already in final BE8 format

From: Arnd Bergmann
Date: Tue Jun 14 2022 - 12:20:51 EST


On Sat, Jun 11, 2022 at 11:00 PM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 0678afa6055d14799c1dc1eee47c8025eba56cab
> commit: 5d6f52671e76ca2d55d74e676ac4c38ceb14a2d3 ARM: rework endianess selection
> date: 9 weeks ago
> configrong.a.chen@xxxxxxxxx: arm-randconfig-r012-20220612 (https://download.01.org/0day-ci/archive/20220612/202206120438.Un6Wq4N0-lkp@xxxxxxxxx/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 11.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=5d6f52671e76ca2d55d74e676ac4c38ceb14a2d3
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 5d6f52671e76ca2d55d74e676ac4c38ceb14a2d3
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>):
>
> >> arm-linux-gnueabi-ld: error: .btf.vmlinux.bin.o is already in final BE8 format
> arm-linux-gnueabi-ld: failed to merge target specific data of file .btf.vmlinux.bin.o

I had a look at this bug, and found that this is not caused by my commit, but
rather is the result of CONFIG_CPU_BIG_ENDIAN with BE8 format being
incompatible with CONFIG_DEBUG_INFO_BTF.

I'm sure there is an easy fix but I have not found it. Should we just
add a Kconfig
dependency to prevent this, or does anyone have an idea for a proper fix?

Arnd