qoriq: Problem with u-boot compilation (dual arch issue)

Paweł Dembicki paweldembicki at gmail.com
Wed Oct 5 07:13:30 PDT 2022


Hi everybody,

I am preparing support for the T4240RDB board. But I'm stuck with one problem:

Qoriq target is powerpc64. But  T4240RDB in u-boot is supported as
mpc85xx family and requires a 32-bit compiler.

I tried setting OpenWrt config:  EXTRA_TARGET_ARCH to y and
EXTRA_TARGET_ARCH_NAME to powerpc32. But it didn't work:

powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `arch/powerpc/cpu/mpc85xx/start.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `arch/powerpc/cpu/mpc85xx/resetvec.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `arch/powerpc/cpu/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `arch/powerpc/cpu/mpc85xx/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `arch/powerpc/lib/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `board/freescale/common/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `board/freescale/t4rdb/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `cmd/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `common/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `disk/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/ddr/fsl/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/dma/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/i2c/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/net/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/net/fm/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/net/phy/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/serial/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/spi/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/usb/common/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `drivers/usb/host/built-in.o' is incompatible with
powerpc:common64 output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `env/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `fs/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `lib/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: powerpc:common architecture of
input file `net/built-in.o' is incompatible with powerpc:common64
output
powerpc64-openwrt-linux-musl-ld.bfd: arch/powerpc/cpu/built-in.o: in
function `find_law':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc8xxx/law.c:149:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: arch/powerpc/cpu/built-in.o: in
function `print_laws':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc8xxx/law.c:177:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: arch/powerpc/cpu/built-in.o: in
function `config_pamu':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc8xxx/fsl_pamu.c:393:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: arch/powerpc/cpu/built-in.o: in
function `get_win_cnt':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc8xxx/fsl_pamu.c:368:
undefined reference to `__udivdi3'
powerpc64-openwrt-linux-musl-ld.bfd: arch/powerpc/cpu/built-in.o: in
function `config_pamu':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc8xxx/fsl_pamu.c:428:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: arch/powerpc/cpu/built-in.o: in
function `pamu_config_spaace':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc8xxx/fsl_pamu.c:190:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd:
arch/powerpc/cpu/mpc85xx/built-in.o: in function `print_tlbcam':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc85xx/tlb.c:81:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
arch/powerpc/cpu/mpc85xx/built-in.o: in function `set_tlb':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc85xx/tlb.c:164:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
arch/powerpc/cpu/mpc85xx/built-in.o: in function `init_addr_map':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc85xx/tlb.c:235:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
arch/powerpc/cpu/mpc85xx/built-in.o: in function `tlb_map_range':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/arch/powerpc/cpu/mpc85xx/tlb.c:292:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/built-in.o: in function
`stm_get_locked_range':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/mtd/spi/spi-nor-core.c:635:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/built-in.o: in function
`fsl_pcie_setup_inbound_wins':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/pci/pcie_fsl.c:355:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/pci/pcie_fsl.c:365:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/pci/pcie_fsl.c:375:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/pci/pcie_fsl.c:378:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/built-in.o: in function
`mmc_startup':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/mmc/mmc.c:2530:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/ddr/fsl/built-in.o: in
function `__step_assign_addresses':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/main.c:463:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/main.c:383:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/main.c:438:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/ddr/fsl/built-in.o: in
function `compute_fsl_memctl_config_regs':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/ctrl_regs.c:2402:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/ctrl_regs.c:2478:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/ddr/fsl/built-in.o: in
function `compute_ranksize':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/ddr3_dimm_params.c:69:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/ddr/fsl/built-in.o: in
function `ddr_compute_dimm_parameters':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/ddr/fsl/ddr3_dimm_params.c:122:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: drivers/spi/built-in.o: in
function `spi_mem_exec_op':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/drivers/spi/spi-mem.c:370:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: fs/built-in.o: in function
`ext4fs_get_extent_block':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/fs/ext4/ext4_common.c:1562:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd: fs/built-in.o: in function
`ext4fs_set_blk_dev':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/fs/ext4/dev.c:46:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: lib/built-in.o: in function `print_size':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/lib/display_options.c:103:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/lib/display_options.c:115:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/lib/display_options.c:119:
undefined reference to `__ashldi3'
powerpc64-openwrt-linux-musl-ld.bfd:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/lib/display_options.c:119:
undefined reference to `__lshrdi3'
powerpc64-openwrt-linux-musl-ld.bfd: lib/built-in.o: in function `number':
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/lib/vsprintf.c:215:
undefined reference to `__lshrdi3'
make[3]: *** [Makefile:1704: u-boot] Error 1
make[3]: Leaving directory
'/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08'
make[2]: *** [Makefile:62:
/home/krolik/sources/openwrt-2/build_dir/target-powerpc64_e5500_musl/uboot-qoriq-fsl_t4240-rdb-sdboot/uboot-qoriq-21.08/.built]
Error 2
make[2]: Leaving directory
'/home/krolik/sources/openwrt-2/package/boot/uboot-qoriq'
time: package/boot/uboot-qoriq/fsl_t4240-rdb-sdboot/compile#47.36#9.90#54.88
    ERROR: package/boot/uboot-qoriq failed to build (build variant:
fsl_t4240-rdb-sdboot).
make[1]: *** [package/Makefile:116: package/boot/uboot-qoriq/compile] Error 1
make[1]: Leaving directory '/home/krolik/sources/openwrt-2'
make: *** [/home/krolik/sources/openwrt-2/include/toplevel.mk:231:
package/boot/uboot-qoriq/compile] Error 2

I see two possible solutions:
1. Compile u-boot with regular powerpc compiler
2. Fix settings in powerpc64 linker to allow build 32-bit arch binary.

Can I ask for help with it?

-- 
Best Regards,
Pawel Dembicki



More information about the openwrt-devel mailing list