aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-07-01 13:35:43 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-01 13:35:43 +0000
commit647abeaf0e8951e2bfa195723b1d8c160ccb22bf (patch)
tree35aac90e4f41ee0eb05d21e2e6f4a0f258b061c2 /gcc
parent1d0b1439ae4db4b52cb2bfd6b786d68bb8b5bb15 (diff)
downloadgcc-647abeaf0e8951e2bfa195723b1d8c160ccb22bf.zip
gcc-647abeaf0e8951e2bfa195723b1d8c160ccb22bf.tar.gz
gcc-647abeaf0e8951e2bfa195723b1d8c160ccb22bf.tar.bz2
[Ada] gprbuild fails to find ghost ALI files
This patch fixes a bug where if a ghost unit is compiled with ignored-ghost mode in a library project, then gprbuild will fail to find the ALI file, because the compiler generates an empty object file, but no ALI file. 2019-07-01 Bob Duff <duff@adacore.com> gcc/ada/ * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is ignored-ghost. From-SVN: r272867
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gnat1drv.adb8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cf6dc8a..95c2cad 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-01 Bob Duff <duff@adacore.com>
+
+ * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is
+ ignored-ghost.
+
2019-07-01 Yannick Moy <moy@adacore.com>
* sem_ch4.adb (Operator_Check): Refine error message.
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index cd4518f..1f5817a 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -1453,9 +1453,13 @@ begin
-- Generate ALI file if specially requested, or for missing subunits,
-- subunits or predefined generic. For ignored ghost code, the object
- -- file IS generated, so Object should be True.
+ -- file IS generated, so Object should be True, and since the object
+ -- file is generated, we need to generate the ALI file. We never want
+ -- an object file without an ALI file.
- if Opt.Force_ALI_Tree_File then
+ if Is_Ignored_Ghost_Unit (Main_Unit_Node)
+ or else Opt.Force_ALI_Tree_File
+ then
Write_ALI (Object => Is_Ignored_Ghost_Unit (Main_Unit_Node));
end if;