The Ada front end moves gnatmake-specific logic from libgnat
The Ada front end now relocates `gnatmake`-specific library naming logic from the shared `libgnat` to `gnatmake` itself, eliminating a hardcoded workaround.
This commit disentangles gnatmake-specific logic for hardcoding library names like libXXX.a from the general-purpose libgnat runtime library. Previously, a complicated and ancient workaround existed in libgnat to support gnatmake. Now, this specific logic for __gnat_library_template is moved into gnatmake itself, leading to a cleaner separation of concerns within the Ada compiler components and simplifying make.adb’s Get_Library_File function.
In Details
The gcc/ada subsystem handles the Ada front end for GCC. This commit addresses an architectural issue where libgnat, the Ada runtime library, contained logic specific to gnatmake, the Ada build tool. Specifically, the __gnat_library_template in adaint.c had a hardcoded convention for library names (e.g., libXXX.a) which was a workaround for gnatmake. By relocating this logic to gnatmake itself, a clean separation is achieved, meaning libgnat becomes truly generic and gnatmake encapsulates its own specific build-system conventions. This simplifies the Get_Library_File fun…
For Context
The Ada front end in the GCC compiler suite includes components like gnatmake, which is a build tool somewhat similar to make or ninja for C/C++ projects, and libgnat, which is the runtime library providing essential functions for Ada programs. This commit makes a cleaner separation between these two components. Historically, libgnat contained some old code that told gnatmake how to name library files (e.g., always libXXX.a). This was a specific workaround for gnatmake rather than a general rule for all Ada programs. This change moves that specialized naming logic directly into the gnatmake tool. This means libgnat becomes more generic and doesn't need to know about gnatmake's specific build rules, making both parts of the system more modular and easier to understand and maintain. It's like moving a recipe specific to making a cake from a general cookbook into a dedicated 'baking' cookbook.