summaryrefslogtreecommitdiff
path: root/system/gcc/201-ada.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/gcc/201-ada.patch')
-rw-r--r--system/gcc/201-ada.patch250
1 files changed, 78 insertions, 172 deletions
diff --git a/system/gcc/201-ada.patch b/system/gcc/201-ada.patch
index acb1e1f1b..d16bbbbaa 100644
--- a/system/gcc/201-ada.patch
+++ b/system/gcc/201-ada.patch
@@ -1,29 +1,8 @@
-diff --git a/gcc/ada/adadecode.c b/gcc/ada/adadecode.c
-index a63b7e7641b0..92155ef2025a 100644
---- a/gcc/ada/adadecode.c
-+++ b/gcc/ada/adadecode.c
-@@ -29,6 +29,7 @@
- * *
- ****************************************************************************/
-
-+#include "adaint.h" /* for a macro version of xstrdup. */
-
- #if defined(IN_RTS)
- #include "tconfig.h"
-@@ -42,8 +43,6 @@
- #include <stdio.h>
- #include <ctype.h>
-
--#include "adaint.h" /* for a macro version of xstrdup. */
--
- #ifndef ISDIGIT
- #define ISDIGIT(c) isdigit(c)
- #endif
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 414346558654..2586a1368903 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
-@@ -85,6 +85,8 @@
+@@ -101,6 +101,8 @@
#define _LARGEFILE64_SOURCE 1
#endif
@@ -32,7 +11,7 @@ index 414346558654..2586a1368903 100644
#ifdef IN_RTS
#include "tconfig.h"
#include "tsystem.h"
-@@ -202,8 +204,6 @@ UINT __gnat_current_ccs_encoding;
+@@ -243,8 +245,6 @@ UINT __gnat_current_ccs_encoding;
#include <utime.h>
#endif
@@ -45,7 +24,7 @@ diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 0d12f7e90209..74182446d4ac 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
-@@ -316,6 +316,7 @@ extern void *__gnat_lwp_self (void);
+@@ -319,6 +319,7 @@ extern void *__gnat_lwp_self (void);
/* Routines for interface to required CPU set primitives */
@@ -64,8 +43,8 @@ index f62cf1eb37dc..0b6c5fe6f0df 100644
+#include "adaint.h"
+
#ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
+ #include "runtime.h"
+ #include <stdlib.h>
@@ -51,8 +53,6 @@
#include "system.h"
#endif
@@ -86,9 +65,9 @@ index ff97abe36ef1..56aa3477c8cd 100644
+#include "adaint.h"
+
#ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
-@@ -38,8 +40,6 @@
+ #include "runtime.h"
+ #include <sys/stat.h>
+@@ -37,8 +39,6 @@
#include "system.h"
#endif
@@ -101,38 +80,16 @@ diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index cdcb531e2b3f..dde6b9948089 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
-@@ -52,6 +52,8 @@
- #include "vxWorks.h"
- #endif
-
-+#include "adaint.h"
-+
- #ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
-@@ -61,8 +63,6 @@
- #include "system.h"
- #endif
-
--#include "adaint.h"
--
- #ifdef __cplusplus
- extern "C" {
- #endif
-diff --git a/gcc/ada/exit.c b/gcc/ada/exit.c
-index 6274571c6f04..336b0f8f386b 100644
---- a/gcc/ada/exit.c
-+++ b/gcc/ada/exit.c
-@@ -33,6 +33,8 @@
+@@ -58,6 +58,8 @@
#include "vxWorks.h"
#endif
+#include "adaint.h"
+
#ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
-@@ -42,8 +44,6 @@
+ #include <string.h>
+ #else
+@@ -65,8 +67,6 @@
#include "system.h"
#endif
@@ -141,11 +98,11 @@ index 6274571c6f04..336b0f8f386b 100644
#ifdef __cplusplus
extern "C" {
#endif
-diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
+diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 0258f106d404..0416244ae428 100644
---- a/gcc/ada/gcc-interface/Makefile.in
-+++ b/gcc/ada/gcc-interface/Makefile.in
-@@ -1574,7 +1574,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
+--- a/gcc/ada/Makefile.rtl
++++ b/gcc/ada/Makefile.rtl
+@@ -2205,7 +2205,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
endif
# ARM linux, GNU eabi
@@ -165,9 +122,9 @@ index 5088ecffc4f1..02a45b3ce7ca 100644
+#include "adaint.h"
+
#ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
-@@ -65,7 +67,6 @@
+
+ #ifdef STANDALONE
+@@ -71,7 +73,6 @@
#include "system.h"
#endif
@@ -179,7 +136,7 @@ diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads b/gcc/ada/libgnarl/s-osinte__l
index 5bf4a5fe1d26..c52cc70dfbab 100644
--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/gcc/ada/libgnarl/s-osinte__linux.ads
-@@ -394,12 +394,6 @@ package System.OS_Interface is
+@@ -403,12 +403,6 @@ package System.OS_Interface is
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
@@ -192,7 +149,7 @@ index 5bf4a5fe1d26..c52cc70dfbab 100644
function pthread_rwlock_init
(mutex : access pthread_rwlock_t;
attr : access pthread_rwlockattr_t) return int;
-@@ -464,11 +458,6 @@ package System.OS_Interface is
+@@ -470,11 +464,6 @@ package System.OS_Interface is
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
@@ -208,7 +165,7 @@ diff --git a/gcc/ada/libgnarl/s-taprop__linux.adb b/gcc/ada/libgnarl/s-taprop__l
index e55cd65e54f6..32d72b3980a6 100644
--- a/gcc/ada/libgnarl/s-taprop__linux.adb
+++ b/gcc/ada/libgnarl/s-taprop__linux.adb
-@@ -202,9 +202,6 @@ package body System.Task_Primitives.Operations is
+@@ -198,9 +198,6 @@ package body System.Task_Primitives.Operations is
pragma Import
(C, GNAT_pthread_condattr_setup, "__gnat_pthread_condattr_setup");
@@ -218,7 +175,7 @@ index e55cd65e54f6..32d72b3980a6 100644
-- We do not have pragma Linker_Options ("-lcap"); here, because this
-- library is not present on many Linux systems. 'libcap' is the Linux
-- "capabilities" library, called by __gnat_has_cap_sys_nice.
-@@ -214,38 +211,6 @@ package body System.Task_Primitives.Operations is
+@@ -210,38 +207,6 @@ package body System.Task_Primitives.Operations is
-- Convert Ada priority to Linux priority. Priorities are 1 .. 99 on
-- GNU/Linux, so we map 0 .. 98 to 1 .. 99.
@@ -251,13 +208,13 @@ index e55cd65e54f6..32d72b3980a6 100644
- return Ceiling_Support;
- end Get_Ceiling_Support;
-
-- pragma Warnings (Off, "non-static call not allowed in preelaborated unit");
+- pragma Warnings (Off, "non-preelaborable call not allowed*");
- Ceiling_Support : constant Boolean := Get_Ceiling_Support;
-- pragma Warnings (On, "non-static call not allowed in preelaborated unit");
+- pragma Warnings (On, "non-preelaborable call not allowed*");
-- True if the locking policy is Ceiling_Locking, and the current process
-- has permission to use this policy. The process has permission if it is
-- running as 'root', or if the capability was set by the setcap command,
-@@ -348,7 +313,9 @@ package body System.Task_Primitives.Operations is
+@@ -344,7 +309,9 @@ package body System.Task_Primitives.Operations is
-- Init_Mutex --
----------------
@@ -267,7 +224,7 @@ index e55cd65e54f6..32d72b3980a6 100644
Mutex_Attr : aliased pthread_mutexattr_t;
Result, Result_2 : C.int;
-@@ -360,16 +327,7 @@ package body System.Task_Primitives.Operations is
+@@ -356,16 +323,7 @@ package body System.Task_Primitives.Operations is
return Result;
end if;
@@ -285,7 +242,7 @@ index e55cd65e54f6..32d72b3980a6 100644
Result := pthread_mutexattr_setprotocol
(Mutex_Attr'Access, PTHREAD_PRIO_INHERIT);
pragma Assert (Result = 0);
-@@ -409,11 +367,6 @@ package body System.Task_Primitives.Operations is
+@@ -405,11 +363,6 @@ package body System.Task_Primitives.Operations is
Result := pthread_rwlockattr_init (RWlock_Attr'Access);
pragma Assert (Result = 0);
@@ -301,91 +258,31 @@ diff --git a/gcc/ada/libgnat/s-dwalin.adb b/gcc/ada/libgnat/s-dwalin.adb
index a857b67132af..1e2bb4c545ad 100644
--- a/gcc/ada/libgnat/s-dwalin.adb
+++ b/gcc/ada/libgnat/s-dwalin.adb
-@@ -382,7 +382,7 @@ package body System.Dwarf_Lines is
-
- function Low (C : Dwarf_Context) return Address is
- begin
-- return C.Low;
-+ return To_Address (To_Integer (C.Low) + C.Load_Slide);
- end Low;
-
- ----------
-@@ -1210,19 +1210,21 @@ package body System.Dwarf_Lines is
- -- Discard symbols whose length is 0
- Sz := uint32 (Size (S));
-
-- -- Try to filter symbols at the same address. This is a best
-- -- effort as they might not be consecutive.
-- Addr := uint32 (Value (S) - uint64 (C.Low));
-- if Sz > 0 and then Addr /= Prev_Addr then
-- Nbr_Symbols := Nbr_Symbols + 1;
-- Prev_Addr := Addr;
--
-- if Phase = 2 then
-- C.Cache (Nbr_Symbols) :=
-- (First => Addr,
-- Size => Sz,
-- Sym => uint32 (Off (S)),
-- Line => 0);
-+ if Sz > 0 then
-+ -- Try to filter symbols at the same address. This is a best
-+ -- effort as they might not be consecutive.
-+ Addr := uint32 (Value (S) - uint64 (C.Low));
-+ if Addr /= Prev_Addr then
-+ Nbr_Symbols := Nbr_Symbols + 1;
-+ Prev_Addr := Addr;
-+
-+ if Phase = 2 then
-+ C.Cache (Nbr_Symbols) :=
-+ (First => Addr,
-+ Size => Sz,
-+ Sym => uint32 (Off (S)),
-+ Line => 0);
-+ end if;
- end if;
- end if;
-
-@@ -1267,6 +1269,10 @@ package body System.Dwarf_Lines is
+@@ -1538,7 +1538,11 @@ package body System.Dwarf_Lines is
-- Read table
+
loop
- Read_Aranges_Entry (C, Ar_Start, Ar_Len);
+ Read_Aranges_Entry (C, Addr_Size, Ar_Start, Ar_Len);
+ -- Skip references to discarded sections
+ while Ar_Start = 0 and Ar_Len /= 0 loop
-+ Read_Aranges_Entry (C, Ar_Start, Ar_Len);
++ Read_Aranges_Entry (C, Addr_Size, Ar_Start, Ar_Len);
+ end loop;
- exit when Ar_Start = 0 and Ar_Len = 0;
+ exit when Ar_Start = Null_Address and Ar_Len = 0;
Len := uint32 (Ar_Len);
-diff --git a/gcc/ada/libgnat/s-trasym__dwarf.adb b/gcc/ada/libgnat/s-trasym__dwarf.adb
-index db7c5eb4cdd8..3cd60ecbc37b 100644
---- a/gcc/ada/libgnat/s-trasym__dwarf.adb
-+++ b/gcc/ada/libgnat/s-trasym__dwarf.adb
-@@ -123,7 +123,8 @@ package body System.Traceback.Symbolic is
- -- Return the String contained in Item, up until the first NUL character
-
- pragma Warnings (Off, "*Add_Module_To_Cache*");
-- procedure Add_Module_To_Cache (Module_Name : String);
-+ procedure Add_Module_To_Cache (Module_Name : String;
-+ Load_Address : System.Address);
- -- To be called by Build_Cache_For_All_Modules to add a new module to the
- -- list. May not be referenced.
-
-@@ -217,12 +218,13 @@ package body System.Traceback.Symbolic is
- -- Add_Module_To_Cache --
- -------------------------
-
-- procedure Add_Module_To_Cache (Module_Name : String) is
-+ procedure Add_Module_To_Cache (Module_Name : String;
-+ Load_Address : System.Address) is
- Module : Module_Cache_Acc;
- Success : Boolean;
- begin
- Module := new Module_Cache;
-- Init_Module (Module.all, Success, Module_Name);
-+ Init_Module (Module.all, Success, Module_Name, Load_Address);
- if not Success then
- Free (Module);
- return;
+diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads
+index 3d6e345a1ba9..cfe0b4d3ca6c 100644
+--- a/gcc/ada/libgnat/s-parame.ads
++++ b/gcc/ada/libgnat/s-parame.ads
+@@ -102,7 +102,7 @@ package System.Parameters is
+ -- Characteristics of time_t type --
+ ------------------------------------
+
+- time_t_bits : constant := Long_Integer'Size;
++ time_t_bits : constant := Long_Long_Integer'Size;
+ -- Number of bits in type time_t
+
+ ----------------------------------------------
diff --git a/gcc/ada/libgnat/s-tsmona__linux.adb b/gcc/ada/libgnat/s-tsmona__linux.adb
index cbebd0652048..c882aa64a6e2 100644
--- a/gcc/ada/libgnat/s-tsmona__linux.adb
@@ -468,7 +365,7 @@ index cbebd0652048..c882aa64a6e2 100644
- while lm /= null loop
- if Big_String_Conv.To_Pointer (lm.l_name) (1) /= ASCII.NUL then
- -- Discard non-file (like the executable itself or the gate).
-- Add_Module_To_Cache (Value (lm.l_name));
+- Add_Module_To_Cache (Value (lm.l_name), lm.l_addr);
- end if;
- lm := lm.l_next;
- end loop;
@@ -487,8 +384,8 @@ index c101d968a851..43cdd51e8320 100644
+#include "adaint.h"
+
#ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
+ #include "runtime.h"
+ #include <sys/stat.h>
@@ -53,8 +55,6 @@
#endif
#endif
@@ -509,9 +406,9 @@ index 70ad6cd3282a..eb92de1b2137 100644
+#include "adaint.h"
+
#ifdef IN_RTS
- #include "tconfig.h"
- #include "tsystem.h"
-@@ -40,7 +42,6 @@
+ #include "runtime.h"
+ #else
+@@ -39,7 +41,6 @@
#include "system.h"
#endif
@@ -531,8 +428,8 @@ index 98b3901cb16f..98db6a14c2d5 100644
+
#ifdef IN_RTS
#define POSIX
- #include "tconfig.h"
-@@ -72,8 +74,6 @@
+ #include "runtime.h"
+@@ -74,8 +76,6 @@
extern struct tm *localtime_r(const time_t *, struct tm *);
#endif
@@ -541,25 +438,34 @@ index 98b3901cb16f..98db6a14c2d5 100644
/* Don't use macros versions of this functions on VxWorks since they cause
imcompatible changes in some VxWorks versions */
#ifdef __vxworks
-diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c
-index 7025f57d645e..074845584958 100644
---- a/gcc/ada/terminals.c
-+++ b/gcc/ada/terminals.c
-@@ -1112,7 +1112,6 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
- (HP-UX) */
- #if !defined (__hpux__) && !defined (BSD) && !defined (__APPLE__) \
- && !defined (__rtems__) && !defined (__QNXNTO__)
--# include <termio.h>
- #endif
-
- #include <sys/ioctl.h>
-@@ -1159,7 +1158,8 @@ __gnat_setup_winsize (void *desc, int rows, int columns)
+--- a/gcc/ada/terminals.c 2019-01-08 10:54:04.000000000 +0100
++++ b/gcc/ada/terminals.c 2019-05-15 13:14:09.935742526 +0200
+@@ -1136,7 +1136,7 @@
+ /* POSIX does not specify how to open the master side of a terminal.Several
+ methods are available (system specific):
+ 1- using a cloning device (USE_CLONE_DEVICE)
+- 2- getpt (USE_GETPT)
++ 2- posix_openpt (USE_POSIX_OPENPT)
+ 3- openpty (USE_OPENPTY)
+
+ When using the cloning device method, the macro USE_CLONE_DEVICE should
+@@ -1150,7 +1150,7 @@
#if defined (__APPLE__) || defined (BSD)
#define USE_OPENPTY
#elif defined (__linux__)
-#define USE_GETPT
-+#include <pty.h>
-+#define USE_OPENPTY
++#define USE_POSIX_OPENPT
#elif defined (__sun__)
#define USE_CLONE_DEVICE "/dev/ptmx"
#elif defined (_AIX)
+@@ -1199,8 +1199,8 @@
+ int master_fd = -1;
+ char *slave_name = NULL;
+
+-#ifdef USE_GETPT
+- master_fd = getpt ();
++#if defined(USE_POSIX_OPENPT)
++ master_fd = posix_openpt(O_RDWR | O_NOCTTY);
+ #elif defined (USE_OPENPTY)
+ status = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
+ #elif defined (USE_CLONE_DEVICE)