Floating point compiler options under SunOS-3.X

roy at philabs.philips.com roy at philabs.philips.com
Thu Mar 9 08:08:41 AEST 1989


When you do "cc -fwhatever -lm", how does the linker know which versions
of the math library to link in?  If you do a "cc -dryrun" to see what's
going on, the only difference at the linking stage is using a different
version of crt.o.

The only thing I can see that might make sense (and looking at gprof
output semi-confirms this) is that every routine in the math library is
actually 3 routines in one (soft, 68881, and fpa versions) and does a
switch to the right code on entry, based on the value of some global
variable set in crt.o.  Could this really be the way things work?  Is the
binary of every program I write using the math library loaded down with
three versions of each routine (plus the, admittedly minor, overhead of
the switch-out code on each call)?

Roy Smith, System Administrator
Public Health Research Institute
{allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy at uunet.uu.net



More information about the Comp.sys.sun mailing list