This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]PR target/10129 ADA bootstrap failure on Darwin
- From: Adriaan van Os <gcc at microbizz dot nl>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Nov 2003 22:53:51 +0100
- Subject: [PATCH]PR target/10129 ADA bootstrap failure on Darwin
Andrew Pinski wrote:
The problem is that the Ada front end is marking
a variable as common but is also having a DECL_INITIAL which
confuses the Darwin back-end.
This patch unconfuses the Darwin back-end.
I now get back to the original bootstrap failure of:
stage1/xgcc -Bstage1/
-B/Volumes/UFS_Partition/pinskia/fsf-clean/powerpc-apple-darwin6.6/
bin/ -c -g -O2 -gnatpg -gnata -I- -I. -Iada
-I/Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/ada
/Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/ada/ali.adb
-o ada/ali.o
/var/tmp//cc1BemnQ.s:10438:non-relocatable subtraction expression,
"L00000000149$pb" minus "LSJR780"
/var/tmp//cc1BemnQ.s:10438:symbol: "L00000000149$pb" can't be
undefined in a subtraction expression
/var/tmp//cc1BemnQ.s:10437:non-relocatable subtraction expression,
"L00000000149$pb" minus "LSJR780"
/var/tmp//cc1BemnQ.s:10437:symbol: "L00000000149$pb" can't be
undefined in a subtraction expression
/var/tmp//cc1BemnQ.s:unknown:Undefined local symbol L00000000149$pb
This is a bug in restoring the PIC register.
So I am getting closer to bootstraping with Ada, will look into this
other problem later today.
With Pascal, based on gcc-3.3.2, I run into a similar problem on
powerpc-apple-darwin. See below.
S i d e b a r
The extra compiler argument passed (--longjmp-all-nonlocal-labels) is
needed because PR 10901 is still open. In fact, the compiler argument
has only been created because nonlocal goto's tend to be broken in gcc.
With some luck, we get a fix for some platform in some version of gcc,
but invariably the problems come back for some other platform in a
later version of gcc.
E n d S i d e b a r
The workaround, by the way, is to pass -O2 instead of -O3.
Regards,
Adriaan van Os
<http://www.microbizz.nl/gpc.html>
[G4:~/gnu/testgpc/test-20030830] adriaan% make MASK=nlgpp2.pas
EXTRA_PFLAGS=--longjmp-all-nonlocal-labels
Running the GPC Test Suite. This may take a while ...
rm -f *.dat *.o *.s *.i *.gpi *.gpd *.gpc core a.out stderr.out *.exe
testmake.tmp dummy.c dummy.pas dummy.out diff_cr*.tmp fixcr fixcr.exe
rm -f todo/a.out todo/*.exe todo/*.o todo/*.s todo/*.i todo/*.gpi
todo/*.gpd todo/core
{ gpc --version | head -1; gpc --print-search-dirs | grep install |
head -1; hostname || echo "unknown host"; date "+%Y-%m-%d %H:%M:%S"; }
| \
sed -e 's,^,Testing ,;N;s,\n.*gcc-lib[/\], (,;s,[/\].*,),;N;s,\n,
(,;s,$,),;N;s/\n/, /'
Testing gpc 20030830, based on gcc-3.3.2 (powerpc-apple-darwin)
(G4.local.), 2003-11-17 22:26:56
echo "gpc -g -O3 -W -Wall -Wundef -Wpointer-arith -Wno-unused
--longjmp-all-nonlocal-labels "
gpc -g -O3 -W -Wall -Wundef -Wpointer-arith -Wno-unused
--longjmp-all-nonlocal-labels
PC="gpc" PFLAGS="--autobuild -g -O3 -W -Wall -Wundef -Wpointer-arith
-Wno-unused --longjmp-all-nonlocal-labels " SRCDIR="."
TEST_MAKE_FLAG=test-make-flag "./test_run" nlgpp2.pas | tee test_log |
"./test_sum" | tee test_summary
objdump: a.out: No such file or directory
TEST nlgpp2.pas: /var/tmp//cca94hTX.s:399:non-relocatable
subtraction expression, "L3$pb" minus "LSJR11"
/var/tmp//cca94hTX.s:399:symbol: "L3$pb" can't be undefined in a
subtraction expression
/var/tmp//cca94hTX.s:398:non-relocatable subtraction expression,
"L3$pb" minus "LSJR11"
/var/tmp//cca94hTX.s:398:symbol: "L3$pb" can't be undefined in a
subtraction expression
/var/tmp//cca94hTX.s:unknown:Undefined local symbol L3$pb
failed
# of GPC tests 1
# of GPC tests passed 0
# of GPC tests skipped 0
# of GPC tests failed 1
[G4:~/gnu/testgpc/test-20030830] adriaan% gpc -v
Reading specs from
/Developer/Pascal/gpc332d2/lib/gcc-lib/powerpc-apple-darwin/3.3.2/specs
Configured with: ../gpc-332d2/configure --enable-languages=pascal,c
--prefix=/Developer/Pascal/gpc332d2 --enable-threads=posix
--target=powerpc-apple-darwin
Thread model: posix
gpc version 20030830, based on gcc-3.3.2
[G4:~/gnu/testgpc/test-20030830] adriaan% cat nlgpp2.pas
{ Same as nlgpp.pas, but with more paranoia checks. }
program NLGPP2 (Output);
procedure Fail;
begin
WriteLn ('failed')
end;
procedure Recursive (n: Integer; procedure Proc);
label 1, 2;
procedure DoGoto;
begin
WriteLn ('DoGoto ', n, ' ', @Proc = @Fail);
goto 1
end;
begin
WriteLn ('Recursive start ', n, ' ', @Proc = @Fail);
if n = 3 then
Recursive (n - 1, DoGoto)
else if n > 0 then
Recursive (n - 1, Proc)
else
Proc;
WriteLn ('Recursive before goto ', n, ' ', @Proc = @Fail);
goto 2;
1:
if n = 3 then
WriteLn ('OK')
else
WriteLn ('failed ', n);
2:
WriteLn ('Recursive end ', n, ' ', @Proc = @Fail);
end;
begin
WriteLn ('Main start');
Recursive (10, Fail);
WriteLn ('Main end')
end.