[Solved] Build error, ranlib

Hi,

Very odd, but trying to build openwrt-22.03 (though the same thing happens with master). I try to build, but get the error message,

make[5]: Entering directory '/mnt/ProgSSD/openwrt/build_dir/toolchain-mipsel_24kc_gcc-11.2.0_musl/gcc-11.2.0-initial/gcc'
g++ -no-pie   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o glibc-c.o \
  cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -L/mnt/ProgSSD/openwrt/staging_dir/host/lib -L/mnt/ProgSSD/openwrt/staging_dir/host/lib -L/mnt/ProgSSD/openwrt/staging_dir/host/lib -lmpc -lmpfr -lgmp -rdynamic  -L./../zlib -lz
/usr/bin/ld: libcommon.a: error adding symbols: archive has no index; run ranlib to add one
collect2: error: ld returned 1 exit status

Is this a known issue? Anyone else seen it before? I have done a lot of builds (not all that long ago), never saw this one :laughing:.

Thanks!

OK, found a fix - a bit time consuming, but it works :stuck_out_tongue_winking_eye:

make clean was not sufficient it seems => had to do a full make distclean. Then it builds cleanly.

Posting so others can avoid the same pain perhaps.

1 Like

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