Bug 46426 - [avr] avr/libgcc.S in SVN r166596 fails to compile
Summary: [avr] avr/libgcc.S in SVN r166596 fails to compile
Status: RESOLVED DUPLICATE of bug 47534
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 10:39 UTC by Joerg Wunsch
Modified: 2011-06-24 20:42 UTC (History)
3 users (show)

See Also:
Host:
Target: avr-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Suggested patch (229 bytes, patch)
2010-11-11 10:39 UTC, Joerg Wunsch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Wunsch 2010-11-11 10:39:33 UTC
Created attachment 22372 [details]
Suggested patch

Trying to compile trunk/r166596 for the AVR target results in:

/junk/gcc/trunk/build-avr/./gcc/xgcc -B/junk/gcc/trunk/build-avr/./gcc/ -B/junk/test/avr/bin/ -B/junk/test/avr/lib/ -isystem /junk/test/avr/include -isystem /junk/test/avr/sys-include    -g -O2 -mmcu=avr25 -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -DDF=SF -Dinhibit_libc -mcall-prologues -Os -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc -I../../../../libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _exit.o -MT _exit.o -MD -MP -MF _exit.dep -DL_exit -xassembler-with-cpp \
          -c ../../../../libgcc/../gcc/config/avr/libgcc.S
../../../../libgcc/../gcc/config/avr/libgcc.S: Assembler messages:
../../../../libgcc/../gcc/config/avr/libgcc.S:655: Error: operation combines symbols in different segments
gmake[4]: *** [_exit.o] Error 1
gmake[4]: Leaving directory `/junk/gcc/trunk/build-avr/avr/avr25/libgcc'
gmake[3]: *** [multi-do] Error 1
gmake[3]: Leaving directory `/junk/gcc/trunk/build-avr/avr/libgcc'
gmake[2]: *** [all-multi] Error 2
gmake[2]: Leaving directory `/junk/gcc/trunk/build-avr/avr/libgcc'
gmake[1]: *** [all-target-libgcc] Error 2
gmake[1]: Leaving directory `/junk/gcc/trunk/build-avr'
gmake: *** [all] Error 2

The preprocessed source for this is:

# 642 "../../../../libgcc/../gcc/config/avr/libgcc.S"
 .section .fini9,"ax",@progbits
 .global _exit
 .func _exit
_exit:
 .weak exit
exit:


 .section .fini0,"ax",@progbits
 cli
__stop_program:
 rjmp __stop_program
 .endfunc

It complains about ".endfunc".  My guess is another .func/.endfunc is
needed between _exit and __stop_program.

Applying the following patch seems to fix this issue:

Index: gcc/config/avr/libgcc.S
===================================================================
--- gcc/config/avr/libgcc.S	(revision 166596)
+++ gcc/config/avr/libgcc.S	(working copy)
@@ -646,9 +646,11 @@
 	.weak	exit
 exit:
 
+	.endfunc
 	/* Code from .fini8 ... .fini1 sections inserted by ld script.  */
 
 	.section .fini0,"ax",@progbits
+	.func	__stop_program
 	cli
 __stop_program:
 	rjmp	__stop_program
Comment 1 Michał Walenciak 2011-01-31 07:57:14 UTC
Same here.
But even if I apply this patch, gcc segfaults for any given source.
Comment 2 Georg-Johann Lay 2011-06-24 20:42:13 UTC
(In reply to comment #1)
> Same here.
> But even if I apply this patch, gcc segfaults for any given source.

Your issue appears rather to be PR48459

*** This bug has been marked as a duplicate of bug 47534 ***