This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: patch for compilers that don't define "unix"
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: patch for compilers that don't define "unix"
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Fri, 19 Jan 2001 12:19:58 -0500
- CC: matthew green <mrg at cygnus dot com>, Fernando Nasser <fnasser at redhat dot com>, gdb-patches at sources dot redhat dot com
- Organization: Red Hat , Inc. - Toronto
- References: <8062.979583347@cygnus.com> <3A671A63.68AD4A22@cygnus.com>
Andrew Cagney wrote:
>
> matthew green wrote:
> >
> >
> > This is not the proper fix though. The rdi-share subdirectory is supposed to
> > contain code shared with ARM, so we shouldn't make local modifications in there
> > (unless absolutely necessary).
> >
> > how about this then? tested on netbsd/i386 and solaris 2.6. you'll need to
> > regenerate `configure' after applying this patch.
> >
> > thanks.
> >
> > 2001-01-15 matthew green <mrg@redhat.com>
> >
> > * configure.in: Define missing `__unix' if `__unix__' is present.
> > * configure: Regenerate.
>
> I think this is wrong (I actually prefered the original patch).
> GDB's build process should not be defining symbols that polute the
> system name space (anything with a leading double ``__'').
>
FYI, the original patch did the same thing: defined the same symbol, just
in a more restricted scope. So your argument would apply to it as well.
But you misunderstood Matthew's intention. He is not inventing a new symbol.
He is defining a symbol that newer versions of netbsd do not define any longer.
The naming at least is correct. He is defining exactly the same symbol that
used to be defined by previous versions and it is a system symbol, that
belongs in the system space, with a leading "__".
Anyway, I will work with Matthew to keep the change restricted to the
rdi-share subdirectory so we leave gdb/configure.in alone.
> enjoy,
> Andrew
>
> > Index: configure.in
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/configure.in,v
> > retrieving revision 1.53
> > diff -p -r1.53 configure.in
> > *** configure.in 2000/12/21 16:16:17 1.53
> > --- configure.in 2001/01/15 18:21:54
> > *************** if test x${want_included_regex} = xtrue;
> > *** 703,708 ****
> > --- 703,718 ----
> > AC_DEFINE(USE_INCLUDED_REGEX)
> > fi
> > AC_SUBST(REGEX)
> > +
> > + # NetBSD compiler defines __unix__ only; rdi-share needs __unix.
> > + AC_CACHE_CHECK([for NetBSD [__unix__]], gdb_cv_missing_netbsd___unix,
> > + [AC_EGREP_CPP(lose, [
> > + #if defined (__unix__) || !defined (__unix)
> > + lose
> > + #endif],[gdb_cv_missing_netbsd___unix=yes],[gdb_cv_missing_netbsd___unix=no])])
> > + if test x$gdb_cv_missing_netbsd___unix = xyes; then
> > + CFLAGS="$CFLAGS -D__unix"
> > + fi
> >
> > # In the Cygwin environment, we need some additional flags.
> > AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9