Skip to content
Snippets Groups Projects
Commit c4e90a24 authored by Olivier Hainque's avatar Olivier Hainque Committed by Marc Poulhiès
Browse files

ada: Rework the Android sigtramp implementation

The initial signal handling code introduced for aarch64-android
overlooked details of the tasking runtime, not in the initial testing
perimeter.

Specifically, a reference to __gnat_sigtramp from __gnat_error_handler,
initially introduced for the arm port, was prevented if !arm on the
grounds that other ports would rely on kernel CFI. aarch64-android
does provide kernel CFI and __gnat_sigtramp was not provided for this
configuration.

But there is a similar reference from s-intman__android, which kicks in
as soon as the tasking runtime gets activated, triggering link failures.

Testing for more precise target specific parameters from Ada
code is inconvenient and replicating the logic is not attractive in
any case, so this change addresses the problem in the following
fashion:

- Always provide a __gnat_sigtramp entry point, common to the
  tasking and non-tasking signal handling code for all the Android
  configurations,

- There (C code), from target definition macros, select a path
  that either routes directly to the actual signal handler or goes
  through the intermediate layer providing hand crafted CFI
  information which allows unwinding up to the interrupted code.

- Similarily to what was done for VxWorks, move the arm specific
  definitions to a separate header file to make the general structure
  of the common C code easier to grasp,

- Adjust the comments in the common sigtramp.h header to
  account for such an organisation possibility.

gcc/ada/ChangeLog:
	* sigtramp-armdroid.c: Refactor into ...
	* sigtramp-android.c, sigtramp-android-asm.h: New files.
	* Makefile.rtl (arm/aarch64-android section): Add
	sigtramp-android.o to EXTRA_LIBGNAT_OBJS unconditionally. Add
	sigtramp.h and sigtramp-android-asm.h to EXTRA_LIBGNAT_SRCS.
	* init.c (android section, __gnat_error_handler): Defer to
	__gnat_sigramp unconditionally again.
	* sigtramp.h: Adjust comments to allow neutral signal handling
	relays, merely forwarding to the underlying handler without any
	intermediate CFI magic.
parent c4d9a73e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment