octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51830] gethostname and uname nodename return


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51830] gethostname and uname nodename return "localhost"
Date: Wed, 30 Aug 2017 13:06:49 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #51830 (project octave):

                 Summary: uname nodename sometimes gives "localhost" instead
of pc name => gethostname and uname nodename return "localhost"

    _______________________________________________________

Follow-up Comment #20:

I just started a new mxe-octave build with stable-octave reverted to 4.2.0,
everything else current. The build log looks the same as 4.2.1 to me:


$ grep -i gethostname log/stable-octave
checking for gethostname... yes
checking whether gethostname is declared without a macro... no
      -e 's/@''GNULIB_GETHOSTNAME''@/1/g' \
      -e 's|@''HAVE_GETHOSTNAME''@|1|g' \


So I don't see the same 4.2.0 configuration as you saw in your log file. Could
this be due to some other change in mxe-octave, maybe the msys update or some
other core library updates?

Anyway, I think this hints that gethostname works when we use the gnulib
wrapper, but not when we don't. And maybe something has changed in the
cross-build environment so that the function is now detected as being present
and ok to use, but it still suffers from this bug of needing to call
WSAStartup before use.

If I understand the gnulib gethostname.m4 module correctly, they are testing
to see if gethostname exists with no extra libraries linked in, this is the
normal POSIX case. Then they are testing if gethostname exists after linking
with -lws2_32. If that's the case, then it uses the gnulib wrapper function to
initialize gethostname correctly.

The problem appears to be that all configure tests are being run with -lws2_32
added to the default set of libs. This tricks configure into thinking that
gethostname is a standard library function, no additional libs needed, and it
doesn't use the wrapper.

So how or why is -lws2_32 being added to the default LIBS variable in the
mxe-octave cross-build now, was that intentional, is there something we can do
in mxe-octave to undo that? If not, is there a way to improve the gnulib check
so that the wrapper is used when needed even if the default libs already
include -lws2_32?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51830>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]