Patchwork [Ada] Fix oversight in new handling of -Oxxx switches

login
register
mail settings
Submitter Arnaud Charlet
Date Oct. 11, 2010, 9:27 a.m.
Message ID <20101011092716.GA11537@adacore.com>
Download mbox | patch
Permalink /patch/67396/
State New
Headers show

Comments

Arnaud Charlet - Oct. 11, 2010, 9:27 a.m.
The -Oxxx switches are now passed to both the compiler and the linker. But
the original change overlooked -O, which is a synonym for -O1 and should
therefore be passed as well. This is fixed by this patchlet.

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

2010-10-11  Eric Botcazou  <ebotcazou@adacore.com>

	* make.adb (Scan_Make_Arg): Also pass -O to both compiler and linker.

Patch

Index: make.adb
===================================================================
--- make.adb	(revision 165256)
+++ make.adb	(working copy)
@@ -8115,7 +8115,7 @@  package body Make is
              or else Argv (2 .. Argv'Last) = "pg"
              or else (Argv (2) = 'm' and then Argv'Last > 2)
              or else (Argv (2) = 'f' and then Argv'Last > 2)
-             or else (Argv (2) = 'O' and then Argv'Last > 2)
+             or else Argv (2) = 'O'
          then
             Add_Switch (Argv, Compiler, And_Save => And_Save);
             Add_Switch (Argv, Linker,   And_Save => And_Save);