From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>, "'Tom Tromey'" <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [PATCH v3 10/13] don't check for unistd.h
Date: Wed, 20 Nov 2013 12:16:00 -0000 [thread overview]
Message-ID: <006701cee5e2$972ad7a0$c58086e0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <83fvqrg2gn.fsf@gnu.org>
Hi all,
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé : mercredi 20 novembre 2013 01:46
> À : Tom Tromey
> Cc : pierre.muller@ics-cnrs.unistra.fr; gdb-patches@sourceware.org
> Objet : Re: [PATCH v3 10/13] don't check for unistd.h
>
> > From: Tom Tromey <tromey@redhat.com>
> > Cc: <gdb-patches@sourceware.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.
Pierre
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
ws2_32.dll
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
test...
next prev parent reply other threads:[~2013-11-20 11:21 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 20:27 [PATCH v3 00/13] use gnulib more heavily Tom Tromey
2013-11-18 20:26 ` [PATCH v3 02/13] change how list of modules is computed Tom Tromey
2013-11-18 20:26 ` [PATCH v3 01/13] link gdbreplay against gnulib Tom Tromey
2013-11-18 20:27 ` [PATCH v3 03/13] import strstr and strerror modules Tom Tromey
2013-11-18 20:27 ` [PATCH v3 07/13] remove gdb_dirent.h Tom Tromey
2013-11-18 20:37 ` [PATCH v3 12/13] import gnulib sys/stat.h module Tom Tromey
2013-11-18 20:37 ` [PATCH v3 11/13] sys/types.h cleanup Tom Tromey
2013-11-18 20:39 ` [PATCH v3 08/13] don't check for stddef.h Tom Tromey
2013-11-18 20:46 ` [PATCH v3 04/13] remove gdb_string.h Tom Tromey
2013-11-18 20:46 ` [PATCH v3 09/13] stdlib.h is universal too Tom Tromey
2013-11-18 20:46 ` [PATCH v3 10/13] don't check for unistd.h Tom Tromey
2013-11-19 20:59 ` Pierre Muller
[not found] ` <"00ee01cee569$bcb52d00$361f8700$@muller"@ics-cnrs.unistra.fr>
2013-11-19 21:27 ` Eli Zaretskii
[not found] ` <13494.0459196971$1384894582@news.gmane.org>
2013-11-19 21:58 ` Tom Tromey
2013-11-19 23:43 ` Tom Tromey
2013-11-20 2:42 ` Joel Brobecker
2013-11-20 3:47 ` Eli Zaretskii
2013-11-20 12:16 ` Pierre Muller [this message]
2013-11-20 15:54 ` Tom Tromey
2013-11-20 18:03 ` Eli Zaretskii
2013-11-20 18:57 ` Joel Brobecker
2013-11-18 21:12 ` [PATCH v3 06/13] import gnulib dirent module Tom Tromey
2013-11-18 21:28 ` [PATCH v3 05/13] don't check for string.h or strings.h Tom Tromey
2013-11-18 23:03 ` [PATCH v3 13/13] remove gdb_stat.h Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='006701cee5e2$972ad7a0$c58086e0$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox