[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 29 Jul 2014 13:48:13 +0000 (15:48 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 29 Jul 2014 13:48:13 +0000 (15:48 +0200)
2014-07-29  Doug Rupp  <rupp@adacore.com>

* sigtramp-armvxw.c: Enhance to handle RTP trampolining.
* init.c: Remove guard on sigtramp for ARM VxWorks RTP.

2014-07-29  Vincent Celier  <celier@adacore.com>

* switch-c.adb (Scan_Front_End_Switches): Do not fail when two
runtime directorie specified with two switches --RTS= designate
the same directory, even when there are no literarily the same.

2014-07-29  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Minor documentation clarification.
* switch-c.adb: Minor reformatting.

From-SVN: r213187

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/init.c
gcc/ada/sigtramp-armvxw.c
gcc/ada/switch-c.adb

index 4c97779155329225f798c7e6c3cfd212cabb0836..8ce008efa956bffb5c34771c6f92a0fbd1791c6b 100644 (file)
@@ -1,3 +1,19 @@
+2014-07-29  Doug Rupp  <rupp@adacore.com>
+
+       * sigtramp-armvxw.c: Enhance to handle RTP trampolining.
+       * init.c: Remove guard on sigtramp for ARM VxWorks RTP.
+
+2014-07-29  Vincent Celier  <celier@adacore.com>
+
+       * switch-c.adb (Scan_Front_End_Switches): Do not fail when two
+       runtime directorie specified with two switches --RTS= designate
+       the same directory, even when there are no literarily the same.
+
+2014-07-29  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Minor documentation clarification.
+       * switch-c.adb: Minor reformatting.
+
 2014-07-29  Robert Dewar  <dewar@adacore.com>
 
        * sem_prag.adb (Analyze_Pragma, case Allow_Integer_Address):
index e6cc74da608c4116ea99ef533a6cf04eff190b1d..169233834df112331a810889ce22b8ef1b46d49e 100644 (file)
@@ -8567,8 +8567,8 @@ objects with pragma Initialize_Scalars.
 The @var{xxx} ^string specified with the switch^option^ may be either
 @itemize @bullet
 @item ``@option{^in^INVALID^}'' requesting an invalid value where possible
-@item ``@option{^lo^LOW^}'' for the lowest possible value
-@item ``@option{^hi^HIGH^}'' for the highest possible value
+@item ``@option{^lo^LOW^}'' for the lowest possible value (all 0 bits)
+@item ``@option{^hi^HIGH^}'' for the highest possible value (all 1 bits)
 @item ``@option{@var{xx}}'' for a value consisting of repeated bytes with the
 value @code{16#@var{xx}#} (i.e., @var{xx} is a string of two hexadecimal digits).
 @end itemize
index 587638ba14864aaf24253bea3202a09c0a089475..41156cecd1eddf5b247364a54abfea037864ac12 100644 (file)
@@ -1703,7 +1703,9 @@ __gnat_install_handler ()
 #include <signal.h>
 #include <taskLib.h>
 
-#ifndef __RTP__
+#ifdef __RTP__
+#include <base/b_ucontext_t.h>
+#else
 #include <intLib.h>
 #include <iv.h>
 #endif
@@ -1911,7 +1913,7 @@ __gnat_error_handler (int sig, siginfo_t *si, void *sc)
   sigdelset (&mask, sig);
   sigprocmask (SIG_SETMASK, &mask, NULL);
 
-#if (defined (__ARMEL__) || defined (__PPC__)) && defined(_WRS_KERNEL)
+#if defined (__ARMEL__) || (defined (__PPC__) && defined (_WRS_KERNEL))
   /* On PowerPC, kernel mode, we process signals through a Call Frame Info
      trampoline, voiding the need for myriads of fallback_frame_state
      variants in the ZCX runtime.  We have no simple way to distinguish ZCX
index cbe774ff60704afedbdee3767c83ecd16323ba93..0cef508908e550932c250ee812443a6c24b41491 100644 (file)
 
 #include <vxWorks.h>
 #include <arch/../regs.h>
+#ifndef __RTP__
 #include <sigLib.h>
+#else
+#include <signal.h>
+#include <base/b_ucontext_t.h>
+#endif
 
 /* ----------------------
    -- General comments --
    Stubs are generated from toplevel asms and .cfi directives, much simpler
    to use and check for correctness than manual encodings of CFI byte
    sequences.  The general idea is to establish CFA as sigcontext->sc_pregs
-   and state where to find the registers as offsets from there.
+   (for DKM) and mcontext (for RTP) and state where to find the registers as
+   offsets from there.
 
    As of today, we support a stub providing CFI info for common
    registers (GPRs, LR, ...). We might need variants with support for floating
    point or altivec registers as well at some point.
 
-   Checking which variant should apply and getting at sc_pregs is simpler
-   to express in C (we can't use offsetof in toplevel asms and hardcoding
-   constants is not workable with the flurry of VxWorks variants), so this
-   is the choice for our toplevel interface.
+   Checking which variant should apply and getting at sc_pregs / mcontext
+   is simpler to express in C (we can't use offsetof in toplevel asms and
+   hardcoding constants is not workable with the flurry of VxWorks variants),
+   so this is the choice for our toplevel interface.
 
    Note that the registers we "restore" here are those to which we have
    direct access through the system sigcontext structure, which includes
    only a partial set of the non-volatiles ABI-wise.  */
 
-/* -----------------------------------------
-   -- Protypes for our internal asm stubs --
-   -----------------------------------------
+/* -------------------------------------------
+   -- Prototypes for our internal asm stubs --
+   -------------------------------------------
 
-   SC_PREGS is always expected to be SIGCONTEXT->sc_pregs.  Eventhough our
-   symbols will remain local, the prototype claims "extern" and not
-   "static" to prevent compiler complaints about a symbol used but never
-   defined.  */
+   Eventhough our symbols will remain local, the prototype claims "extern"
+   and not "static" to prevent compiler complaints about a symbol used but
+   never defined.  */
 
 /* sigtramp stub providing CFI info for common registers.  */
 
@@ -91,9 +96,17 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
 void __gnat_sigtramp (int signo, void *si, void *sc,
                      __sigtramphandler_t * handler)
 {
+#ifdef __RTP__
+  mcontext_t *mcontext = &((ucontext_t *) sc)->uc_mcontext;
+
+  /* Pass MCONTEXT in the fifth position so that the assembly code can find
+     it at the same stack location or in the same register as SC_PREGS.  */
+  __gnat_sigtramp_common (signo, si, mcontext, handler, mcontext);
+#else
   struct sigcontext * sctx = (struct sigcontext *) sc;
 
   __gnat_sigtramp_common (signo, si, sctx, handler, sctx->sc_pregs);
+#endif
 }
 
 
@@ -199,7 +212,7 @@ TCR("# Allocate frame and save the non-volatile") \
 TCR("# registers we're going to modify") \
 TCR("mov       ip, sp") \
 TCR("stmfd     sp!, {r"S(CFA_REG)", fp, ip, lr, pc}") \
-TCR("# Setup CFA_REG = sc_pregs, that we'll retrieve as our CFA value") \
+TCR("# Setup CFA_REG = context, which we'll retrieve as our CFA value") \
 TCR("ldr       r"S(CFA_REG)", [ip]") \
 TCR("")                 \
 TCR("# Call the real handler. The signo, siginfo and sigcontext") \
index 04a6fa188f36b4de536ca4e5c4b3c05ba6fd32fc..76b4c5d8001e643ddcca8d7bcab90bb3955b46c4 100644 (file)
@@ -38,6 +38,7 @@ with Warnsw;   use Warnsw;
 
 with Ada.Unchecked_Deallocation;
 with System.WCh_Con; use System.WCh_Con;
+with System.OS_Lib;
 
 package body Switch.C is
 
@@ -207,54 +208,70 @@ package body Switch.C is
               or else Switch_Chars (Ptr + 3) /= '='
             then
                Osint.Fail ("missing path for --RTS");
+
             else
-               --  Check that this is the first time --RTS is specified or if
-               --  it is not the first time, the same path has been specified.
+               declare
+                  Runtime_Dir : String_Access;
 
-               if RTS_Specified = null then
-                  RTS_Specified := new String'(Switch_Chars (Ptr + 4 .. Max));
+               begin
+                  if System.OS_Lib.Is_Absolute_Path
+                       (Switch_Chars (Ptr + 4 .. Max))
+                  then
+                     Runtime_Dir :=
+                       new String'
+                         (System.OS_Lib.Normalize_Pathname
+                            (Switch_Chars (Ptr + 4 .. Max)));
 
-               elsif
-                 RTS_Specified.all /= Switch_Chars (Ptr + 4 .. Max)
-               then
-                  Osint.Fail ("--RTS cannot be specified multiple times");
-               end if;
+                  else
+                     Runtime_Dir :=
+                       new String'(Switch_Chars (Ptr + 4 .. Max));
+                  end if;
 
-               --  Valid --RTS switch
+                  --  Check that this is the first time --RTS is specified
+                  --  or if it is not the first time, the same path has been
+                  --  specified.
 
-               Opt.No_Stdinc := True;
-               Opt.RTS_Switch := True;
+                  if RTS_Specified = null then
+                     RTS_Specified := Runtime_Dir;
 
-               RTS_Src_Path_Name :=
-                 Get_RTS_Search_Dir
-                   (Switch_Chars (Ptr + 4 .. Max), Include);
+                  elsif  RTS_Specified.all /= Runtime_Dir.all then
+                     Osint.Fail ("--RTS cannot be specified multiple times");
+                  end if;
 
-               RTS_Lib_Path_Name :=
-                 Get_RTS_Search_Dir
-                   (Switch_Chars (Ptr + 4 .. Max), Objects);
+                  --  Valid --RTS switch
 
-               if RTS_Src_Path_Name /= null
-                 and then RTS_Lib_Path_Name /= null
-               then
-                  --  Store the -fRTS switch (Note: Store_Compilation_Switch
-                  --  changes -fRTS back into --RTS for the actual output).
+                  Opt.No_Stdinc := True;
+                  Opt.RTS_Switch := True;
 
-                  Store_Compilation_Switch (Switch_Chars);
+                  RTS_Src_Path_Name :=
+                    Get_RTS_Search_Dir (Runtime_Dir.all, Include);
 
-               elsif RTS_Src_Path_Name = null
-                 and then RTS_Lib_Path_Name = null
-               then
-                  Osint.Fail ("RTS path not valid: missing " &
-                              "adainclude and adalib directories");
+                  RTS_Lib_Path_Name :=
+                    Get_RTS_Search_Dir (Runtime_Dir.all, Objects);
 
-               elsif RTS_Src_Path_Name = null then
-                  Osint.Fail ("RTS path not valid: missing " &
-                              "adainclude directory");
+                  if RTS_Src_Path_Name /= null
+                    and then RTS_Lib_Path_Name /= null
+                  then
+                     --  Store the -fRTS switch (Note: Store_Compilation_Switch
+                     --  changes -fRTS back into --RTS for the actual output).
 
-               elsif RTS_Lib_Path_Name = null then
-                  Osint.Fail ("RTS path not valid: missing " &
-                              "adalib directory");
-               end if;
+                     Store_Compilation_Switch (Switch_Chars);
+
+                  elsif RTS_Src_Path_Name = null
+                    and then RTS_Lib_Path_Name = null
+                  then
+                     Osint.Fail ("RTS path not valid: missing "
+                                 & "adainclude and adalib directories");
+
+                  elsif RTS_Src_Path_Name = null then
+                     Osint.Fail ("RTS path not valid: missing "
+                                 & "adainclude directory");
+
+                  elsif RTS_Lib_Path_Name = null then
+                     Osint.Fail ("RTS path not valid: missing "
+                                 & "adalib directory");
+                  end if;
+               end;
             end if;
 
             --  There are no other switches not starting with -gnat
@@ -363,7 +380,7 @@ package body Switch.C is
 
                         if C = 'b'
                           and then (Ptr /= First_Ptr + 1
-                                      or else not First_Switch)
+                                     or else not First_Switch)
                         then
                            Osint.Fail
                              ("-gnatd.b must be first if combined "