public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix Ada bootstrap (canonical -I option form)
@ 2010-09-03 13:06 Joseph S. Myers
  2010-09-03 13:10 ` Arnaud Charlet
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph S. Myers @ 2010-09-03 13:06 UTC (permalink / raw)
  To: gcc-patches

This patch fixes an Ada bootstrap issue caused by my options aliases
changes.  When gnat1 reconstitutes an argv array, it needs to generate
-I options in joined form for the sake of Ada-language code requiring
that form, and it is now possible for (ignored) options to have empty
canonical form (although this should only arise if gnat1 is called
directly with such an option or specs somehow generate such an
option).

Tested on i686-pc-linux-gnu to fix Ada-enabled bootstrap.  OK to
commit?

2010-09-03  Joseph Myers  <joseph@codesourcery.com>

	PR ada/45499
	* gcc-interface/misc.c (gnat_init_options): Allow options with
	empty canonical form.  Generate a single save_argv element from -I
	options.

Index: gcc/ada/gcc-interface/misc.c
===================================================================
--- gcc/ada/gcc-interface/misc.c	(revision 163785)
+++ gcc/ada/gcc-interface/misc.c	(working copy)
@@ -273,13 +273,24 @@ gnat_init_options (unsigned int decoded_
   for (i = 0; i < decoded_options_count; i++)
     {
       if (decoded_options[i].errors
-	  || decoded_options[i].opt_index == OPT_SPECIAL_unknown)
+	  || decoded_options[i].opt_index == OPT_SPECIAL_unknown
+	  || decoded_options[i].canonical_option_num_elements == 0)
 	continue;
-      gcc_assert (decoded_options[i].canonical_option_num_elements >= 1
-		  && decoded_options[i].canonical_option_num_elements <= 2);
-      save_argv[save_argc++] = decoded_options[i].canonical_option[0];
-      if (decoded_options[i].canonical_option_num_elements >= 2)
-	save_argv[save_argc++] = decoded_options[i].canonical_option[1];
+      if (decoded_options[i].opt_index == OPT_I)
+	{
+	  gcc_assert (decoded_options[i].canonical_option_num_elements == 2);
+	  save_argv[save_argc++]
+	    = concat (decoded_options[i].canonical_option[0],
+		      decoded_options[i].canonical_option[1], NULL);
+	}
+      else
+	{
+	  gcc_assert (decoded_options[i].canonical_option_num_elements >= 1
+		      && decoded_options[i].canonical_option_num_elements <= 2);
+	  save_argv[save_argc++] = decoded_options[i].canonical_option[0];
+	  if (decoded_options[i].canonical_option_num_elements >= 2)
+	    save_argv[save_argc++] = decoded_options[i].canonical_option[1];
+	}
     }
   save_argv[save_argc] = NULL;
 

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Fix Ada bootstrap (canonical -I option form)
  2010-09-03 13:06 Fix Ada bootstrap (canonical -I option form) Joseph S. Myers
@ 2010-09-03 13:10 ` Arnaud Charlet
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaud Charlet @ 2010-09-03 13:10 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches

> This patch fixes an Ada bootstrap issue caused by my options aliases
> changes.  When gnat1 reconstitutes an argv array, it needs to generate
> -I options in joined form for the sake of Ada-language code requiring
> that form, and it is now possible for (ignored) options to have empty
> canonical form (although this should only arise if gnat1 is called
> directly with such an option or specs somehow generate such an
> option).
> 
> Tested on i686-pc-linux-gnu to fix Ada-enabled bootstrap.  OK to
> commit?

OK, thanks.

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

end of thread, other threads:[~2010-09-03 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-03 13:06 Fix Ada bootstrap (canonical -I option form) Joseph S. Myers
2010-09-03 13:10 ` Arnaud Charlet

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).