This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

[LTO] Patch for PR40429


This fixes the case where a user specifies -o<filename> and the
assembler is invoked with two -o switches which leads to an empty
lto object.

Regards,

Ryan Mansfield

2009-06-13 Ryan Mansfield <rmansfield@qnx.com>

        PR lto/40429
        * lto-wrapper.c (run_gcc): Handle no space between -o and filename
        argument.

Index: lto-wrapper.c
===================================================================
--- lto-wrapper.c       (revision 148432)
+++ lto-wrapper.c       (working copy)
@@ -272,12 +272,13 @@
       if (strcmp (s, "-flto") == 0 || strcmp (s, "-fwhopr") == 0)
        /* We've handled this LTO option, don't pass it on.  */
        ;
-      else if (strcmp (s, "-o") == 0)
+      else if (*s == '-' && s[1] == 'o')
        {
          /* Drop `-o' and its filename argument.  We will use a
             temporary file for the LTO output.  The `-o' option
             will be interpreted by the linker.  */
-         i++;
+         if (s[2] == '\0')
+           i++;
        }
       else
        /* Pass the option or argument to LTO.  */


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