[Ada] gnatmake -s -fstack-check

Message ID 20130102093149.GA28318@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Jan. 2, 2013, 9:31 a.m.
As -fstack-check is an alias for -fstack-check=specific and the longer
switch is now recorded in the ALI file, this patch make sure that when
-fstack-check is used, gnatmake -s will no longer recompiles all the
The test for this is to invoke several time gnatmake -s -fstack-check on
the same sources without modification of the sources. There should be no
compilation starting with the second invocation.

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-01-02  Vincent Celier  <celier@adacore.com>

	* switch-m.adb (Normalize_Compiler_Switches): Record the
	complete switch -fstack-check=specific instead of its shorter
	alias -fstack-check.


Index: switch-m.adb
--- switch-m.adb	(revision 194776)
+++ switch-m.adb	(working copy)
@@ -214,6 +214,12 @@ 
                   Add_Switch_Component (Switch_Chars);
+               --  Special case for -fstack-check (alias for
+               --  -fstack-check=specific)
+               elsif Switch_Chars = "-fstack-check" then
+                  Add_Switch_Component ("-fstack-check=specific");
                --  Take only into account switches that are transmitted to
                --  gnat1 by the gcc driver and stored by gnat1 in the ALI file.