OSDN Git Service

Improve error for undefined name in imported package.
[pf3gnuchains/gcc-fork.git] / gcc / lto-wrapper.c
index 6f106a3..f26b3ac 100644 (file)
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "intl.h"
+#include "diagnostic.h"
 #include "obstack.h"
 
 int debug;                             /* true if -save-temps.  */
@@ -392,6 +393,7 @@ run_gcc (unsigned argc, char *argv[])
   if (linker_output)
     {
       char *output_dir, *base, *name;
+      bool bit_bucket = strcmp (linker_output, HOST_BIT_BUCKET) == 0;
 
       output_dir = xstrdup (linker_output);
       base = output_dir;
@@ -406,8 +408,11 @@ run_gcc (unsigned argc, char *argv[])
          static char current_dir[] = { '.', DIR_SEPARATOR, '\0' };
          output_dir = current_dir;
        }
-      *argv_ptr++ = "-dumpdir";
-      *argv_ptr++ = output_dir;
+      if (!bit_bucket)
+       {
+         *argv_ptr++ = "-dumpdir";
+         *argv_ptr++ = output_dir;
+       }
 
       *argv_ptr++ = "-dumpbase";
     }
@@ -623,8 +628,19 @@ cont:
 int
 main (int argc, char *argv[])
 {
+  const char *p;
+
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+    --p;
+  progname = p;
+
+  xmalloc_set_program_name (progname);
+
   gcc_init_libintl ();
 
+  diagnostic_initialize (global_dc, 0);
+
   if (signal (SIGINT, SIG_IGN) != SIG_IGN)
     signal (SIGINT, fatal_signal);
 #ifdef SIGHUP