Bug #12645
closedext/socket fails to link on some Solaris 10 versions
Description
The socket extension in core Ruby does not link due to a missing inet_ntop
, which was added during the Solaris 10 series (10u7, I believe).
This patch gets it compiling again by creating a static inet_ntop (same as in getaddrbyname.c) on systems that do not have it. This definitely happens on 2.3.1 and definitely does not happen on 2.1.9. Not sure about 2.2.
Files
Updated by normalperson (Eric Wong) over 7 years ago
john@johnkeiser.com wrote:
The socket extension in core Ruby does not link due to a
missinginet_ntop
, which was added during the Solaris 10
series (10u7, I believe).This patch gets it compiling again by creating a static
inet_ntop (same as in getaddrbyname.c) on systems that do not
have it. This definitely happens on 2.3.1 and definitely does
not happen on 2.1.9. Not sure about 2.2.
That suggests we have a bug in the build system about detecting
and setting the correct flags for linkage and headers.
It's been many years since I touched Solaris, but I'm fairly
sure the function existed in 8, even if it's a different
signature as gnulib docs indicates:
https://bogomips.org/mirrors/gnulib.git/plain/doc/posix-functions/inet_ntop.texi
Updated by nobu (Nobuyoshi Nakada) over 7 years ago
- Status changed from Open to Feedback
Please show the mkmf.log file.
Updated by ngoto (Naohisa Goto) over 7 years ago
That suggests we have a bug in the build system about detecting
and setting the correct flags for linkage and headers.
Not build system, but code itself. In ancdata.c, inet_ntop() is used without checking HAVE_INET_NTOP.
This might occur on every OS whose HAVE_INET_NTOP is 0.
The patch may work, but I think having the same code in two files is not good idea.
Updated by ngoto (Naohisa Goto) over 7 years ago
- Status changed from Feedback to Open
Updated by nobu (Nobuyoshi Nakada) over 7 years ago
Does removing static
from inet_ntop
in option.c work?
Updated by nobu (Nobuyoshi Nakada) over 7 years ago
- Status changed from Open to Closed
Applied in changeset r55797.
socket/option.c: inet_ntop
- ext/socket/option.c, ext/socket/rubysocket.h (inet_ntop): share
the fallback definition. [ruby-core:76646] [Bug #12645]
Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago
- Backport set to 2.1: DONTNEED, 2.2: UNKNOWN, 2.3: REQUIRED
Updated by usa (Usaku NAKAMURA) over 7 years ago
- Backport changed from 2.1: DONTNEED, 2.2: UNKNOWN, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: REQUIRED, 2.3: REQUIRED
Updated by usa (Usaku NAKAMURA) over 7 years ago
- Backport changed from 2.1: DONTNEED, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: DONE, 2.3: REQUIRED
ruby_2_2 r55926 merged revision(s) 55797.
Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago
- Backport changed from 2.1: DONTNEED, 2.2: DONE, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: DONE, 2.3: DONE
ruby_2_3 r55960 merged revision(s) 55797.