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
jhonkola
  • 3,385
  • 1
  • 17
  • 32
thinke365
  • 1,305
  • 3
  • 14
  • 22

1 Answers1

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.

jhonkola
  • 3,385
  • 1
  • 17
  • 32
  • it's not the problem of make clean, why could not read symbols: File in wrong format? – thinke365 Sep 14 '12 at 19:25
  • @thinke365 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. – jhonkola Sep 15 '12 at 12:57
  • 1
    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... – Begui Apr 01 '14 at 12:25
  • 3
    what was not set correctly in your environment, what caused the problem? – Black Aug 25 '15 at 14:19