This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3.4/3.5 PATCH: Allow IRIX 5 Ada bootstrap
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Arnaud Charlet <charlet at ACT-Europe dot FR>
- Date: Wed, 21 Jan 2004 19:47:06 +0100 (MET)
- Subject: 3.4/3.5 PATCH: Allow IRIX 5 Ada bootstrap
I'm about to allow mainline GNAT to bootstrap on IRIX 5.3
(mips-sgi-irix5.3), starting from the old ACT GNAT 3.11p binaries.
The following patch was necessary to get there:
* I need to remove -lathread from THREADSLIB, otherwise I get link failures
during make gnatlib_and_tools. I couldn't locate any information (or
even source code) for it. I may have more look with old SGI Ada CDs if I
can find them.
* Functions_Return_By_DSP must be set to False. Otherwise, I get an ICE
compiling a-stwima.adb:
../../xgcc -B../../ -c -g -O2 -W -Wall -gnatpg a-stwima.adb -o a-stwima.o
a-stwima.adb:0: note: -g is only supported using GNU as,
a-stwima.adb:0: note: -g option disabled
+===========================GNAT BUG DETECTED==============================+
| 3.5.0 20040119 (experimental) (mips-sgi-irix5.3) GCC error: |
| in handle_epilogue_set, at function.c:7584 |
| Error detected at a-stwima.adb:580:4 |
This still happens at -O0 and is most likely a duplicate of PR
middle-end/6552 (still unfixed). This workaround has been applied for
the N32 ABI on IRIX 6, too.
* ZCX_By_Default and Front_End_ZCX_Support are set to False, otherwise
gnatlink didn't link:
../../xgcc -B../../ -DIN_GCC `echo -g -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fno-common |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'` -o ../../gnatlink b_gnatl.o gnatlink.o link.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o gnatvsn.o hostparm.o namet.o opt.o osint.o output.o rident.o sdefault.o stylesw.o switch.o table.o tree_io.o types.o validsw.o widechar.o \
../rts/libgnat.a ../../prefix.o ../../version.o ../../../libiberty/libiberty.a -lexc -lexc
ld: WARNING 84: ../../libgcc.a is not used for resolving any symbol.
ld: WARNING 84: ../../libgcc.a is not used for resolving any symbol.
ld: WARNING 84: ../../libgcc_eh.a is not used for resolving any symbol.
ld: ERROR 33: Unresolved text symbol "__gnat_SDP_Table_Build" -- 1st referenced by b_gnatl.o.
ld: INFO 60: Output file removed because of error.
collect2: ld returned 1 exit status
make[2]: *** [../../gnatlink] Error 1
__gnat_SDP_Table_Build would be have to be generated by gnatbind -C, but
isn't.
* The changes to 5gtaprop.adb and 5gtasinf.adb fix compilation
warnings/errors:
../../xgcc -B../../ -c -g -O2 -W -Wall -gnatpg s-taprop.adb -o s-taprop.o
s-taprop.adb:0: note: -g is only supported using GNU as,
s-taprop.adb:0: note: -g option disabled
s-taprop.adb:141:27: warning: formal parameter "T" is not referenced
s-taprop.adb:141:43: warning: formal parameter "On" is not referenced
s-taprop.adb:212:52: warning: formal parameter "Level" is not referenced
s-taprop.adb:346:07: warning: formal parameter "Reason" is not referenced
s-taprop.adb:372:07: warning: formal parameter "Reason" is not referenced
s-taprop.adb:534:07: warning: formal parameter "Reason" is not referenced
s-taprop.adb:804:07: warning: variable "Result" is assigned but never read
s-taprop.adb:842:29: warning: formal parameter "Self_ID" is not referenced
make[2]: *** [s-taprop.o] Error 1
../../xgcc -B../../ -c -g -O2 -W -Wall -gnatpg s-tasinf.adb -o s-tasinf.o
s-tasinf.adb:0: note: -g is only supported using GNU as,
s-tasinf.adb:0: note: -g option disabled
s-tasinf.adb:223:07: warning: "Attr" is not modified, could be declared constant
s-tasinf.adb:270:07: warning: "Sproc" is not modified, could be declared constant
s-tasinf.adb:319:07: warning: "Sproc" is not modified, could be declared constant
make[2]: *** [s-tasinf.o] Error 1
I'm currently bootstrapping mainline starting from GNAT 3.15p with
optimization disabled (-O2 produced lots of comparison failures), which
seems to be ok.
With that 3.5.0 based GNAT, I'll run another regular (i.e. -O2) bootstrap
and testsuite run to check if this works out, too.
Ok for mainline and 3.4 branch if it passes?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Tue Jan 20 12:03:22 2004 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* Makefile.in (mips-sgi-irix5): Remove -lathread from THREADSLIB.
* 5fsystem.ads (Functions_Return_By_DSP): Set to False.
(ZCX_By_Default): Likewise.
(Front_End_ZCX_Support): Likewise.
* 5gtaprop.adb (Stack_Guard): Mark T, On unreferenced.
(Initialize_Lock): Mark Level unreferenced.
(Sleep): Mark Reason unreferenced.
(Timed_Sleep): Likewise.
(Wakeup): Likewise.
(Exit_Task): Use Result.
(Check_No_Locks): Mark Self_ID unreferenced.
* 5gtasinf.adb (New_Sproc): Make Attr constant.
(Bound_Thread_Attributes): Make Sproc constant.
(New_Bound_Thread_Attributes): Likewise.
Index: gcc/ada/5fsystem.ads
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5fsystem.ads,v
retrieving revision 1.6
diff -u -p -r1.6 5fsystem.ads
--- gcc/ada/5fsystem.ads 21 Oct 2003 13:41:51 -0000 1.6
+++ gcc/ada/5fsystem.ads 20 Jan 2004 21:24:37 -0000
@@ -124,7 +124,7 @@ private
Exit_Status_Supported : constant Boolean := True;
Fractional_Fixed_Ops : constant Boolean := False;
Frontend_Layout : constant Boolean := False;
- Functions_Return_By_DSP : constant Boolean := True;
+ Functions_Return_By_DSP : constant Boolean := False;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
OpenVMS : constant Boolean := False;
@@ -138,9 +138,9 @@ private
Support_Long_Shifts : constant Boolean := True;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- ZCX_By_Default : constant Boolean := True;
+ ZCX_By_Default : constant Boolean := False;
GCC_ZCX_Support : constant Boolean := False;
- Front_End_ZCX_Support : constant Boolean := True;
+ Front_End_ZCX_Support : constant Boolean := False;
-- Obsolete entries, to be removed eventually (bootstrap issues!)
Index: gcc/ada/5gtaprop.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5gtaprop.adb,v
retrieving revision 1.8
diff -u -p -r1.8 5gtaprop.adb
--- gcc/ada/5gtaprop.adb 5 Jan 2004 15:20:42 -0000 1.8
+++ gcc/ada/5gtaprop.adb 20 Jan 2004 21:24:37 -0000
@@ -139,6 +139,9 @@ package body System.Task_Primitives.Oper
-- ??? Check the comment above
procedure Stack_Guard (T : ST.Task_ID; On : Boolean) is
+ pragma Unreferenced (T);
+ pragma Unreferenced (On);
+
begin
null;
end Stack_Guard;
@@ -210,6 +213,8 @@ package body System.Task_Primitives.Oper
end Initialize_Lock;
procedure Initialize_Lock (L : access RTS_Lock; Level : Lock_Level) is
+ pragma Unreferenced (Level);
+
Attributes : aliased pthread_mutexattr_t;
Result : Interfaces.C.int;
@@ -345,6 +350,8 @@ package body System.Task_Primitives.Oper
(Self_ID : ST.Task_ID;
Reason : System.Tasking.Task_States)
is
+ pragma Unreferenced (Reason);
+
Result : Interfaces.C.int;
begin
@@ -373,6 +380,8 @@ package body System.Task_Primitives.Oper
Timedout : out Boolean;
Yielded : out Boolean)
is
+ pragma Unreferenced (Reason);
+
Check_Time : constant Duration := Monotonic_Clock;
Abs_Time : Duration;
Request : aliased struct_timeval;
@@ -533,6 +542,8 @@ package body System.Task_Primitives.Oper
(T : ST.Task_ID;
Reason : System.Tasking.Task_States)
is
+ pragma Unreferenced (Reason);
+
Result : Interfaces.C.int;
begin
Result := pthread_cond_signal (T.Common.LL.CV'Access);
@@ -805,6 +816,8 @@ package body System.Task_Primitives.Oper
begin
Result := pthread_set_ada_tcb (pthread_self, System.Null_Address);
+
+ pragma Assert (Result = 0);
end Exit_Task;
----------------
@@ -840,6 +853,8 @@ package body System.Task_Primitives.Oper
--------------------
function Check_No_Locks (Self_ID : ST.Task_ID) return Boolean is
+ pragma Unreferenced (Self_ID);
+
begin
return True;
end Check_No_Locks;
Index: gcc/ada/5gtasinf.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5gtasinf.adb,v
retrieving revision 1.5
diff -u -p -r1.5 5gtasinf.adb
--- gcc/ada/5gtasinf.adb 24 Apr 2003 17:53:51 -0000 1.5
+++ gcc/ada/5gtasinf.adb 20 Jan 2004 21:24:37 -0000
@@ -220,7 +220,7 @@ package body System.Task_Info is
NDPRI : Non_Degrading_Priority := NDP_NONE)
return sproc_t
is
- Attr : Sproc_Attributes :=
+ Attr : constant Sproc_Attributes :=
(Sproc_Resources, CPU, Resident, NDPRI);
begin
@@ -267,7 +267,7 @@ package body System.Task_Info is
NDPRI : Non_Degrading_Priority := NDP_NONE)
return Thread_Attributes
is
- Sproc : sproc_t := New_Sproc
+ Sproc : constant sproc_t := New_Sproc
(Sproc_Resources, CPU, Resident, NDPRI);
begin
@@ -316,7 +316,7 @@ package body System.Task_Info is
NDPRI : Non_Degrading_Priority := NDP_NONE)
return Task_Info_Type
is
- Sproc : sproc_t := New_Sproc
+ Sproc : constant sproc_t := New_Sproc
(Sproc_Resources, CPU, Resident, NDPRI);
begin
Index: gcc/ada/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/Makefile.in,v
retrieving revision 1.65
diff -u -p -r1.65 Makefile.in
--- gcc/ada/Makefile.in 16 Jan 2004 08:51:38 -0000 1.65
+++ gcc/ada/Makefile.in 20 Jan 2004 21:24:37 -0000
@@ -913,7 +913,7 @@ ifeq ($(strip $(filter-out mips sgi irix
g-soccon.ads<3gsoccon.ads \
system.ads<5fsystem.ads
- THREADSLIB = -lathread
+ THREADSLIB =
endif
TOOLS_TARGET_PAIRS = mlib-tgt.adb<5gml-tgt.adb