0

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. 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....). When I installed the cross compiler I also got compiler errors so I "fixed" the src and used the recommended changes by the compiler. Do I have to also do that here (I feel like I shouldn't get an error...). Idk pl help me thx.

1 Answers1

0

Maybe configure isn't pickup on the right compiler as I think it got HAVE_SYS_ERRLIST incorrect.

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)?

Mikey
  • 167
  • 4
  • I ran ./configure with CC/LD/OBJCOPY set. But the ./configure --help didn't say anything on how to use a different compiler (unlike in the newer versions) I just assumed I would work the same.... I could try to edit the make / config files to use the other compiler if cross compiling isn't supported like that. – user1237916231 Aug 22 '22 at 09:08