gdb 6.8 build errors in Solaris 5.8

Klaus Zeitler
2008-10-16T12:20:40Z

While producing gdb 6.8 for Solaris 5.8 I ran into 2 problems:

1. In /vol/freeware/SunOS-5.8/build/gdb-6.8/etc

looking for a compliant stdint.h in stdint.h, checking for uintmax_t... no
looking for a compliant stdint.h in inttypes.h, checking for uintmax_t... yes
checking for uintptr_t... yes
checking for int_least32_t... yes
checking for int_fast32_t... no
checking for uint64_t... yes
checking what to include in gstdint.h... inttypes.h (mostly complete)
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking for int... yes
checking size of int... 4
checking for long... yes
checking size of long... 4
checking for ANSI C header files... (cached) yes
checking build system type... sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8
checking target system type... sparc-sun-solaris2.8
checking for decimal floating point... dpd
checking whether byte ordering is bigendian... yes
updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing gstdint.h commands
make[2]: Entering directory `/vol/freeware/SunOS-5.8/build/gdb-6.8/libdecnumber'
source='/vol/freeware/source/gdb-6.8/libdecnumber/decNumber.c' object='decNumber.o' libtool=no gcc -I/vol/freeware/source/gdb-6.8/libdecnumber -I. -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wcast-qual -pedantic -Wno-long-long -I/vol/freeware/source/gdb-6.8/libdecnumber -I. -c /vol/freeware/source/gdb-6.8/libdecnumber/decNumber.c
In file included from /vol/freeware/source/gdb-6.8/libdecnumber/decContext.h:59,
from /vol/freeware/source/gdb-6.8/libdecnumber/decNumber.h:42,
from /vol/freeware/source/gdb-6.8/libdecnumber/decNumber.c:174:
/vol/freeware/source/gdb-6.8/libdecnumber/gstdint.h:7:20: stdint.h: No such file or directory
make[2]: *** [decNumber.o] Error 1
make[2]: Leaving directory `/vol/freeware/SunOS-5.8/build/gdb-6.8/libdecnumber'
make[1]: *** [all-libdecnumber] Error 2
make[1]: Leaving directory `/vol/freeware/SunOS-5.8/build/gdb-6.8'
make: *** [all] Error 2
ERROR: gdb: make

2.

gcc -c -g -O2 -I. -I/vol/freeware/source/gdb-6.8/gdb -I/vol/freeware/source/gdb-6.8/gdb/config -DLOCALEDIR="\"/vol/freeware/SunOS-5.8/gdb/6.8/share/locale\"" -DHAVE_CONFIG_H -I/vol/freeware/source/gdb-6.8/gdb/../include/opcode -I/vol/freeware/source/gdb-6.8/gdb/../readline/.. -I../bfd -I/vol/freeware/source/gdb-6.8/gdb/../bfd -I/vol/freeware/source/gdb-6.8/gdb/../include -I../libdecnumber -I/vol/freeware/source/gdb-6.8/gdb/../libdecnumber -DMI_OUT=1 -Wall -Wpointer-arith -Wformat-nonliteral -Wno-unused -Wno-switch -Wno-char-subscripts -Werror /vol/freeware/source/gdb-6.8/gdb/remote.c
/vol/freeware/source/gdb-6.8/gdb/remote.c: In function `extended_remote_attach_1':
/vol/freeware/source/gdb-6.8/gdb/remote.c:2859: warning: unsigned int format, pid_t arg (arg 3)
make[2]: *** [remote.o] Error 1
make[2]: Leaving directory `/vol/freeware/SunOS-5.8/build/gdb-6.8/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/vol/freeware/SunOS-5.8/build/gdb-6.8'
make: *** [all] Error 2
ERROR: gdb: make

I could resolve those two problems easily.
The first one by replacing stdint.h with inttypes.h in gstdint.h.
The 2nd one by replacing
sprintf (rs->buf, "vAttach;%x", pid);
with
sprintf (rs->buf, "vAttach;%x", (unsigned int)pid);
in file remote.c

Are these known problems or should I file a bug report?

Klaus

--
--------------------------------------------------
| Klaus Zeitler Alcatel-Lucent |
| Email: kzeitler@alcatel-lucent.com |
--------------------------------------------------
---
Microsoft is not the answer. Microsoft is a question, and the answer
is Linux, the choice of the GNU (http://www.gnu.org) generation.