Help figure out why make freezes - no errors or messages

I am setting up my windows 11 tablet, Surface 10 Pro, to compile openwrt for my Mikrotik RB493G router. I don't have any other computers to install Linux on; they are all dead for various reasons. Netboot has a 4MB kernel limit and the openwrt initramfs is currently about 7MB. I plan to compile a copy of the openwrt release 24.10.2 to make sure I have a good environment before I start removing things like IPv6 to shrink the initramfs. I don't need IPv6 to netboot. I have followed the directions and I am at the part where I compile the kernel. I run make and it freezes after:
make[3] -C tools/llvm-bpf clean-build
make[3] -C tools/llvm-bpf compile

There is nothing else. It just sits there for hours, 3 to 4 hours. I ran make distclean and tried a second time but it freezes at the same spot. I tried another make distclean and ran make V=s 2>&1 | tee build.log | grep -i -E "^make.*(error|[12345]...Entering dir)" but that didn't give me any more information. How can I figure out what am I doing wrong?

These are steps I have followed to get to this point:

cmd - run as administrator
wsl --install -d Debian
sudo apt update
sudo apt dist-upgrade
sudo tee -a /etc/wsl.conf << EOF > /dev/null
[interop]
appendWindowsPath = false
EOF
exit
wsl --shutdown
wsl -d Debian

sudo apt install build-essential clang flex bison g++ gawk \
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \
python3-setuptools rsync swig unzip zlib1g-dev file wget

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git pull 

git checkout v24.10.2
./scripts/feeds update -a
./scripts/feeds install -a

wget https://downloads.openwrt.org/releases/24.10.2/targets/ath79/mikrotik/config.buildinfo -O .config
make menuconfig
select rb493g for target profile, save, and quit

make download
make

What's the CPU in that thing ?

Have you checked the CPU load while compiling, in a parallel window/session?

14 Intel Ultra 7165U processors
Yes. When it is compiling the first part CPU usage varies between 10-25%. After the compiler gets to
make[3] -C tools/llvm-bpf clean-build
make[3] -C tools/llvm-bpf compile
CPU usage drops to 0.

Compile with make V=sc to get the full output and see where it hangs.

This time it compiled fine. Diff and sha256sum show differences between my initramfs and openwrts. Is it possible to generate the exact same file that is downloadable from openwrt?

It probably runs out of memory and becomes unresponsive.

  • You can try using less threads for the making, e.g if you are doing make -j8 try make -j4
  • If the system just doesn't have enough memory you can try making a zram swap, or use a hard drive via usb as swap.
  • Or you can make sure your host has nbd support and then use nbdkit on another machine to share it's memory over. e.g..
on remote machine:
nbdkit -p 3000 memory allocator=zstd  20G
on build host:
modprobe nbd
nbd-client [ip of remote machine] 3000
mkswap /dev/nbd0
swapon -d /dev/nbd0

make fails
make -j1 V=sc works

I would think 16GB is enough, but it is windows compiling a Linux kernel, so you are probably right. I need to one of my Linux boxes repaired.

Hmm, yeah not sure, maybe there is an environment variable setting the MAKEFLAGS=jX to a number too large for the amount of ram the system has /shrug

24GB RAM VMs using some half crappy ARM CPUs are still free for life over at Oracle Cloud.

Create one, compile there.
But I have to admit, I haven't tried doing it on ARM, only x86.

1 Like