Cscope build fails with error message "could not read symbols: File in wrong format"

thinke365 picture thinke365 · Sep 10, 2012 · Viewed 26.4k times · Source

I am cross-compiling cscope, but suprised to be failed. However, I succeed to build ctags without error, so why does the cscope build fail?

The error message is as follows:

`sh  cflags "optimize='-O2'" doop.o`  doop.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" doio.o`  doio.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" regexec.o`  regexec.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" utf8.o`  utf8.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" taint.o`  taint.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" deb.o`  deb.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" universal.o`  universal.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" xsutils.o`  xsutils.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
`sh  cflags "optimize='-O2'" generate_uudmap.o`  generate_uudmap.c
          CCCMD =  cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
mips-openwrt-linux-uclibc-gcc -o generate_uudmap -L/usr/local/lib generate_uudmap.o -lnsl -ldl -lm -lcrypt -lutil -lc 
/home/mirror0/sdk/sdk/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/bin/ld: generate_uudmap.o: Relocations in generic ELF (EM: 62)
/home/mirror0/sdk/sdk/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/bin/ld: generate_uudmap.o: Relocations in generic ELF (EM: 62)
generate_uudmap.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[4]: *** [generate_uudmap] Error 1
make[4]: Leaving directory `/home/mirror0/sdk/sdk/build_dir/target-mips_uClibc-0.9.30.1/perl'
make[3]: *** [/home/mirror0/sdk/sdk/build_dir/target-mips_uClibc-0.9.30.1/perl/.built] Error 2
make[3]: Leaving directory `/home/mirror0/sdk/sdk/package/perl'
make[2]: *** [package/perl/compile] Error 2
make[2]: Leaving directory `/home/mirror0/sdk/sdk'
make[1]: *** [/home/mirror0/sdk/sdk/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/mirror0/sdk/sdk'
make: *** [world] Error 2

real    0m51.846s
user    1m27.489s
sys     0m38.462s

Answer

jhonkola picture jhonkola · Sep 12, 2012

This could possibly be caused with old object files (for different target) from previous compilation. Try running make clean or equivalent for the package and try compiling again.