From d07035daf0a5fa5bb14bab9bd5199d713e7b525b Mon Sep 17 00:00:00 2001 From: pmderodat Date: Wed, 8 Nov 2017 17:32:18 +0000 Subject: 2017-11-08 Piotr Trojanek * lib-xref.ads, lib-xref-spark_specific.adb (Traverse_Compilation_Unit): Move declaration to package body. 2017-11-08 Hristian Kirtchev * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration): Obtain the type of the renaming from its defining entity, rather then the subtype mark as there may not be a subtype mark. 2017-11-08 Jerome Lambourg * adaint.c, s-oscons-tmplt.c, init.c, libgnat/system-qnx-aarch64.ads, libgnarl/a-intnam__qnx.ads, libgnarl/s-intman__qnx.adb, libgnarl/s-osinte__qnx.ads, libgnarl/s-qnx.ads, libgnarl/s-taprop__qnx.adb, s-oscons-tmplt.c, sigtramp-qnx.c, terminals.c: Initial port of GNAT for aarch64-qnx 2017-11-08 Elisa Barboni * exp_util.adb (Find_DIC_Type): Move... * sem_util.ads, sem_util.adb (Find_DIC_Type): ... here. 2017-11-08 Justin Squirek * sem_res.adb (Resolve_Allocator): Add info messages corresponding to the owner and corresponding coextension. 2017-11-08 Ed Schonberg * sem_aggr.adb (Resolve_Delta_Aggregate): Divide into the following separate procedures. (Resolve_Delta_Array_Aggregate): Previous code form Resolve_Delta_Aggregate. (Resolve_Delta_Record_Aggregate): Extend previous code to cover latest ARG decisions on the legality rules for delta aggregates for records: in the case of a variant record, components from different variants cannot be specified in the delta aggregate, and this must be checked statically. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254547 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/init.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) (limited to 'gcc/ada/init.c') diff --git a/gcc/ada/init.c b/gcc/ada/init.c index 4071bb461e7..e1cf4fa660e 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -2516,6 +2516,104 @@ __gnat_install_handler (void) __gnat_handler_installed = 1; } +#elif defined(__QNX__) + +/***************/ +/* QNX Section */ +/***************/ + +#include +#include +#include +#include "sigtramp.h" + +void +__gnat_map_signal (int sig, + siginfo_t *si ATTRIBUTE_UNUSED, + void *mcontext ATTRIBUTE_UNUSED) +{ + struct Exception_Data *exception; + const char *msg; + + switch(sig) + { + case SIGFPE: + exception = &constraint_error; + msg = "SIGFPE"; + break; + case SIGILL: + exception = &constraint_error; + msg = "SIGILL"; + break; + case SIGSEGV: + exception = &storage_error; + msg = "stack overflow or erroneous memory access"; + break; + case SIGBUS: + exception = &constraint_error; + msg = "SIGBUS"; + break; + default: + exception = &program_error; + msg = "unhandled signal"; + } + + Raise_From_Signal_Handler (exception, msg); +} + +static void +__gnat_error_handler (int sig, siginfo_t *si, void *ucontext) +{ + __gnat_sigtramp (sig, (void *) si, (void *) ucontext, + (__sigtramphandler_t *)&__gnat_map_signal); +} + +void +__gnat_install_handler (void) +{ + struct sigaction act; + int err; + + act.sa_handler = __gnat_error_handler; + act.sa_flags = SA_NODEFER | SA_SIGINFO; + sigemptyset (&act.sa_mask); + + /* Do not install handlers if interrupt state is "System" */ + if (__gnat_get_interrupt_state (SIGFPE) != 's') { + err = sigaction (SIGFPE, &act, NULL); + if (err == -1) { + err = errno; + perror ("error while attaching SIGFPE"); + perror (strerror (err)); + } + } + if (__gnat_get_interrupt_state (SIGILL) != 's') { + sigaction (SIGILL, &act, NULL); + if (err == -1) { + err = errno; + perror ("error while attaching SIGFPE"); + perror (strerror (err)); + } + } + if (__gnat_get_interrupt_state (SIGSEGV) != 's') { + sigaction (SIGSEGV, &act, NULL); + if (err == -1) { + err = errno; + perror ("error while attaching SIGFPE"); + perror (strerror (err)); + } + } + if (__gnat_get_interrupt_state (SIGBUS) != 's') { + sigaction (SIGBUS, &act, NULL); + if (err == -1) { + err = errno; + perror ("error while attaching SIGFPE"); + perror (strerror (err)); + } + } + __gnat_handler_installed = 1; +} + #elif defined (__DJGPP__) void @@ -2648,7 +2746,7 @@ __gnat_install_handler (void) #if defined (_WIN32) || defined (__INTERIX) \ || defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__) \ - || defined (__OpenBSD__) || defined (__DragonFly__) + || defined (__OpenBSD__) || defined (__DragonFly__) || defined(__QNX__) #define HAVE_GNAT_INIT_FLOAT -- cgit v1.2.1 From 40771d7e1d41840512ecb110e7c7d93ea27e9b68 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 12:10:30 +0000 Subject: 2017-11-09 Pascal Obry * libgnarl/s-taprop__mingw.adb: On Windows, initialize the thead handle only for foreign threads. We initialize the thread handle only if not yet initialized. This happens in Enter_Task for foreign threads only. But for native threads (Ada tasking) we do want to keep the real handle (from Create_Task) to be able to free the corresponding resources in Finalize_TCB (CloseHandle). 2017-11-09 Yannick Moy * sem_attr.adb (Analyze_Attribute): Default initialize P_Type, P_Base_Type. (Error_Attr_P): Fix name in pragma No_Return. (Unexpected_Argument): Add pragma No_Return. (Placement_Error): Add pragma No_Return. 2017-11-09 Javier Miranda * exp_disp.adb (Elab_Flag_Needed): Elaboration flag not needed when the dispatch table is statically built. (Make_DT): Declare constant the Interface_Table object associated with an statically built dispatch table. For this purpose the Offset_To_Top value of each interface is computed using the dummy object. * exp_ch3.adb (Build_Init_Procedure): Do not generate code initializing the Offset_To_Top field of secondary dispatch tables when the dispatch table is statically built. (Initialize_Tag): Do not generate calls to Register_Interface_Offset when the dispatch table is statically built. * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Document the new GNAT restriction Static_Dispatch_Tables. * gnat_rm.texi: Regenerate. 2017-11-09 Hristian Kirtchev * sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reorder declarations to avoid a dormant bug. 2017-11-09 Jerome Lambourg * init.c: Define missing __gnat_alternate_stack for QNX. Set it to 0, as such capability is not available on the OS. * link.c: Make sure linker options for QNX are correct. * libgnarl/s-osinte__qnx.ads: Add some missing bindings to pthread. * libgnarl/s-taprop__qnx.adb: New, derived from s-taprop__posix.adb. This brings in particular a workaround with locks priority ceiling where a higher priority task is allowed to lock a lower ceiling priority lock. This also fixes the scheduling of FIFO tasks when the priority of a task is lowered. * libgnat/system-qnx-aarch64.ads: Fix priority ranges. 2017-11-09 Yannick Moy * erroutc.adb (Output_Error_Msgs): Justify CodePeer false positive message. * gnatbind.adb (Scan_Bind_Arg): Simplify test to remove always true condition. * namet.adb (Copy_One_Character): Add assumption for static analysis, as knowledge that Hex(2) is in the range 0..255 is too complex for CodePeer. (Finalize): Add assumption for static analysis, as the fact that there are symbols in the table depends on a global invariant at this point in the program. * set_targ.adb (Check_Spaces): Justify CodePeer false positive message. * stylesw.adb (Save_Style_Check_Options): Rewrite to avoid test always true. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254573 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/init.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/ada/init.c') diff --git a/gcc/ada/init.c b/gcc/ada/init.c index e1cf4fa660e..608f41fd748 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -2568,6 +2568,10 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext) (__sigtramphandler_t *)&__gnat_map_signal); } +/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. */ +/* sigaltstack is currently not supported by QNX7 */ +char __gnat_alternate_stack[0]; + void __gnat_install_handler (void) { -- cgit v1.2.1