Building LEDE Firmware for TpLink WR740N v4

Hi everyone, it's been a while. Anyhow, I have an old TpLInk WR740N v4 lying around and wanted to put it to work. There was an issue with it where it always went in to failsafe mode even though no buttons were pressed. I tried to diagnose this issue but found nothing.

So, I decided to compile Openwrt LEDE v17.01.7 for this (including travelmate package). Now I am running into some bizarre error that I can't really find any explanation on internet.

I am running the build on Ubuntu 22.04.2 in WSL 2 on Windows 11 and here is the out put of error:

ahmar@Ahmar-HP15:~/development/openwrt$ make -j1 V=s
make[1]: Entering directory '/home/ahmar/development/openwrt'
make[2]: Entering directory '/home/ahmar/development/openwrt'
+ mkdir -p /home/ahmar/development/openwrt/staging_dir/target-mips_24kc_musl-1.1.16
+ cd /home/ahmar/development/openwrt/staging_dir/target-mips_24kc_musl-1.1.16
+ mkdir -p bin lib include stamp
mkdir -p /home/ahmar/development/openwrt/build_dir/target-mips_24kc_musl-1.1.16/stamp
touch /home/ahmar/development/openwrt/staging_dir/target-mips_24kc_musl-1.1.16/.prepared
+ mkdir -p /home/ahmar/development/openwrt/staging_dir/host
+ cd /home/ahmar/development/openwrt/staging_dir/host
+ mkdir -p bin lib include stamp
mkdir -p /home/ahmar/development/openwrt/build_dir/host/stamp /home/ahmar/development/openwrt/staging_dir/host/include/sys
install -m0644 /home/ahmar/development/openwrt/tools/include/*.h /home/ahmar/development/openwrt/staging_dir/host/include/
install -m0644 /home/ahmar/development/openwrt/tools/include/sys/*.h /home/ahmar/development/openwrt/staging_dir/host/include/sys/
ln -sf lib /home/ahmar/development/openwrt/staging_dir/host/lib64
touch /home/ahmar/development/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/flock'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/flock'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/flock'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/flock'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/sed'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/sed'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/sed'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/sed'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/patch'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/patch'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/patch'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/patch'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/xz'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/xz'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/xz'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/xz'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/tar'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/tar'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/tar'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/tar'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/ccache'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/ccache'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/ccache'
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/ccache'
make[3]: Entering directory '/home/ahmar/development/openwrt/tools/m4'
CFLAGS="-O2 -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include " CPPFLAGS="-I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include " CXXFLAGS="" LDFLAGS="-L/home/ahmar/development/openwrt/staging_dir/host/lib -L/home/ahmar/development/openwrt/staging_dir/host/usr/lib " make  -C /home/ahmar/development/openwrt/build_dir/host/m4-1.4.18
make[4]: Entering directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18'
make  all-recursive
make[5]: Entering directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18'
Making all in .
make[6]: Entering directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18'
make[6]: Nothing to be done for 'all-am'.
make[6]: Leaving directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18'
Making all in examples
make[6]: Entering directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/examples'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/examples'
Making all in lib
make[6]: Entering directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/lib'
make  all-am
make[7]: Entering directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/lib'
depbase=`echo gl_avltree_oset.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
ccache gcc  -I.   -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include   -O2 -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include  -MT gl_avltree_oset.o -MD -MP -MF $depbase.Tpo -c -o gl_avltree_oset.o gl_avltree_oset.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo binary-io.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
ccache gcc  -I.   -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include   -O2 -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include  -MT binary-io.o -MD -MP -MF $depbase.Tpo -c -o binary-io.o binary-io.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo c-stack.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
ccache gcc  -I.   -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include   -O2 -I/home/ahmar/development/openwrt/staging_dir/host/include -I/home/ahmar/development/openwrt/staging_dir/host/usr/include  -MT c-stack.o -MD -MP -MF $depbase.Tpo -c -o c-stack.o c-stack.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/signal.h:328,
                 from ./signal.h:52,
                 from c-stack.c:49:
c-stack.c:55:26: error: missing binary operator before token "("
   55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
      |                          ^~~~~~~~
make[7]: *** [Makefile:1910: c-stack.o] Error 1
make[7]: Leaving directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/lib'
make[6]: *** [Makefile:1674: all] Error 2
make[6]: Leaving directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/lib'
make[5]: *** [Makefile:1572: all-recursive] Error 1
make[5]: Leaving directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18'
make[4]: *** [Makefile:1528: all] Error 2
make[4]: Leaving directory '/home/ahmar/development/openwrt/build_dir/host/m4-1.4.18'
make[3]: *** [Makefile:29: /home/ahmar/development/openwrt/build_dir/host/m4-1.4.18/.built] Error 2
make[3]: Leaving directory '/home/ahmar/development/openwrt/tools/m4'
make[2]: *** [tools/Makefile:148: tools/m4/compile] Error 2
make[2]: Leaving directory '/home/ahmar/development/openwrt'
make[1]: *** [tools/Makefile:145: /home/ahmar/development/openwrt/staging_dir/target-mips_24kc_musl-1.1.16/stamp/.tools_install_yynyyyyyynyyyyynyynnyyyyyyyyyyyyyyyyyyyynyynynyyyynnny] Error 2
make[1]: Leaving directory '/home/ahmar/development/openwrt'
make: *** [/home/ahmar/development/openwrt/include/toplevel.mk:207: world] Error 2

If anyone can point me in the right direction, that will be much appreciated. If any more specific information is needed, please let me know.

4/32 is below minimum system requirements.
17.01.x is EOL and mustn't be used anymore, as it contains known and unfixed security issues.

Show mercy with the hardware and put it to retirement in a cozy e-waste recycling centre.

1 Like