PATCH: PR driver/47547: WHOPR, can't use /dev/null as an output file

H.J. Lu hongjiu.lu@intel.com
Mon Jan 31 20:15:00 GMT 2011


Hi,

HOST_BIT_BUCKET is a special case.  We shouldn't use dump base/dir on it.
Tested on Linux/x86-64.  OK for trunk?

Thanks.

H.J.
---
2011-01-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR driver/47547
	* lto-wrapper.c (run_gcc): Don't add -dumpdir if linker_output
	is HOST_BIT_BUCKET.

	* opts.c (finish_options): Don't add x_aux_base_name if it is
	HOST_BIT_BUCKET.

diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 6f106a3..05237db 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -392,6 +392,7 @@ run_gcc (unsigned argc, char *argv[])
   if (linker_output)
     {
       char *output_dir, *base, *name;
+      bool bit_bucket = !strcmp (linker_output, HOST_BIT_BUCKET);
 
       output_dir = xstrdup (linker_output);
       base = output_dir;
@@ -406,8 +407,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";
     }
diff --git a/gcc/opts.c b/gcc/opts.c
index b958a09..c9b84af 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -633,7 +633,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
       if (opts->x_dump_dir_name)
 	opts->x_dump_base_name = concat (opts->x_dump_dir_name,
 					 opts->x_dump_base_name, NULL);
-      else if (opts->x_aux_base_name)
+      else if (opts->x_aux_base_name
+	       && strcmp (opts->x_aux_base_name, HOST_BIT_BUCKET))
 	{
 	  const char *aux_base;
 



More information about the Gcc-patches mailing list