Patchwork Committed, cris-elf: Don't compile crtstuff.c with debug info

login
register
mail settings
Submitter Hans-Peter Nilsson
Date July 9, 2011, 11:14 p.m.
Message ID <201107092314.p69NEQ8Q005818@ignucius.se.axis.com>
Download mbox | patch
Permalink /patch/104039/
State New
Headers show

Comments

Hans-Peter Nilsson - July 9, 2011, 11:14 p.m.
The $(LIBGCC2_CFLAGS) removed in the patch is prehistoric
(before first commit in the FSF repo) but was once needed or at
least seemed like a good idea; I can't recall which.  These
days, its major effect is to add "-g", which with the recent
dwarf2 changes is lethal, if you're unlucky.  With the default
CRT_CALL_STATIC_FUNCTION it might add, in a dwarf2 frame info
debug section:

          .byte   0x4     ;# DW_CFA_advance_loc4
          .dword  .LCFI4-.LCFI3

where .LCFI4 and .LCFI3 are in different sections due to the
switching-sections-with-asm hack.  That kind of expression is
not supported.  There have to be a few unlucky circumstances:
the assembler has to not support CFI directives (the gcc
configure-test failing) and the stack frame for
 void call_foo(void) { asm(".section .init"); foo(); asm(".text"); }
has to be non-empty; call_foo has to explicitly store its
return-address (as with call insns in RISC ISAs).

Committed after testing that it works as good as defining
CRT_CALL_STATIC_FUNCTION, which would be needed in several
flavors due to PIC and ISA variation.

	PR target/49684
	* config/cris/t-elfmulti (CRTSTUFF_T_CFLAGS): Don't include
	$(LIBGCC2_CFLAGS).


brgds, H-P

Patch

Index: config/cris/t-elfmulti
===================================================================
--- config/cris/t-elfmulti	(revision 175272)
+++ config/cris/t-elfmulti	(working copy)
@@ -1,4 +1,4 @@ 
-# Copyright (C) 2001, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2007, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -31,4 +31,4 @@  MULTILIB_MATCHES = \
 MULTILIB_EXTRA_OPTS = mbest-lib-options
 INSTALL_LIBGCC = install-multilib
 LIBGCC = stmp-multilib
-CRTSTUFF_T_CFLAGS = $(LIBGCC2_CFLAGS) -moverride-best-lib-options
+CRTSTUFF_T_CFLAGS = -moverride-best-lib-options