Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I have gnat 13.1.0 on my M1 Mac; I'd like to have my own Ada+GNAT *.ad[sb] library files, where are they?

72 views
Skip to first unread message

Kenneth Wolcott

unread,
Jun 25, 2023, 12:37:37 AM6/25/23
to
Hi;

I have gnat 13.1.0 on my M1 Mac;

(thank you, Simon! <GRIN>)

I'd like to have my own Ada+GNAT *.ad[sb] library files, where are they?

I can find the Ada libraries (*.ad[sb]) but it sometimes is hard to (reliably) find all of the GNAT Ada libraries in external documentation.

I hope that this is not a stupid question.

Perhaps there is a gnatmake flag or gnat doc that I'm just not seeing.

Thanks,
Ken Wolcott

Kenneth Wolcott

unread,
Jun 25, 2023, 1:23:44 AM6/25/23
to

Simon Wright

unread,
Jun 25, 2023, 6:15:54 AM6/25/23
to
Kenneth Wolcott <kenneth...@gmail.com> writes:

> I have gnat 13.1.0 on my M1 Mac;
>
> (thank you, Simon! <GRIN>)

:bow:

> I'd like to have my own Ada+GNAT *.ad[sb] library files, where are they?

If you just want to insect them, see below: if you want to alter them,
that'd be a bit tricker. As far as I can remember, GNAT Pro releases
provide for rebuilding the runtime, but the FSF builds don't.

> I can find the Ada libraries (*.ad[sb]) but it sometimes is hard to
> (reliably) find all of the GNAT Ada libraries in external
> documentation.

They're in {prefix}/lib/gcc/{target}/{release}/adainclude/ - i.e., in
your case (unless you've moved the install)

/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/adainclude/

But you say you know that. I wonder whether it's the crunched filenames
that are confusing? (a legacy of the days when DOS 8.3 filenames were
required for a large part of GNAT's target audience). You can find the
crunched filename for a package using gnatkr (gnat krunch):

$ gnatkr gnatkr ada.sequential_io.ads
a-sequio.ads

(you don't actually need whatever's after the final period to be the
actual file extension: you could use '.open' or just '.').

Simon Wright

unread,
Jun 25, 2023, 11:28:22 AM6/25/23
to
Simon Wright <si...@pushface.org> writes:

> $ gnatkr gnatkr ada.sequential_io.ads
> a-sequio.ads

Only one 'gnatkr', ofc!

Kenneth Wolcott

unread,
Jun 25, 2023, 1:00:18 PM6/25/23
to
Thank you Simon!

On Sunday, June 25, 2023 at 3:15:54 AM UTC-7, Simon Wright wrote:
> Kenneth Wolcott writes:
>
> > I have gnat 13.1.0 on my M1 Mac;
> >
> > (thank you, Simon! <GRIN>)
> :bow:
> > I'd like to have my own Ada+GNAT *.ad[sb] library files, where are they?
> If you just want to insect them, see below: if you want to alter them,
> that'd be a bit tricker. As far as I can remember, GNAT Pro releases
> provide for rebuilding the runtime, but the FSF builds don't.
> > I can find the Ada libraries (*.ad[sb]) but it sometimes is hard to
> > (reliably) find all of the GNAT Ada libraries in external
> > documentation.
> They're in {prefix}/lib/gcc/{target}/{release}/adainclude/ - i.e., in
> your case (unless you've moved the install)
>
> /opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/adainclude/

This is all the information that I needed, thank you!

> But you say you know that. I wonder whether it's the crunched filenames
> that are confusing? (a legacy of the days when DOS 8.3 filenames were
> required for a large part of GNAT's target audience). You can find the
> crunched filename for a package using gnatkr (gnat krunch):
>
> $ gnatkr gnatkr ada.sequential_io.ads
> a-sequio.ads

This is nice, thank you!

> (you don't actually need whatever's after the final period to be the
> actual file extension: you could use '.open' or just '.').

Ken Wolcott

Keith Thompson

unread,
Jun 25, 2023, 5:49:11 PM6/25/23
to
Simon Wright <si...@pushface.org> writes:
[...]
> But you say you know that. I wonder whether it's the crunched filenames
> that are confusing? (a legacy of the days when DOS 8.3 filenames were
> required for a large part of GNAT's target audience). You can find the
> crunched filename for a package using gnatkr (gnat krunch):
>
> $ gnatkr ada.sequential_io.ads
[fixed typo]
> a-sequio.ads
>
> (you don't actually need whatever's after the final period to be the
> actual file extension: you could use '.open' or just '.').

Which raises a question: Why does GNAT still use crunched filenames? It
probably makes sense to continue to support them (does anyone use GNAT
on MS-DOS?), but I wouldn't think it would be difficult to use full file
names on the vast majority of systems that support them. It's not a
huge deal, but using full file names where possible would be less
annoying.

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Jere

unread,
Jun 26, 2023, 2:56:51 PM6/26/23
to
On Sunday, June 25, 2023 at 5:49:11 PM UTC-4, Keith Thompson wrote:
> Simon Wright writes:
> [...]
> > But you say you know that. I wonder whether it's the crunched filenames
> > that are confusing? (a legacy of the days when DOS 8.3 filenames were
> > required for a large part of GNAT's target audience). You can find the
> > crunched filename for a package using gnatkr (gnat krunch):
> >
> > $ gnatkr ada.sequential_io.ads
> [fixed typo]
> > a-sequio.ads
> >
> > (you don't actually need whatever's after the final period to be the
> > actual file extension: you could use '.open' or just '.').
> Which raises a question: Why does GNAT still use crunched filenames? It
> probably makes sense to continue to support them (does anyone use GNAT
> on MS-DOS?), but I wouldn't think it would be difficult to use full file
> names on the vast majority of systems that support them. It's not a
> huge deal, but using full file names where possible would be less
> annoying.

Unless they changed how the GNAT compiler works in the last few years, then my guess is inertia
to do that. Right before the pandemic hit, I had the neat idea of doing my own bare metal
runtime and to use normal uncrunched names. The RTS compiled just fine doing that. However,
when I tried to use the RTS to build a full fledged program, it failed to find the package in the RTS.
I don't recall if it failed at compile time or link time, but crunching the names and recompiling the
RTS fixed the issue. So something in their compiler requires the crunched names, or if they have
since changed that, used to require it.

Kenneth Wolcott

unread,
Jun 26, 2023, 3:35:23 PM6/26/23
to
> Simon Wright writes:
> $ gnatkr ada.sequential_io.ads
> a-sequio.ads

Simon, Keith, Jere:

Yes, the crunched names are annoying. Too bad that they seem to be required even now...

I'm now writing a Perl script (later to be converted to Ada) which does the "unkrunch" :-)

Seems like a missing utility for humans to use Ada :-)

Thanks,
Ken

Simon Wright

unread,
Jun 26, 2023, 3:48:42 PM6/26/23
to
The package in the compiler that deals with crunched names is Rtsfind,
https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/rtsfind.ads

Kenneth Wolcott

unread,
Jun 26, 2023, 4:00:27 PM6/26/23
to
Simon;

> The package in the compiler that deals with crunched names is Rtsfind,
> https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/rtsfind.ads

Thank you!
Ken
0 new messages