Issues Compiling Master for WDR4900v1 (mcp85xx)

I am having issues compiling the master branch for my WDR4900v1.

 make[2] package/install
 make[2] target/install
 make[3] -C target/linux install
    ERROR: target/linux failed to build.
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on

This is using make -j1 V=s

rm -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin
cp /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/simpleImage.tl-wdr4900-v1 /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin
mkimage -A powerpc -O linux -T kernel -C none -a 0x1000000 -e 0x1000000 -n 'POWERPC OpenWrt Linux-5.4.115'   -d /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin.new
Image Name:   POWERPC OpenWrt Linux-5.4.115
Created:      Wed May  5 12:18:50 2021
Image Type:   PowerPC Linux Kernel Image (uncompressed)
Data Size:    2547696 Bytes = 2487.98 KiB = 2.43 MiB
Load Address: 01000000
Entry Point:  01000000
mv /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin.new /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin
[ -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin -a -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/root.squashfs ]
/home/alvarok/OpenWRT/openwrt/staging_dir/host/bin/mktplinkfw -H 0x49000001 -W 1 -F 16Mppc -N "OpenWrt" -V r16640-b607e7df34 -m 1 -k /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin -r /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/root.squashfs -o /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin.new -j -X 0x40000 -a 0x4   && mv /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin.new /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin || rm -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin
cp /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin /home/alvarok/OpenWRT/openwrt/bin/targets/mpc85xx/p1010/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin
[ -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin -a -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/root.squashfs ]
/home/alvarok/OpenWRT/openwrt/staging_dir/host/bin/mktplinkfw -H 0x49000001 -W 1 -F 16Mppc -N "OpenWrt" -V r16640-b607e7df34 -m 1 -k /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tplink_tl-wdr4900-v1-kernel.bin -r /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/root.squashfs -o /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.new -j -X 0x40000 -a 0x4  -s && mv /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.new /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin || rm -f /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin
echo '{  "metadata_version": "1.1", "compat_version": "1.0",   "supported_devices":["tplink,tl-wdr4900-v1","tl-wdr4900-v1"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "r16640-b607e7df34", "target": "mpc85xx/p1010", "board": "tplink_tl-wdr4900-v1" } }' | fwtool -I - /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin
[ ! -s "/home/alvarok/OpenWRT/openwrt/key-build" -o ! -s "/home/alvarok/OpenWRT/openwrt/key-build.ucert" -o ! -s "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin" ] || { cp "/home/alvarok/OpenWRT/openwrt/key-build.ucert" "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.ucert" ; usign -S -m "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin" -s "/home/alvarok/OpenWRT/openwrt/key-build" -x "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.sig" ; ucert -A -c "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.ucert" -x "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.sig" ; fwtool -S "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.ucert" "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin" ; }
cp /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin /home/alvarok/OpenWRT/openwrt/bin/targets/mpc85xx/p1010/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin
cp /home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-initramfs-kernel.bin /home/alvarok/OpenWRT/openwrt/bin/targets/mpc85xx/p1010/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-initramfs-kernel.bin
make[5]: Leaving directory '/home/alvarok/OpenWRT/openwrt/target/linux/mpc85xx/image'
make[4]: Leaving directory '/home/alvarok/OpenWRT/openwrt/target/linux/mpc85xx'
make[3]: Leaving directory '/home/alvarok/OpenWRT/openwrt/target/linux'
time: target/linux/install#31.05#3.70#31.22
    ERROR: target/linux failed to build.
make[2]: Leaving directory '/home/alvarok/OpenWRT/openwrt'
make[1]: Leaving directory '/home/alvarok/OpenWRT/openwrt'

I am still trying to debug this build

net/sched/Kconfig:45: warning: menuconfig statement without prompt
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/head_fsl_booke.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/memcmp_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/strlen_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/copy_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/checksum_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/head_fsl_booke.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/memcmp_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/strlen_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/copy_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/checksum_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/head_fsl_booke.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/memcmp_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/strlen_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/copy_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/checksum_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string_32.o' being placed in section `__ksymtab_strings'
.config:5:warning: symbol value 'm' invalid for ATH_REG_DYNAMIC_USER_REG_HINTS
net/sched/Kconfig:45: warning: menuconfig statement without prompt
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/head_fsl_booke.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/memcmp_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/strlen_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/copy_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/checksum_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/head_fsl_booke.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/memcmp_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/strlen_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/copy_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/checksum_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/head_fsl_booke.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/kernel/misc_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/memcmp_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/strlen_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/copy_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/checksum_32.o' being placed in section `__ksymtab_strings'
powerpc-openwrt-linux-musl-ld: warning: orphan section `__ksymtab_strings' from `arch/powerpc/lib/string_32.o' being placed in section `__ksymtab_strings'
Pseudo file "/dev" exists in source filesystem "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/root-mpc85xx/dev".
Ignoring, exclude it (-e/-ef) to override.
[mktplinkfw] rootfs offset aligned to 0x2548272
[mktplinkfw] firmware file "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-factory.bin.new" completed
[mktplinkfw] rootfs offset aligned to 0x2548272
[mktplinkfw] firmware file "/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-squashfs-sysupgrade.bin.new" completed
cp: cannot stat '/home/alvarok/OpenWRT/openwrt/build_dir/target-powerpc_8540_musl/linux-mpc85xx_p1010/tmp/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-initramfs-kernel.bin': No such file or directory
make[5]: *** [Makefile:21: /home/alvarok/OpenWRT/openwrt/bin/targets/mpc85xx/p1010/openwrt-mpc85xx-p1010-tplink_tl-wdr4900-v1-initramfs-kernel.bin] Error 1
make[4]: *** [Makefile:25: install] Error 2
make[3]: *** [Makefile:11: install] Error 2
make[2]: *** [target/Makefile:25: target/linux/install] Error 1
make[1]: *** [target/Makefile:19: /home/alvarok/OpenWRT/openwrt/staging_dir/target-powerpc_8540_musl/stamp/.target_install] Error 2
make: *** [/home/alvarok/OpenWRT/openwrt/include/toplevel.mk:230: world] Error 2

Link to the Full Output

hi,

looks like trunk's kernel build is too large for the wdr4900 v1's partition layout.

i've manged to worked around it with .config options as follows:

# CONFIG_KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_KERNEL_CC_OPTIMIZE_FOR_SIZE=y

these 2 commits give a background idea of the issue, where it's running out of space due to how the bootloader was designed

maybe this target needs a "tiny" subtarget like ath79?

It may be possible to use the lzma kernel loader, but it has never been used on this platform before so it would probably be difficult to redesign it for this target (mpc85xxx)