Bug #1794

libxnet is missing a filter on __xnet_getaddrinfo

Added by Rich Lowe over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2011-11-18
Priority:Normal Due date:
Assignee:Rich Lowe % Done:

100%

Category:lib - userland libraries Spent time: -
Target version:-
Difficulty:Medium Tags:

Description

Our headers do magic with getaddrinfo() as compared to __xnet_getaddrinfo() for standards reasons.

With GCC 4.6 (but not 4.4, 3.4), this causes link failures in previously working code which linked to libxnet but not libsocket (where __xnet_getaddrinfo actually resides).

See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51204

We need a filter entry in libxnet pointing __xnet_getaddrinfo to libsocket, as with the other entries.

Versioning of this is complicated by the desire for compatibility. It probably should be in 1.3 --> [add: 1.3.1 with libxnet] --> 1.4, which would be strictly compatible for all concerned.

History

Updated by Rich Lowe over 2 years ago

Workaround, of course, is to explicitly link to libsocket.

Fix might be to link libxnet to libsocket explicitly

Updated by Rich Lowe over 2 years ago

  • Assignee set to Rich Lowe

Updated by Rich Lowe over 2 years ago

This is a missing filter in libxnet on libsocket (which in retrospect, should have been obvious).

Updated by Rich Lowe over 2 years ago

  • Subject changed from something about our netdb header angers GCC4.6 to libxnet is missing a filter on __xnet_getaddrinfo

Updated by Rich Lowe over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
  • Tags deleted (needs-triage)

Updated by Rich Lowe over 2 years ago

  • % Done changed from 50 to 70

While the bug as-filed requires a very recent GCC and C++ to test, the actual change involved appears to be that the compilation is happening in an XPG6 environment. This can be reproduced using the normal 3.4 version of GCC, using the user-provided test case:

       #include <sys/socket.h>
       #include <netdb.h>

       // Compile with:
       //   g++ SolarisG++4.6.2-lxnet.c++  -lxnet
       // where g++ is 4.6.2 on OpenIndiana

       int main( int argc, char *argv[] )
       {
         // This is meant to compile, not run.
         getaddrinfo( 0, 0, 0, 0 );
         return 0;
       }

Instead of as there, compile with

gcc -std=c99 -lxnet -D_XOPEN_SOURCE=600 test.c

This will fail on an un-fixed system

Updated by Rich Lowe over 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 70 to 100

Resolved in r13526 5a529e25e724

Also available in: Atom PDF