This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] GDB64 ppc64 compile error patch


This patch fixes compile error when gdb is built as a 64bit binary on a
PPC64 platform. ELF_NGREG  ELF_NFPREG and ELF_NVRREG are members of an
enum, but they are also defined in a headerfile, so compiler issues error.

gcc -c -m64  -mminimal-toc  -I. -I. -I./config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I./../include/opcode -I./../readline/.. -I../bfd -I./../bfd
-I./../include -I../intl -I./../intl  -DMI_OUT=1 -Wimplicit -Wreturn-type
-Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith
-Wuninitialized -Wformat-nonliteral -Wunused-label -Wunused-function
ppc-linux-tdep.c
cc1: warning: -Wuninitialized is not supported without -O
ppc-linux-tdep.c:956: error: parse error before numeric constant
make[1]: *** [ppc-linux-tdep.o] Error 1
make[1]: Leaving directory `/root/manjo/April07/xxx/new/src/gdb'
make: *** [all-gdb] Error 2

This is because ELF_NGREG  ELF_NFPREG and ELF_NVRREG are defined in header
files

/usr/include/sys/procfs.h:#define ELF_NFPREG      33      /* includes
fpscr */
/usr/include/sys/procfs.h:typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
/usr/include/asm-ppc/elf.h:#define ELF_NFPREG   33      /* includes fpscr
*/
/usr/include/asm-ppc/elf.h:typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
/usr/include/asm-ppc64/elf.h:#define ELF_NFPREG 33      /* includes fpscr
*/
/usr/include/asm-ppc64/elf.h:typedef elf_fpreg_t
elf_fpregset_t[ELF_NFPREG];

and the enum

enum {
   ELF_NGREG = 48,
   ELF_NFPREG = 33,
   ELF_NVRREG = 33
 };

causes the compiler to interpret ELF_NFPREG = 33, as 33 = 33, etc.

The patch attached fixes this error.

Thanks
Manoj Iyer

Attachment: gdb64_6.1_ppc64.patch
Description: GDB64 PPC64 patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]