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

1

6

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
Kaz answered 10/9, 2012 at 4:52 Comment(1)
I think it's related to NASM. you can try to switch 64bit options.Potassium
A
8

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.

Anecdotal answered 12/9, 2012 at 7:10 Comment(4)
it's not the problem of make clean, why could not read symbols: File in wrong format?Kaz
@Kaz I encountered the same error when I had .o files compiled for different target in the package directory. make clean should remove these and thus might help.Anecdotal
A make clean wasn't enough, I had initially set up my environment wrong. Once I fixed that, removed all the generated config/build file, reran the config with the correct toolchain(host, etc).. worked like a charm...Ballad
what was not set correctly in your environment, what caused the problem?Putupon

© 2022 - 2024 — McMap. All rights reserved.