简体   繁体   English

为 ppc 交叉编译 gnu binutils 2.7 时出现编译器错误

[英]Compiler error while cross compiling gnu binutils 2.7 for ppc

This is the Error I get:这是我得到的错误:

/usr/bin/powerpc-linux-gnu-gcc -c -DDEFAULT_VECTOR=bfd_elf32_powerpc_vec -DSELECT_VECS='&bfd_elf32_powerpc_vec,&rs6000coff_vec,&bfd_elf32_powerpcle_vec,&bfd_powerpcle_pei_vec,&bfd_powerpc_pei_vec,&bfd_powerpcle_pe_vec,&bfd_powerpc_pe_vec,&ppcboot_vec' -DSELECT_ARCHITECTURES='&bfd_rs6000_arch,&bfd_powerpc_arch' -I. -I../../bfd -I../../bfd/../include  -g ../../bfd/targets.c
/usr/bin/powerpc-linux-gnu-gcc -c -g -I. -I../../libiberty/../include  ../../libiberty/strerror.c
/usr/bin/powerpc-linux-gnu-gcc -c -g -I. -I../../libiberty/../include  ../../libiberty/strsignal.c
../../libiberty/strerror.c:458:12: error: static declaration of 'sys_nerr' follows non-static declaration
  458 | static int sys_nerr;
      |            ^~~~~~~~
In file included from /usr/powerpc-linux-gnu/include/stdio.h:781,
                 from ../../libiberty/strerror.c:19:
/usr/powerpc-linux-gnu/include/bits/sys_errlist.h:26:12: note: previous declaration of 'sys_nerr' was here
   26 | extern int sys_nerr;
      |            ^~~~~~~~
../../libiberty/strerror.c:459:21: error: conflicting types for 'sys_errlist'
  459 | static const char **sys_errlist;
      |                     ^~~~~~~~~~~
In file included from /usr/powerpc-linux-gnu/include/stdio.h:781,
                 from ../../libiberty/strerror.c:19:
/usr/powerpc-linux-gnu/include/bits/sys_errlist.h:27:26: note: previous declaration of 'sys_errlist' was here
   27 | extern const char *const sys_errlist[];
      |                          ^~~~~~~~~~~
../../libiberty/strerror.c: In function 'strtoerrno':
../../libiberty/strerror.c:772:9: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
  772 |        (strcmp (name, error_names[errnoval]) == 0))
      |         ^~~~~~
make[1]: *** [Makefile:153: strerror.o] Error 1
make[1]: *** Waiting for unfinished jobs.... 

I used我用了

../configure --host=powerpc-*-linux --prefix=~/Downloads/build/binutils-2.7/build/bin

and

export CC="/usr/bin/powerpc-linux-gnu-gcc"
export LD="/usr/bin/powerpc-linux-gnu-ld"
export OBJCOPY="/usr/bin/powerpc-linux-gnu-objcopy"

Is it a configuration issue do I have to add vars like $CC.是否是配置问题,我必须添加 $CC 之类的变量吗? I could also be a problem that my cross compiler(/usr/bin/powerpc-linux-gnu-gcc) is version 9.1.0 and I'm compiling an older version (can't go higher or I would need to also compile gnu glibc....).我的交叉编译器(/usr/bin/powerpc-linux-gnu-gcc)是 9.1.0 版本并且我正在编译旧版本(不能 go 更高或者我还需要编译gnu glibc ....)。 When I installed the cross compiler I also got compiler errors so I "fixed" the src and used the recommended changes by the compiler.当我安装交叉编译器时,我也遇到了编译器错误,所以我“修复”了 src 并使用了编译器推荐的更改。 Do I have to also do that here (I feel like I shouldn't get an error...).我是否也必须在这里这样做(我觉得我不应该出错......)。 Idk pl help me thx. Idk pl帮助我谢谢。

Maybe configure isn't pickup on the right compiler as I think it got HAVE_SYS_ERRLIST incorrect.也许 configure 没有在正确的编译器上使用,因为我认为它的 HAVE_SYS_ERRLIST 不正确。

It looks like it has HAVE_SYS_ERRLIST your libc but maybe./configure didn't find it because it's using a different compiler (since you later change the compiler using export CC/LD/OBJCOPY)?看起来它有你的 libc 的 HAVE_SYS_ERRLIST 但也许 ./configure 没有找到它,因为它使用了不同的编译器(因为你后来使用 export CC/LD/OBJCOPY 更改了编译器)?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM