Finally I managed to build gnatcov 24.0!
The solution to the missing “gnat_version_string” reference was to use the gnatutil.anod definition file from the GNAT-FSF-builds “main” branch instead of the one in the current “gprbuild_24” branch. This uses the version gnat_util-20.0w-20190814-1532A, and the “gprbuild_24” branch uses 14.1.0. I don’t know what this means. It is encouraging that it built without errors, and we are using it in the main branch as well.
In addition, I had to change the type of a variable in osint.adb from Long_Integer to Long_Long_Integer:
function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type is
GNAT_Time : Time_Stamp_Type;
TI : Long_Long_Integer := To_C (T);
Y : Year_Type;
Mo : Month_Type;
D : Day_Type;
H : Hour_Type;
Mn : Minute_Type;
S : Second_Type;
Removing the “-flto” in adasat.gpr solved the problem with the adasat references.
The solution to the ZSTD errors was the following:
binutils.anod contains two types of configuration settings: a general one and one specifically for gnatcov.
This part looks like this:
if self.for_gnatcov:
configure.add("--disable-ld",
"--disable-gdb",
"--disable-gdbserver",
"--disable-libquadmath",
"--disable-nls",
"--disable-readline",
"--disable-sim",
"--disable-werror",
"--enable-gprofng=no",
"--with-static-standard-libraries",
"--without-zstd",
"--enable-targets=all")
# For embedded only?
configure.add("--enable-multilib")
else:
configure.add(
"--disable-nls",
"--disable-shared",
"--disable-werror",
"--with-zlib",
"--without-zstd",
"--disable-compressed-debug-sections",
"--disable-separate-code",
"--disable-gdb",
"--disable-sim",
"--disable-libquadmath",
"--disable-readline",
)
The general one has “–without-zstd” (and it is the same in the main branch of GNAT-FSF-builds).
The script uses a different configuration for gnatcov, and the “–without-zstd” is omitted. I added it here as well, and it helped.
With these changes, gnatcov built without errors.
I don’t know how well it is, but maybe this information will help others!