I published a (pre)release candidate build of GNAT FSF 16.1.0 in the GNAT FSF builds repo. I also added a branch in my fork of the Alire index on GitHub, with the release candidate in it.
We invite you to test this release and tell us if there are any issues we can fix, before we release the actual 16.1.0 version.
There is currently no build for macOS on ARM, as the patched fork we use for that platform hasn’t released a 16.x version yet. But stay tuned!
Thanks for your call for testing, especially for macOS even if unfortunately there is not yet ARM version.
My configuration: macOS 13.7.8, x86_64, Xcode 14.3.1.
Early feedbacks:
Link error: Link [link] test_uxstrings1.adb ld: library not found for -lSystem
User workaround:
ld: warning: object file (/users/me/gnat-x86_64-darwin-16.1.0-1/lib/gcc/x86_64-apple-darwin24.6.0/16.1.0/adalib/libgnat.a(a-assert.o)) was built for newer macOS version (15.0) than being linked (13.0)
User workaround: export MACOSX_DEPLOYMENT_TARGET=15.0
Looks like this new version of GNAT has better checking for Ada RM 4.3.5 (7/5), which requires Add_Unnamed to denote exactly one procedure where in your case it denotes two.
Unfortunately we cannot build for all existing macOS versions… For the time being we will try to support the latest version of macOS and version N-1. It’s a pity that homebrew doesn’t build a GNAT compiler, they have packages for each supported macos version.
There was a time when MacPorts had an Ada compiler that functioned (SIGH) I don’t use homebrew. Looking forward to arm64 MacOS, as working with the Rosetta emulation is slower than molasses in a Minnesota winter…
284. subtype Roman_Character is Wide_Wide_Character with
285. Static_Predicate => Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
286.
287. Max_Roman_Number : constant := 3_999; -- MMMCMXCIX
288.
289. type Roman_Number is range 1 .. Max_Roman_Number
290. with String_Literal => To_Roman_Number;
291.
292. function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
293. with Pre => S'Length > 0 and then
294. (for all Char of S => Char in Roman_Character);
I got the error: aarm_202x_ch04.adb:290:32: error: nonoverridable aspect "String_Literal" of type "Roman_Number" requires "To_Roman_Number" declared at line 292 to be a primitive operation
That’s interesting. I’m unable to reproduce on x86-64 Linux. I copied the code from Ada 2022 RM 4.2.1 into this package, and I get no compilation errors:
package Example is
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
subtype Roman_Character is Wide_Wide_Character
with
Static_Predicate =>
Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
Max_Roman_Number : constant := 3_999; -- MMMCMXCIX
type Roman_Number is range 1 .. Max_Roman_Number
with String_Literal => To_Roman_Number;
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
with
Pre =>
S'Length > 0 and then (for all Char of S => Char in Roman_Character);
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
is (declare
R : constant array (Integer range <>) of Roman_Number :=
[for D in S'Range =>
Roman_Digit'Enum_Rep
(Roman_Digit'Wide_Wide_Value (''' & S (D) & '''))];
-- See 3.5.2 and 13.4
begin
[for I in R'Range =>
(if I < R'Last and then R (I) < R (I + 1) then -1 else 1) * R (I)]'
Reduce ("+", 0));
X : Roman_Number := "III" * "IV" * "XII"; -- 144 (that is, CXLIV)
end Example;
I double-checked I’m using the correct compiler version:
gcc (GNAT-FSF-builds) 16.1.0
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Perhaps there is something else in your package that’s interfering? Are you able to reproduce with the above snippet?
procedure Example_B is
type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
subtype Roman_Character is Wide_Wide_Character
with
Static_Predicate =>
Roman_Character in 'I' | 'V' | 'X' | 'L' | 'C' | 'D' | 'M';
Max_Roman_Number : constant := 3_999; -- MMMCMXCIX
type Roman_Number is range 1 .. Max_Roman_Number
with String_Literal => To_Roman_Number;
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
with
Pre =>
S'Length > 0 and then (for all Char of S => Char in Roman_Character);
function To_Roman_Number (S : Wide_Wide_String) return Roman_Number
is (declare
R : constant array (Integer range <>) of Roman_Number :=
[for D in S'Range =>
Roman_Digit'Enum_Rep
(Roman_Digit'Wide_Wide_Value (''' & S (D) & '''))];
-- See 3.5.2 and 13.4
begin
[for I in R'Range =>
(if I < R'Last and then R (I) < R (I + 1) then -1 else 1) * R (I)]'
Reduce ("+", 0));
X : Roman_Number := "III" * "IV" * "XII"; -- 144 (that is, CXLIV)
begin
null;
end Example_B;
procedure Section_4_5_10_Paragraph_36 is
type Real is digits 8;
function Factorial(N : Natural) return Natural is
([for J in 1..N => J]'Reduce("*", 1));
-- Example of a reduction expression that computes the Sine of X using a Taylor expansion:
function Sine (X : Float; Num_Terms : Positive := 5) return Float is
([for I in 1..Num_Terms => (-1.0)**(I-1) * X**(2*I-1)/Float(Factorial(2*I-1))]
'Reduce("+", 0.0));
begin
null;
end Section_4_5_10_Paragraph_36;
The compilation never ended with switch -gnatVa: $ gcc -c -gnat2022 section_4_5_10_paragraph_36.adb -gnatVa
I don’t know if this is useful info or not, but when I try to declare tagged types with primitive operations directly in a procedure declarative region, it has always complained to me in older versions. I wonder if the error was intended from the get go and only just recently got fixed up? I’ve always had to put tagged types + primitive operations in a package inside the declarative region of a procedure to get it work. Something like:
procedure Example_B is
package Some_Name is
-- Types and primitive ops
end Some_Name;
use Some_Name; -- so you don't have to work with the extra package name if you don't want to
begin
Just published a rc2 on GNAT FSF builds, this time with a macOS ARM version! You can go ahead and test it, if everything goes well I’ll make the final release. My alire-index branch has been updated to include it.
Checking /Users/runner/work/ada_language_server/ada_language_server/alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/iconv_support.c …
→ object file /Users/runner/work/ada_language_server/ada_language_server/alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/obj/relocatable/iconv_support.o does not exist
Changing to object directory of “GnatColl_Iconv”: “/Users/runner/work/ada_language_server/ada_language_server/alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/obj/relocatable/”
/users/runner/.local/share/alire/toolchains/gnat_native_16.1.0_6ad18148/bin/aarch64-apple-darwin24.6.0-gcc -c -x c -O2 -Wunreachable-code -fPIC -MMD -MF iconv_support.d -specs=/private/var/folders/dq/2t71w9pd3jx50vh3kp15_dt40000gn/T/GPR.4361/GNAT-TEMP-000014.TMP /Users/runner/work/ada_language_server/ada_language_server/alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/iconv_support.c
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:61,
from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_wchar.h:90,
from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:67,
from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/iconv.h:42,
from /Users/runner/work/ada_language_server/ada_language_server/alire/cache/dependencies/gnatcoll_iconv_24.0.0_e90c5b4d/iconv/iconv_support.c:6:
/Users/runner/.local/share/alire/toolchains/gnat_native_16.1.0_6ad18148/lib/gcc/aarch64-apple-darwin24.6.0/16.1.0/include-fixed/_stdio.h:78:10: fatal error: _bounds.h: No such file or directory
78 | #include <_bounds.h>
| ^~~~~~~~~~~
compilation terminated.
compilation of iconv_support.c failed
gprbuild: *** compilation phase failed
Build failed: error while running gprbuild -p -j3 -P/Users/runner/work/ada_language_server/ada_language_server/subprojects/langkit_support/lkt/bootstrap/././liblktlang.gpr -XBUILD_MODE=dev -XLIBRARY_TYPE=relocatable -XGPR_LIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable -m -j0 -vh:
Command ‘[‘gprbuild’, ‘-p’, ‘-j3’, ‘-P/Users/runner/work/ada_language_server/ada_language_server/subprojects/langkit_support/lkt/bootstrap/././liblktlang.gpr’, ‘-XBUILD_MODE=dev’, ‘-XLIBRARY_TYPE=relocatable’, ‘-XGPR_LIBRARY_TYPE=relocatable’, ‘-XXMLADA_BUILD=relocatable’, ‘-m’, ‘-j0’, ‘-vh’]’ returned non-zero exit status 4.
ERROR: Command [“bash”, “-x”, “scripts/build_als.sh”, “build_langkit_raw”] exited with code 1
Error: Process completed with exit code 1.
Then I try GNAT 16.1.0rc2 with macOS 13.7 x86_64, I get similar errors:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:67:8:
**error:** '**FILE**' does not name a type
67 | extern **FILE** *__stdinp;
| **^~~~**
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:65:1:
**note:** '**FILE**' is defined in header '**<cstdio>**'; this is probably fixable by adding '**#include <cstdio>**'
64 | #include <_stdio.h>
+++ |+#include <cstdio>
Thus I disabled (renamed) _stdio.h in include-fixed but after I got other errors:
/Users/me/GNAT-16/gnat-x86_64-darwin-16.1.0-rc2/include/c++/16.1.0/cstdlib:147:11:
**error:** '**at_quick_exit**' has not been declared in '**::**'
147 | using ::**at_quick_exit**;
| **^~~~~~~~~~~~~**
**/Users/me/GNAT-16/gnat-x86_64-darwin-16.1.0-rc2/include/c++/16.1.0/cstdlib:170:11:
**error:** '**quick_exit**' has not been declared in '**::**'
170 | using ::**quick_exit**;
| **^~~~~~~~~~**
I disabled the corresponding lines:
--- ./gnat-x86_64-darwin-16.1.0-rc2/include/c++/16.1.0/cstdlib@0 2026-06-24 23:29:39
+++ ./gnat-x86_64-darwin-16.1.0-rc2/include/c++/16.1.0/cstdlib 2026-06-26 21:47:05
@@ -144,7 +144,7 @@
using ::atexit;
#if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT
- using ::at_quick_exit;
+// using ::at_quick_exit;
# endif
#endif
using ::atof;
@@ -167,7 +167,7 @@
using ::qsort;
#if __cplusplus >= 201103L
# ifdef _GLIBCXX_HAVE_QUICK_EXIT
- using ::quick_exit;
+// using ::quick_exit;
# endif
#endif
using ::rand;
Do you know if the same happens on macOS 15? As I said, we can’t really afford the complexity of supporting a different build for every existing macOS version, but I’d like to support versions N and N-1 (to this day, this is macOS 26 and macOS 15).
Besides, GitHub will at some point shut down macOS x86_64 runners, and at that time we’ll have no choice but to drop support for x86_64 on macOS…