g77spec.c (lang_specific_driver): Put `-lg2c' in front of any `-lm' that is seen.
authorCraig Burley <burley@gnu.org>
Sat, 27 Jun 1998 22:12:42 +0000 (18:12 -0400)
committerJeff Law <law@gcc.gnu.org>
Sat, 27 Jun 1998 22:12:42 +0000 (16:12 -0600)
* g77spec.c (lang_specific_driver): Put `-lg2c' in
front of any `-lm' that is seen.

From-SVN: r20763

gcc/f/ChangeLog
gcc/f/g77spec.c
gcc/f/news.texi

index 581f689c6f8f224f93db6aea815f43ab2d9a482a..c6cafbf4f81aa323ae2288a37fbb9b038f8d0f6e 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 26 11:54:19 1998  Craig Burley  <burley@gnu.org>
+
+       * g77spec.c (lang_specific_driver): Put `-lg2c' in
+       front of any `-lm' that is seen.
+
 Mon Jun 15 23:39:24 1998  Craig Burley  <burley@gnu.org>
 
        * Make-lang.in (f/g77.info): Use -f when removing
index 7c78018310623f16f7fad7db04769607214caceb..fa967d05560a7393064e39aca2dbe501387f08f3 100644 (file)
@@ -511,6 +511,8 @@ Report bugs to <egcs-bugs@cygnus.org>.\n");
            {
              if (saw_library == 1)
                saw_library = 2;        /* -l<library> -lm. */
+            else
+              append_arg (FORTRAN_LIBRARY);
            }
          else if (strcmp (argv[i], FORTRAN_LIBRARY) == 0)
            saw_library = 1;    /* -l<library>. */
index 06031ce289da90c989b3b2bbcdde90363afdece1..05cb258205e5079dfd27def1e60e3c2298208048 100644 (file)
@@ -48,6 +48,15 @@ involve a combination of these elements.
 
 @heading In 0.5.24:
 @itemize @bullet
+@item
+The @code{g77} driver now ensures that @samp{-lg2c}
+is specified in the link phase prior to any
+occurrence of @samp{-lm}.
+This prevents accidentally linking to a routine
+in the SunOS4 @samp{-lm} library
+when the generated code wants to link to the one
+in @code{libf2c} (@code{libg2c}).
+
 @item
 @code{g77} no longer crashes when compiling code
 containing specification statements such as