This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -lsocket patch


(BTW, regarding caveats others have expressed -- no, to my knowledge,
nothing in libg2c will invoke gethostname() except for the library
routine that implements the libU77 HOSTNM() intrinsic.  That routine,
named G77_hostnm_0, lives in the libg2c.a archive and is built from
egcs/libf2c/libU77/hostnm_.c.)

Dave, have you verified that this patch actually works vis-a-vis building
u77-test on an SCO system?

Reason I ask is, I'd expect the user who needs -lsocket will, when
using g77's libU77 HOSTNM() intrinsic, have to specify

  -lg2c -lsocket -lm

or similar to get it to work.  That is, I think the g77 driver will
*append* -lg2c -lm to the command line, rather than recognizing
that -lsocket is a library upon which -lg2c might depend.  So the
command `g77 foo.f -lsocket' would become `g77 foo.f -lsocket -lg2c -lm',
which would cause -lsocket to be skipped because, at that point,
there's no unresolved reference to gethostname().  That is, if I
have my UNIX library user-punishment algorithm right.  :)

If I'm right, fixing this would require another change to get u77-test.f
to build, plus a change to the doc you just added.  (Or perhaps
teaching the g77 driver the concept of libraries upon which
libg2c.a might depend and thus should follow, instead of precede,
-lg2c on the final command line.  I'm not too keen on that; the
more "clever" massaging of the command line the g77 driver does, the
less likely the user will feel he understands what's going on.)

If I'm wrong, well, what's new.

        tq vm, (burley)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]