Thanks, I'm having trouble getting to the bottom of this though... I
followed your explanation to figure out why _sys_socket is unset. Now
given this line (src/cmd/ksh93/Mamfile:576):
exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref
${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE}
-I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd}
${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll
Which of these variables would you expect -lsocket to be in? I tried
adding ${mam_libsocket} in addition to ${mam_libnsl} but it didn't do
anything. Oddly, -lsocket IS added to the final step that links the
ksh binary, and once you get past <sys/socket.h> not getting included,
everything works just fine. The 'cc -o ksh' picks up (among other
things):
-lm -lsocket -lnsl -lsecdb -lnsl
but iffe comes up short, as you saw from the log. I imagine that
whatever's putting -lsocket into the final link command is confusing
mamake into thinking it's unnecessary at other times.
As for nmake... I only had INIT and ast-ksh, but I tried adding
ast-base to get nmake. With this, it does indeed complete successfully
the first time through, with no help. Interestingly, under nmake, it
uses the static /usr/lib/libsocket.a rather than -lsocket.
I looked back at my build logs from 93t+ and earlier, and it's always
been this way: -lsocket gets stuffed in at the end, and _lib_socket is
'no' from features/poll. It never mattered though, because io.c didn't
do any socket stuff outside of the big conditional:
#if defined(_lib_socket) && defined(_sys_socket) && defined(_hdr_netinet_in)
In 93u however, the coshell support does sockety stuff, even if that
entire block is skipped and the pre-requisites for socket support are
not in place. I think that's probably a bug in and of itself.
Glenn Fowler wrote:
>
>
> sun in an ancient and questionable move put socket(2) and friends in -lsocket
> and it remains there today
>
> the iffe on features/poll needs -lsocket along with the already present -lnsl
> don't know why -lsocket was omitted in your build
>
> if you also built nmake then a remake of ksh93 should self-correct
>
> otherwise try:
> rm FEATURE/poll and remake
> if that fails try:
> snarf the iffe line for features/poll and add -lsocket before -lnsl
> and
> run it manually, then remake ksh
>
> On Wed, 15 Jun 2011 15:15:05 -0400 Ron Isaacson wrote:
> > I'm having trouble building 93u on Solaris (tried 7, 8, 10 x86). The
> > issue is with new socket code in io.c:
>
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 891: undefined symbol: socklen_t
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 891: syntax error before or at:
> > )
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 914: incomplete
> > struct/union/enum sockaddr_in: sin
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 915: undefined symbol: socklen_t
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 915: syntax error before or at:
> > slen
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 916: undefined symbol: AF_INET
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 916: undefined symbol:
> > SOCK_STREAM
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 920: undefined struct/union
> > member: sin_family
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 921: undefined struct/union
> > member: sin_port
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 922: undefined struct/union
> > member: sin_addr
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 922: undefined struct/union
> > member: s_addr
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 922: warning: left operand of
> > "." must be struct/union object
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 922: undefined symbol:
> > INADDR_ANY
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 923: undefined symbol: slen
> > "/tmp/ksh93u/src/cmd/ksh93/sh/io.c", line 925: undefined symbol: slen
>
> > It seems the sys/socket.h logic in io.c is not working properly. If I
> > add an '#include <sys/socket.h>' near the top, it builds just fine.
>
> > make.out is attached (from a Solaris 8 attempt). Any suggestions?
>
> > --
> > Ron Isaacson
> > Morgan Stanley
> > [email protected] / (212) 276-1349
--
Ron Isaacson
Morgan Stanley
[email protected] / (212) 276-1349
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users