PowerPC Disassembler Fails to Compile on CentOS 7

Joel Sherrill joel@rtems.org
Thu May 6 15:24:38 GMT 2021


Thanks. I guess the next bump in our bleeding edge tools will catch this
fix.

On Thu, May 6, 2021, 10:19 AM H.J. Lu <hjl.tools@gmail.com> wrote:

> On Thu, May 6, 2021 at 8:14 AM Joel Sherrill <joel@rtems.org> wrote:
> >
> > Hi
> >
> > binutils hash ed29efb which should be near the head appears to be
> assuming
> > that a newer GCC is being used which defaults to something else. The host
> > GCC reports:
> >
> > gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
> >
> > And the compilation fails with this:
> >
> > libtool: compile:  gcc -O2 -g -pipe
> >
> -I/home/joel/rtems-cron-7/rtems-source-builder/rtems/build/tmp/sb-1001/7/rtems-powerpc/home/joel/rtems-cron-7/tools/7/include
> > -DHAVE_CONFIG_H -I.
> -I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes
> > -I. -I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes -I../bfd
> > -I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/../include
> > -I../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/../bfd -W -Wall
> > -Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT ppc-opc.lo
> -MD
> > -MP -MF .deps/ppc-opc.Tpo -c
> > ../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-opc.c -o
> ppc-opc.o
> > mv -f .deps/disassemble.Tpo .deps/disassemble.Plo
> > ../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-dis.c: In
> function
> > 'print_insn_powerpc':
> > mv -f .deps/dis-buf.Tpo .deps/dis-buf.Plo
> > ../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-dis.c:1071:8:
> > error: 'for' loop initial declarations are only allowed in C99 mode
> >         for (int i = 0; i < 2; i++)
> >         ^
> > ../../sourceware-mirror-binutils-gdb-ed29efb/opcodes/ppc-dis.c:1071:8:
> > note: use option -std=c99 or -std=gnu99 to compile your code
> >
> > Should the code not declare i in the for loop of the compiler arguments
> add
> > C99?
> >
> > --joel
>
> Should be fixed by:
>
> commit a8d6316b67d52eaa1b7b311084ddff71a66f7cc0
> Author: Nick Clifton <nickc@redhat.com>
> Date:   Tue May 4 13:40:34 2021 +0100
>
>     Replace AC_PROG_CC with AC_PROG_CC_C99 in top level configure file.
>
>     2021-05-04  Nick Clifton  <nickc@redhat.com>
>
>             * configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99.
>             * configure: Regenerate.
>
> --
> H.J.
>


More information about the Binutils mailing list