This is the mail archive of the
mailing list for the GDB project.
RE: [PATCH v3 10/13] don't check for unistd.h
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Eli Zaretskii'" <eliz at gnu dot org>, "'Tom Tromey'" <tromey at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 20 Nov 2013 09:20:51 -0200
- Subject: RE: [PATCH v3 10/13] don't check for unistd.h
- Authentication-results: sourceware.org; auth=none
- References: <1384806318-12231-1-git-send-email-tromey at redhat dot com> <1384806318-12231-11-git-send-email-tromey at redhat dot com> <13494 dot 0459196971$1384894582 at news dot gmane dot org> <877gc4ksnz dot fsf at fleche dot redhat dot com> <8738mskqam dot fsf at fleche dot redhat dot com> <83fvqrg2gn dot fsf at gnu dot org>
> -----Message d'origine-----
> De : email@example.com [mailto:gdb-patches-
> firstname.lastname@example.org] De la part de Eli Zaretskii
> Envoyé : mercredi 20 novembre 2013 01:46
> À : Tom Tromey
> Cc : email@example.com; firstname.lastname@example.org
> Objet : Re: [PATCH v3 10/13] don't check for unistd.h
> > From: Tom Tromey <email@example.com>
> > Cc: <firstname.lastname@example.org>
> > Date: Tue, 19 Nov 2013 14:57:53 -0700
> > Pierre> How could this problem be solved?
> > Tom> I'll send you a patch to try shortly.
> > Well, so I thought. It turned into an insane nightmare. The unistd
> > module pulls <winnt.h> into everything, which stomps all over our
> > namespace.
> > I'm probably going to revert the whole series tomorrow morning.
> Perhaps we could still leave it, and overcome the gethostname problem
> on our own.
> Pierre, can you see if 'configure' detects the presence of gethostname
> when it probes the system? If not, that might be the problem, and I
> might have a trick to overcome it.
I checked the config files in the gdb build directory.
Indeed, there is a check for gethostbyname, but not for gethostname.
But there is no line associated with this in
the generated build dir gdb/config.h.
When I looked into source gdb/configure.ac,
I only found AC_SEARCH_LIBS(gethostbyname, nsl)
with a comment talking about Solaris system.
But there is nothing about gethostname.
Like Eli suggests,
maybe adding a check for existence of this function
and disabling the call if it is not found would be enough indeed.
I also suppose that
I am too weak on autoconf and the like to
try this myself, but could easily test a patch...
Adding #ifdef HAVE_GETHOSTNAME
around the call to gethostname function in m32r-rom.c source of course
solves the linking problem.
PS: I tried to compile a simple source with a call to gethostname,
the problem is that the functions are both defined
but in winsock.h or winsock2.h and the seem to link to
Thus, without adding this DLL to the test, the check will not work.
This is already done in configure.ac around line 1907,
so that the checks for gethostname and gethostbyname
need to be done after this, no?
I have no clue about how to add the winsock or winsock2 header in the