ERROR: package/system/ubus failed to build

Hii all,
I build shapshot builds for my own Tp-Link Archer C20 V5 every month. Recently I tried to build and got error so I waited for a fix, it's my 3rd attempt but still getting error,

here is the make -js V=sc log,

/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify -DNDEBUG -Wall -Werror -Wextra -Wformat -Werror=format-security -Werror=format-nonliteral -Werror=implicit-function-declaration -Os -g3 -Wmissing-declarations -Wno-unused-parameter -std=gnu99 -MD -MT CMakeFiles/ubusd_library.dir/ubusd_id.c.o -MF CMakeFiles/ubusd_library.dir/ubusd_id.c.o.d -o CMakeFiles/ubusd_library.dir/ubusd_id.c.o -c '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/ubus-2025.12.02~3cc98db1/ubusd_id.c'
FAILED: [code=1] CMakeFiles/ubusd_library.dir/ubusd_id.c.o
/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/bin/mipsel-openwrt-linux-musl-gcc -DUBUS_MAX_MSGLEN=1048576 -DUBUS_UNIX_SOCKET=\"/var/run/ubus/ubus.sock\"  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/ubus-2025.12.02~3cc98db1=ubus-2025.12.02~3cc98db1 -mips16 -minterlink-mips16 -flto=auto -fno-fat-lto-objects -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include  -I/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/usr/include -I/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include -I/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify -DNDEBUG -Wall -Werror -Wextra -Wformat -Werror=format-security -Werror=format-nonliteral -Werror=implicit-function-declaration -Os -g3 -Wmissing-declarations -Wno-unused-parameter -std=gnu99 -MD -MT CMakeFiles/ubusd_library.dir/ubusd_id.c.o -MF CMakeFiles/ubusd_library.dir/ubusd_id.c.o.d -o CMakeFiles/ubusd_library.dir/ubusd_id.c.o -c '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/ubus-2025.12.02~3cc98db1/ubusd_id.c'
In file included from /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/ubus-2025.12.02~3cc98db1/ubusd_id.c:14:
/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify/stdio.h: In function 'snprintf':
/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify/stdio.h:101:9: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  101 |         return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack());
      |         ^~~~~~
/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify/stdio.h: In function 'sprintf':
/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify/stdio.h:110:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  110 |                 __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack());
      |                 ^~~
/home/salman/work/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-14.3.0_musl/include/fortify/stdio.h:114:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  114 |                 __r = __orig_sprintf(__s, __f, __builtin_va_arg_pack());
      |                 ^~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.
make[3]: *** [Makefile:83: /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/ubus-2025.12.02~3cc98db1/.built] Error 1
make[3]: Leaving directory '/home/salman/work/openwrt/package/system/ubus'
time: package/system/ubus/compile#1.17#0.45#1.84
    ERROR: package/system/ubus failed to build.
make[2]: *** [package/Makefile:188: package/system/ubus/compile] Error 1
make[2]: Leaving directory '/home/salman/work/openwrt'
make[1]: *** [package/Makefile:182: /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/salman/work/openwrt'
make: *** [/home/salman/work/openwrt/include/toplevel.mk:233: world] Error 2

Any help would be appreciated!
Thanks

make clean
scripts/feeds update -a
scripts/feeds install -a

make menuconfig
...
make -j $(nproc) V=s

cleaning and rebuilding didn't worked,

OpenWrt-libtool: install: /home/salman/work/openwrt/staging_dir/host/bin/install -c .libs/libfts.lai /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/libfts.la
OpenWrt-libtool: install: /home/salman/work/openwrt/staging_dir/host/bin/install -c .libs/libfts.a /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/libfts.a
OpenWrt-libtool: install: chmod 644 /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/libfts.a
OpenWrt-libtool: install: mipsel-openwrt-linux-musl-gcc-ranlib /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/libfts.a
libtool: warning: remember to run 'libtool --finish /usr/lib'
 /usr/bin/mkdir -p '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/include'
 /home/salman/work/openwrt/staging_dir/host/bin/install -c -m 644 fts.h '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/include'
 /usr/bin/mkdir -p '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/pkgconfig'
 /home/salman/work/openwrt/staging_dir/host/bin/install -c -m 644 musl-fts.pc '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/pkgconfig'
make[5]: Leaving directory '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7'
make[4]: Leaving directory '/home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7'
touch /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/.built
rm -rf /home/salman/work/openwrt/tmp/stage-musl-fts
mkdir -p /home/salman/work/openwrt/tmp/stage-musl-fts/host /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/packages
install -d -m0755 /home/salman/work/openwrt/tmp/stage-musl-fts/usr/include
cp -fpR /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/include/fts.h /home/salman/work/openwrt/tmp/stage-musl-fts/usr/include/
install -d -m0755 /home/salman/work/openwrt/tmp/stage-musl-fts/usr/lib/pkgconfig
cp -fpR /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/libfts.so* /home/salman/work/openwrt/tmp/stage-musl-fts/usr/lib/
cp -fpR /home/salman/work/openwrt/build_dir/target-mipsel_24kc_musl/musl-fts-1.2.7/ipkg-install/usr/lib/pkgconfig/musl-fts.pc /home/salman/work/openwrt/tmp/stage-musl-fts/usr/lib/pkgconfig/
find /home/salman/work/openwrt/tmp/stage-musl-fts -name '*.la' | xargs -r rm -f;
if [ -f /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/packages/musl-fts.list ]; then /home/salman/work/openwrt/scripts/clean-package.sh "/home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/packages/musl-fts.list" "/home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl"; fi
if [ -d /home/salman/work/openwrt/tmp/stage-musl-fts ]; then (cd /home/salman/work/openwrt/tmp/stage-musl-fts; find ./ > /home/salman/work/openwrt/tmp/stage-musl-fts.files);   SHELL= flock /home/salman/work/openwrt/tmp/.staging-dir.flock -c ' mv /home/salman/work/openwrt/tmp/stage-musl-fts.files /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/packages/musl-fts.list && cp -fpR /home/salman/work/openwrt/tmp/stage-musl-fts/* /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/; '; fi
rm -rf /home/salman/work/openwrt/tmp/stage-musl-fts
touch /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.musl-fts_installed
make[3]: Leaving directory '/home/salman/work/openwrt/package/libs/musl-fts'
time: package/libs/musl-fts/compile#57.13#2.50#74.10
make[2]: Leaving directory '/home/salman/work/openwrt'
make[1]: *** [package/Makefile:182: /home/salman/work/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/salman/work/openwrt'
make: *** [/home/salman/work/openwrt/include/toplevel.mk:233: world] Error 2

you may need to nuke it and rebuild tool-chain. The has been many changes in the tools lately so you toolchain is likely outdated.

you'll have to use one of the nuclear option

  1. make clean (Standard Clean)
  • Action: Deletes the contents of the bin/ and build_dir/ directories.
  • Usage: Best practice to run this before a new build to ensure no old artifacts interfere with the new one.
  • Scope: Does not remove the toolchain or cross-compiler, keeping subsequent builds faster.
  1. make dirclean (Full Clean)
  • Action: Performs a "full clean" operation. It removes bin/, build_dir/, staging_dir/ (tools/toolchain), tmp/, and logs/.
  • Usage: Used when you want to ensure a completely fresh start, particularly when changing targets or after major updates.
  1. make distclean (Deep Clean)
  • Action: Removes absolutely everything that was built, including all configured feeds and external packages.
  • Usage: Used to revert the build directory to its initial state.

Sounds like trouble with fortify-headers component of toolchain.
Recently patched to get over it.

You need to rebuild the whole toolchain.
Do either "make targetclean" or "make dirclean"

https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem#cleaning_up

3 Likes

-j something is wrong advice for debugging, as the log items from various concurrent package compilations get mixed, and the actual error log items may not be at the end.
Either with -j 1 or without anything , which also means single-threaded compilation

that would be appropriate now ... that the standard clean did not solve it. I don't know about you, but i have better things to do then sit and wait on a build -j1 to fail just to find out the the standard clean did not solve it

so this technically would've been bad advice at the time of the post..

I also recently had the fortify problem mentioned by @hnyman

Had to nuke everything and rebuild all

Thank You!, the issue got fixed.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.