Make failing at gcc/initial/complete, "undefined reference"

I'm trying to compile the firmware for tp-link wr841nd v13.1 but at gcc/initial/complete it fails.
Here's what I get by running make -j1 V=s
https://pastebin.com/09k1A6D2

Something wrong in the buildhost ?
Some prerequisite missing?

You might try a standard Ubuntu etc. and install the prereqs as listed in wiki.

(Note: the specific router model has no impact on toolchain building phase. The toolchain is common for all devices in the same target)