Subject: Some problems compiling libg++-2.6.2 on NetBSD1.0 i486
To: None <, current-users@NetBSD.ORG>
From: Douglas Thomas Crosher <>
List: current-users
Date: 03/03/1995 02:32:09
Some problems with the compilation of libg++-2.6.2 with gcc-2.6.3 on
NetBSD1.0 i486 are described blow. Some hacks are described.

The script libio/gen_params generates some incorrect values in the
file libio/_G_config.h :

	The script seems to assume the system defines uint16_t,
uint32_t and uint64_t.  However NetBSD does not define these so the
script screws them up.  Those affected are:

	A.  _G_uint16_t		set to: unsigned
				should be: unsigned short

		( Note: This is causes errors compiling libg++/src/;
			It does not need to be patched and will compile
			and pass the test if this problem is fixed. )

	B. _G_uint32_t		set to: unsigned
				should be: unsigned int

	C. _G_uint64_t		set to: unsigned
				should be: unsigned long long

	The other major problem is that the typedef for _G_fpos_t is
defined in terms of quad_t early in _G_config.h; at this point quad_t
is not defined so the compilation breaks.  On NetBSD i486 a quad_t is
a long long; as a hack just replace quad_t with long long.

	Another small difference I noticed was in the definition
of _G_int8_t. Not sure if this is a real problem?

				set to: signed int
				perhaps it should be: __signed int

Hack to work around these problems:
Let libg++ compile until it generates the erroneous _G_config.h file,
then edit this file making the above changes and continue with the
compilation.  The corrected lines from _G_config.h are:

typedef long long _G_fpos_t;
typedef __signed  char _G_int8_t;
typedef unsigned short _G_uint16_t;
typedef unsigned int  _G_uint32_t;
typedef unsigned long long _G_uint64_t;

Information that may help produce a fixed gen-params.c

NetBSD defines  u_int16_t, u_int32_t, u_int64_t, and int8_t
in <machine/types>.

<sys/types.h> includes <machine/types.h>

<stdio.h>, <stdlib.h> and <unistd.h> include <sys/types.h>

Douglas Crosher