From: Bob Duff Date: Tue, 11 Dec 2018 11:11:26 +0000 (+0000) Subject: [Ada] gnatbind: ghost code with -gnatQ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=af3ded0832bd13e8f00fc62d96a367635398d1d6;p=gcc.git [Ada] gnatbind: ghost code with -gnatQ This patch fixes a bug where if a library unit is compiled with -gnatQ, and that library unit is an ignored Ghost unit, then gnatbind silently fails. 2018-12-11 Bob Duff gcc/ada/ * gnat1drv.adb (gnat1drv): Pass the correct Object value when calling Write_ALI in the case of -gnatQ. * gnatbind.adb (Gnatbind): Avoid silent failure; give an error message. From-SVN: r267004 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 33d2a1499d4..b70184fc158 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2018-12-11 Bob Duff + + * gnat1drv.adb (gnat1drv): Pass the correct Object value when + calling Write_ALI in the case of -gnatQ. + * gnatbind.adb (Gnatbind): Avoid silent failure; give an error + message. + 2018-12-11 Ed Schonberg * exp_unst.adb (Needs_Fat_Pointer): A fat pointer is required if diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 9f428148266..bfc3b04a605 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -1452,10 +1452,11 @@ begin Tree_Gen; -- Generate ALI file if specially requested, or for missing subunits, - -- subunits or predefined generic. + -- subunits or predefined generic. For ignored ghost code, the object + -- file IS generated, so Object should be True. if Opt.Force_ALI_Tree_File then - Write_ALI (Object => False); + Write_ALI (Object => Is_Ignored_Ghost_Unit (Main_Unit_Node)); end if; Namet.Finalize; diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb index 5ab1bf1005f..7d42b6bf8f7 100644 --- a/gcc/ada/gnatbind.adb +++ b/gcc/ada/gnatbind.adb @@ -790,6 +790,7 @@ begin -- Quit if some file needs compiling if No_Object_Specified then + Error_Msg ("no object specified"); raise Unrecoverable_Error; end if;