From: Olivier Hainque Date: Fri, 16 Aug 2024 15:08:32 +0000 (+0200) Subject: ada: Rework s-linux/osinte for arm/aarch64-android sigactions X-Git-Tag: basepoints/gcc-16~5415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeb0a0eae55a68069edd0d9074e7e3adfbceee64;p=thirdparty%2Fgcc.git ada: Rework s-linux/osinte for arm/aarch64-android sigactions Building an aarch64-android compiler with the current sources initially intended for arm-android expectedly trips on problems. This change is meant to address: ``` .../gcc/ada/rts % ../../gnat1 -quiet ... a-stbufi.adb -I. s-osinte.ads:591:07: error: component "sa_flags" overlaps "sa_mask" at line 590 ``` s-linux__android.ads makes hardcoded assumptions on the size of sigset_t, based on observations performed in the course of the arm port. Then sysem headers show sa_flags placed VERY differently between the 32 and the 64 bits variants. See android-sysroot/usr/include/bits/signal_types.h ``` %if defined(__LP64__) int sa_flags; \ union { \ sighandler_t sa_handler; \ void (*sa_sigaction)(int, struct siginfo*, void*); \ }; \ sigset_t sa_mask; \ void (*sa_restorer)(void); \ %else union { sighandler_t sa_handler; void (*sa_sigaction)(int, struct siginfo*, void*); }; sigset_t sa_mask; int sa_flags; void (*sa_restorer)(void); ``` gcc/ada/ChangeLog: * libgnarl/s-linux__android-arm.ads: New file, renaming of ... * libgnarl/s-linux__android.ads: ... this file. * libgnarl/s-linux__android-aarch64.ads: New file. Based on the -arm variant, with sa_ field positions adjusted. * Makefile.rtl (arm/aarch64-android pairs): Adjust accordingly. * libgnarl/s-osinte__android.ads: Rather than making assumptions on the actual type of the C sigset_t, use Os_Constants.SIZEOF_sigset_t to define an Ada sigset_t type of the proper size. Use C.int instead of unsigned_long for sa_flags. --- diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl index 9f4c6cd99dc..d4607e95eff 100644 --- a/gcc/ada/Makefile.rtl +++ b/gcc/ada/Makefile.rtl @@ -1414,7 +1414,6 @@ ifeq ($(strip $(filter-out arm% aarch64 linux-android%,$(target_cpu) $(target_os a-intnam.ads