public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* g77 -lm doesn't work
@ 2001-01-01  5:19 Billinghurst, David (CRTS)
  2001-01-01 15:59 ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 2+ messages in thread
From: Billinghurst, David (CRTS) @ 2001-01-01  5:19 UTC (permalink / raw)
  To: 'cygwin@sources.redhat.com'

Using cygwin 1.17-1, if I try to link any Fortran program with -lm I get the
error

/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/../../../../i686-pc-cygwin/lib/libm
.a(libcmain.o)(.text+0x7f): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status

Now libm.a is a symbolic link to libcygwin.a.  I believe the root cause is
linking libcygwin.a before libg2c.a since for any Fortran program I see

g77 foo.f			OK
g77 foo.f -lm			FAIL
g77 foo.f -lg2c -lm		OK
g77 foo.f -lcygwin		FAIL
g77 foo.f -lg2c -lcygwin		OK

Now the obvious solution is to not use -lm, but then I have to edit
Makefiles (or even worse - hack Dejagnu so I can run the g77 testsuite).
Once upon a time the cygwin libm.a was an empty archive.  Can we revert to
this?

+++++++++++++++++++++++++++++++++++++++++
(Mr) David Billinghurst
Comalco Research Centre
PO Box 316, Thomastown, Vic, Australia, 3074
Phone:	+61 3 9469 0642
FAX:	+61 3 9462 2700
Email:	David.Billinghurst@riotinto.com.au






--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: g77 -lm doesn't work
  2001-01-01  5:19 g77 -lm doesn't work Billinghurst, David (CRTS)
@ 2001-01-01 15:59 ` Larry Hall (RFK Partners, Inc)
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2001-01-01 15:59 UTC (permalink / raw)
  To: Billinghurst, David (CRTS), 'cygwin@sources.redhat.com'

At 08:19 AM 1/1/2001, Billinghurst, David (CRTS) wrote:
>Using cygwin 1.17-1, if I try to link any Fortran program with -lm I get the
>error
>
>/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/../../../../i686-pc-cygwin/lib/libm
>.a(libcmain.o)(.text+0x7f): undefined reference to `WinMain@16'
>collect2: ld returned 1 exit status
>
>Now libm.a is a symbolic link to libcygwin.a.  I believe the root cause is
>linking libcygwin.a before libg2c.a since for any Fortran program I see
>
>g77 foo.f                       OK
>g77 foo.f -lm                   FAIL
>g77 foo.f -lg2c -lm             OK
>g77 foo.f -lcygwin              FAIL
>g77 foo.f -lg2c -lcygwin                OK
>
>Now the obvious solution is to not use -lm, but then I have to edit
>Makefiles (or even worse - hack Dejagnu so I can run the g77 testsuite).
>Once upon a time the cygwin libm.a was an empty archive.  Can we revert to
>this?
>
>+++++++++++++++++++++++++++++++++++++++++
>(Mr) David Billinghurst
>Comalco Research Centre
>PO Box 316, Thomastown, Vic, Australia, 3074
>Phone:  +61 3 9469 0642
>FAX:    +61 3 9462 2700
>Email:  David.Billinghurst@riotinto.com.au



No, reverting isn't an option.  Some packages look for certain functionality
in libm.a as part of their configure (if I remember correctly - and if not,
you'll find the precise answer in the mail archives!;-))  Perhaps this issue
could be resolved in the specs file (forgive me, I'm pretty ignorant of gcc
internals)?




Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
118 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-01 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-01  5:19 g77 -lm doesn't work Billinghurst, David (CRTS)
2001-01-01 15:59 ` Larry Hall (RFK Partners, Inc)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).