[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1111799: ada bootstrapping issue in ada-lib-info-source-date-epoch.diff



Source: gcc-15
Version: 15.2.0-1

Set_Source_Date_Epoch added in ada-lib-info-source-date-epoch.diff
converts a string to epoch, but it calls To_Ada() function, which is
not available in a compiler without pr114065 (i.e. an old *HOST*
gcc/gnat package built without this patch backported).

ada is built in gcc in both the bootstrapping stage (using the *HOST*
compiler) and final stages.

To fix it, we need to redeclare the To_Ada() function. we can add
following 2 lines in ada-lib-info-source-date-epoch.diff
    Set_Source_Date_Epoch : declare
+      function To_Ada is
+        new Ada.Unchecked_Conversion (Long_Long_Integer, OS_Time);

This applies to gcc-15, gcc-14, and gcc-13.
gcc-12 also suffers a bootstrapping issue but the root cause is
different, however we can fix it in the same way (first sync the
change of gcc-13/14/15 to gcc-12, then fix it as above).

FWIW, gcc-12's bootstrapping issue occurs with gcc-9 (gcc official doc
recommend using gcc 9.4/9.5 to bootstrap gcc-12 upwards because gdc-12
upwards requires a recent (>=9.4) gdc compiler for bootstrapping). But
in gnat-8 and gnat-9, time_t is converted to a subtype thus the
current patch laying in gcc-12 branch (which makes use of time_t)
fails with these compilers. Converting the use of time_t to
Long_Long_Integer solves the issue, but still requires the To_Ada
re-declaration for bootstrapping.


Best Regards,
yumeyao


Reply to: