diff --git a/build.sh b/build.sh index bc6de20..27a0b89 100755 --- a/build.sh +++ b/build.sh @@ -57,7 +57,7 @@ fi # Install dependencies sudo apt update -sudo apt install -y build-essential curl +sudo apt install -y build-essential curl gnat-11 sudo apt install -y libgmp-dev libmpfr-dev libmpc-dev zlib1g-dev libisl-dev libtinfo5 libncurses5 pushd $_TMP_DIR @@ -130,7 +130,7 @@ $GCC_SRC_DIR/configure \ --enable-libatomic-ifuncs=no \ --prefix=$_TMP_DIR/newer-toolchain \ --with-gmp --with-mpfr --with-mpc --with-system-zlib \ - --enable-languages=c,c++,fortran \ + --enable-languages=c,c++,fortran,ada \ --enable-plugins --enable-libgomp \ --enable-gnu-indirect-function \ --disable-libcilkrts --disable-libsanitizer \ diff --git a/patches/0005-ada-gnat-handler.patch b/patches/0005-ada-gnat-handler.patch new file mode 100644 index 0000000..8dc4f5d --- /dev/null +++ b/patches/0005-ada-gnat-handler.patch @@ -0,0 +1,13 @@ +This hanlder is only for arm (32-bit), so disable it on other archs. + +--- a/gcc/ada/init.c ++++ b/gcc/ada/init.c +@@ -2631,7 +2631,7 @@ + __gnat_handler_installed = 1; + } + +-#elif defined(__ANDROID__) ++#elif defined(__ANDROID__) && defined(__arm__) + + /*******************/ + /* Android Section */ diff --git a/patches/0006-ada-libgnarl-syscall.patch b/patches/0006-ada-libgnarl-syscall.patch new file mode 100644 index 0000000..ce10b94 --- /dev/null +++ b/patches/0006-ada-libgnarl-syscall.patch @@ -0,0 +1,22 @@ +Fix error like `a-intnam.ads:164:25: "SIGSYS" not declared in "OS_Interface"` on ARM (32-bit) + +--- a/gcc/ada/libgnarl/s-linux__android.ads ++++ b/gcc/ada/libgnarl/s-linux__android.ads +@@ -109,6 +109,7 @@ + SIGPROF : constant := 27; -- profiling timer expired + SIGXCPU : constant := 24; -- CPU time limit exceeded + SIGXFSZ : constant := 25; -- filesize limit exceeded ++ SIGSYS : constant := 31; -- bad system call + SIGUNUSED : constant := 31; -- unused signal (GNU/Linux) + SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux) + SIG32 : constant := 32; -- glibc internal signal +--- a/gcc/ada/libgnarl/s-osinte__android.ads ++++ b/gcc/ada/libgnarl/s-osinte__android.ads +@@ -112,6 +112,7 @@ + SIGPROF : constant := System.Linux.SIGPROF; + SIGXCPU : constant := System.Linux.SIGXCPU; + SIGXFSZ : constant := System.Linux.SIGXFSZ; ++ SIGSYS : constant := System.Linux.SIGSYS; + SIGUNUSED : constant := System.Linux.SIGUNUSED; + SIGSTKFLT : constant := System.Linux.SIGSTKFLT; + diff --git a/patches/0007-ada-x64-nallfl.patch b/patches/0007-ada-x64-nallfl.patch new file mode 100644 index 0000000..6d6aa97 --- /dev/null +++ b/patches/0007-ada-x64-nallfl.patch @@ -0,0 +1,16 @@ +Fix error like following on x86_64. + +a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on return value +a-nallfl.ads:48:13: warning: intrinsic binding type mismatch on argument 1 +a-nallfl.ads:48:13: warning: profile of "Sin" doesn't match the builtin it binds + +--- a/gcc/ada/Makefile.rtl ++++ b/gcc/ada/Makefile.rtl +@@ -2685,6 +2685,7 @@ + a-exetim.adb