finally got around to checking this
here is the first part of the sh/io.c _lib_getaddrinfo code
#if !_lib_getaddrinfo
#undef addrinfo
#undef getaddrinfo
#undef freeaddrinfo
#define addrinfo local_addrinfo
#define getaddrinfo local_getaddrinfo
#define freeaddrinfo local_freeaddrinfo
and static definitions for the local_* variants are provided
from that point on
struct addrinfo
getaddrinfo()
freeaddrinfo()
should refer to the local static variants
struct local_addrinfo
local_getaddrinfo()
local_freeaddrinfo()
can you snarf the cc -E output for sh/io.c to see
how the local_* variants were circumvented?
On Wed, 19 Dec 2007 13:43:49 -0500 Ron Isaacson wrote:
> Hi all --
> I'm trying to build ksh 93s+ (the 2007-11-05 package) on Solaris 7,
> and it's failing with this error:
> Undefined first referenced
> symbol in file
> freeaddrinfo libshell.a(io.o)
> ld: fatal: Symbol referencing errors. No output written to ksh
> mamake [cmd/ksh93]: *** exit code 1 making ksh
> The addrinfo stuff is not available on Solaris 7, and it seems to
> figure that out earlier in the process:
> iffe: test: is getaddrinfo a library function ... no
> I also checked in the generated FEATURE/lib, and there's no #define
> for _lib_getaddrinfo. However, "nm io.o" does show that it needs
> freeaddrinfo.
> Interestingly, I checked on our Solaris 8 build, and it also decided
> there that getaddrinfo wasn't available, and _lib_getaddrinfo wasn't
> defined. But even still, "nm io.o" showed an external dependency on
> freeaddrinfo, which it shouldn't have. It happens to work fine though,
> because on Solaris 8, freeaddrinfo is provided by libsocket.so.
> Going back to io.c, I found an #if block starting at line 71 that
> seems to end in the wrong place. The block beginning:
> #if defined(_lib_socket) && defined(_sys_socket) &&
> #defined(_hdr_netinet_in)
> doesn't end until the #else on line 300, and it contains the logic
> that handles systems without addrinfo (the "#if !_lib_getaddrinfo" on
> line 89). But there's a call to freeaddrinfo in the onintr function at
> line 594 -- well outside of that block. This seems to be what's
> causing the dependency.
> Incidentally, the onintr function also has a parameter of type struct
> addrinfo, which won't be defined if the entire block is skipped. This
> is undoubtedly responsible for the following warning when building on
> Solaris 8:
> ".../src/cmd/ksh93/sh/io.c", line 588: warning: dubious tag declaration:
> struct addrinfo
> It seems that the #else/#endif at line 300 needs to move up to line
> 88, and/or the onintr function needs to move above line 300.
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users