Bug 18217 - [4.0 Regression] Ada Bootstrap failures on powerpc-darwin with undefined symbol (__Unwind_fallback_frame_state_for)
Summary: [4.0 Regression] Ada Bootstrap failures on powerpc-darwin with undefined symb...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Andrew Pinski
URL:
Keywords: build, patch
: 18570 (view as bug list)
Depends on:
Blocks: 18572
  Show dependency treegraph
 
Reported: 2004-10-29 11:29 UTC by Andrew Pinski
Modified: 2004-11-22 13:51 UTC (History)
4 users (show)

See Also:
Host:
Target: ppc-darwin
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-11-05 03:32:00


Attachments
patch which moves darwin-fallback.o to the correct static library (377 bytes, patch)
2004-11-19 23:10 UTC, Andrew Pinski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2004-10-29 11:29:24 UTC
../../xgcc -B../../ -c -DIN_GCC   `echo -O2 -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -fno-common |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`   -O2 -g -O2   
-I. -I.. -I../.. -I/Users/pinskia/src/local2/gcc/gcc/ada -I/Users/pinskia/src/local2/gcc/gcc/ada/../
config -I/Users/pinskia/src/local2/gcc/gcc/ada/../../include -I/Users/pinskia/src/local2/gcc/gcc/ada/
.. /Users/pinskia/src/local2/gcc/gcc/ada/link.c \
  -o link.o
../../xgcc -B../../ -DIN_GCC   `echo -O2 -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -fno-common |sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`   -o ../../
gnatmake b_gnatm.o a-except.o ctrl_c.o ali.o ali-util.o s-casuti.o alloc.o atree.o binderr.o butil.o 
casing.o csets.o debug.o elists.o einfo.o erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o 
fname-sf.o gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o make.o 
makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o namet.o nlists.o opt.o osint.o 
osint-m.o output.o prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o 
prj-nmsc.o prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o rident.o s-exctab.o s-
secsta.o s-stalib.o s-stoele.o scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o sinfo.o 
sinput.o sinput-c.o sinput-p.o snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o 
switch.o switch-m.o table.o targparm.o tempdir.o tree_io.o types.o uintp.o  uname.o urealp.o usage.o 
widechar.o  \
      ../rts/libgnat.a  ../../prefix.o ../../version.o link.o ../../../libiberty/libiberty.a  
/usr/bin/ld: Undefined symbols:
__Unwind_fallback_frame_state_for
collect2: ld returned 1 exit status
make[4]: *** [../../gnatmake] Error 1
make[3]: *** [gnattools1] Error 2
make[2]: *** [gnattools-native] Error 2
make[1]: *** [all-target-libada] Error 2
make: *** [bootstrap] Error 2
gcc_build: error: Could not bootstrap the compiler
Comment 1 awreynolds 2004-11-05 03:25:41 UTC
The function Unwind_fallback_frame_state_for is defined in darwin-fallback.c. 

pbg4:~/Developer/Compiler/fsf-gcc-obj/gcc drew$ nm libgcc.a | grep Unwind_fallback_
00000000 T __Unwind_fallback_frame_state_for
Comment 2 Andrew Pinski 2004-11-05 03:32:00 UTC
Confirmed.
Comment 3 Andrew Pinski 2004-11-19 22:26:06 UTC
*** Bug 18570 has been marked as a duplicate of this bug. ***
Comment 4 Rainer Orth 2004-11-19 22:33:52 UTC
Subject: Re:  [4.0 Regression] Ada Bootstrap failures on powerpc-darwin with undefined symbol (__Unwind_fallback_frame_state_for)

As a workaround, I've changed all instances of -lgcc -lgcc_eh in the specs
file to -lgcc_eh -lgcc -lgcc_eh.  With this change, the bootstrap got
further along:

../../xgcc -c -I./ -I../rts -I. -I/vol/gnu/src/gcc/gcc-dist/gcc/ada -B../../ -O2 -g -O2 -gnatpg -gnata -I- /vol/gnu/src/gcc/gcc-dist/gcc/ada/makegpr.adb
+===========================GNAT BUG DETECTED==============================+
| 4.0.0 20041119 (experimental) (powerpc-apple-darwin7.6.0) Bus error      |
| Error detected at makegpr.adb:4159:23                                    |

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x004e9650 in initializer_zerop (init=0x4469dcc0) at /vol/gnu/src/gcc/gcc-dist/gcc/tree.c:5834
(gdb) where
#0  0x004e9650 in initializer_zerop (init=0x4469dcc0) at /vol/gnu/src/gcc/gcc-dist/gcc/tree.c:5834
#1  0x004e97dc in initializer_zerop (init=0x4469dcc0) at /vol/gnu/src/gcc/gcc-dist/gcc/tree.c:5870
#2  0x004e97dc in initializer_zerop (init=0x4469dcc0) at /vol/gnu/src/gcc/gcc-dist/gcc/tree.c:5870
#3  0x004fb574 in assemble_variable (decl=0xc659a8, top_level=115, at_end=6317412, dont_output_data=1147788480) at /vol/gnu/src/gcc/gcc-dist/gcc/varasm.c:1706
#4  0x00503118 in rest_of_decl_compilation (decl=0x4469dcc0, top_level=6317412, at_end=12999080) at /vol/gnu/src/gcc/gcc-dist/gcc/passes.c:235
#5  0x00507bfc in expand_one_var (var=0x4469dcc0, toplevel=100 'd') at /vol/gnu/src/gcc/gcc-dist/gcc/cfgexpand.c:559
#6  0x005094ac in tree_expand_cfg () at /vol/gnu/src/gcc/gcc-dist/gcc/cfgexpand.c:791
#7  0x0024896c in execute_pass_list (pass=0x44698210) at /vol/gnu/src/gcc/gcc-dist/gcc/tree-optimize.c:511
#8  0x00248ca8 in tree_rest_of_compilation (fndecl=0x0) at /vol/gnu/src/gcc/gcc-dist/gcc/tree-optimize.c:643
#9  0x005330bc in cgraph_expand_function (node=0x44699880) at /vol/gnu/src/gcc/gcc-dist/gcc/cgraphunit.c:822
#10 0x0053407c in cgraph_optimize () at /vol/gnu/src/gcc/gcc-dist/gcc/cgraphunit.c:1689
#11 0x004d6528 in toplev_main (argc=12717220, argv=0xc265b4) at /vol/gnu/src/gcc/gcc-dist/gcc/toplev.c:985
#12 0x00002584 in _start (argc=16, argv=0xbffff93c, envp=0xbffff980) at /SourceCache/Csu/Csu-47/crt.c:267
#13 0x8fe1a558 in __dyld__dyld_start ()

The file compiles without problems at -O0.  Is this a known bug, too?

	Rainer
Comment 5 Andrew Pinski 2004-11-19 23:10:09 UTC
Created attachment 7569 [details]
patch which moves darwin-fallback.o to the correct static library

Using your hint for -lgcc -lgcc_eh -lgcc, well the patch which would do that
not be the correct fix but I figured out what was going on.

Oh, by the way the ICE you got is not known yet, please file it seperately.
Comment 6 Rainer Orth 2004-11-19 23:12:47 UTC
Subject: Re:  [4.0 Regression] Ada Bootstrap failures on powerpc-darwin with undefined symbol (__Unwind_fallback_frame_state_for)

pinskia at gcc dot gnu dot org writes:

> Using your hint for -lgcc -lgcc_eh -lgcc, well the patch which would do that
> not be the correct fix but I figured out what was going on.

Fine.  I said the change above was a hack, and I wasn't sure whether it is
the correct solution.

> Oh, by the way the ICE you got is not known yet, please file it seperately.

Ok, will do.

	Rainer
Comment 7 Andrew Pinski 2004-11-19 23:19:15 UTC
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01621.html>.
Comment 8 GCC Commits 2004-11-22 13:49:55 UTC
Subject: Bug 18217

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-11-22 13:49:40

Modified files:
	gcc            : ChangeLog 
	gcc/config/rs6000: t-darwin 

Log message:
	2004-11-22  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR target/18217
	* config/rs6000/t-darwin (LIB2FUNCS_EXTRA): Move darwin-fallback.c to
	(LIB2ADDEH): Here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6447&r2=2.6448
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/t-darwin.diff?cvsroot=gcc&r1=1.15&r2=1.16

Comment 9 Andrew Pinski 2004-11-22 13:51:34 UTC
Fixed.