Enabling statistics for Smstools3 package

Hello, I'm trying to build a new firmware while adding smstools3 package, and i need to activate the statistics option for it. I made a patch changing the Makefile to add this option, compiled libmm package as it's needed for the statistics to work, but after adding it smstools3 refuses to compile.
Without statistics enabled smstools3 compiles just fine.

In file included from smsd.c:19:
/usr/include/stdio.h:52:9: error: unknown type name '__gnuc_va_list'
 typedef __gnuc_va_list va_list;
         ^~~~~~~~~~~~~~
/usr/include/stdio.h:52:24: error: conflicting types for 'va_list'
 typedef __gnuc_va_list va_list;
                        ^~~~~~~
In file included from /home/name/RUTXR1/RUTXR/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/include/stdarg.h:10,
                 from /usr/include/stdio.h:36,
                 from smsd.c:19:
/home/name/RUTXR1/RUTXR/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/include/bits/alltypes.h:6:27: note: previous declaration of 'va_list' was here
 typedef __builtin_va_list va_list;
                           ^~~~~~~
In file included from smsd.c:19:
/usr/include/stdio.h:366:8: error: unknown type name '__gnuc_va_list'; did you mean 'va_list'?
        __gnuc_va_list __arg);
        ^~~~~~~~~~~~~~
        va_list
/usr/include/stdio.h:371:54: error: unknown type name '__gnuc_va_list'; did you mean 'va_list'?
 extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
^~~~~~~~~~~~~~ 

And a lot more, it seems to mainly complain about __gnuc_va_list being wrong.

Am I doing something wrong? Anything i can find on the internet for enabling statistics seems to say to just install libmm with the --prefix="/usr" set and uncommenting the CFLAGS += -D NOSTATS in smstools3 makefile.

If anyone has any ideas or a way to compile this, I'd be very grateful.

what openwrt version is this ?

Version 21.02.0

that version's EOL, you should upgrade.

Updated to the latest version, built a base firmware with make after updating the feeds, then tried to compile smstools3 and still got the same problem.