From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1O1zwp-0002tn-6t for mharc-grub-devel@gnu.org; Wed, 14 Apr 2010 06:35:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1zwm-0002tE-CO for grub-devel@gnu.org; Wed, 14 Apr 2010 06:35:52 -0400 Received: from [140.186.70.92] (port=38507 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1zwk-0002ro-4i for grub-devel@gnu.org; Wed, 14 Apr 2010 06:35:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1zwe-0006Fo-FG for grub-devel@gnu.org; Wed, 14 Apr 2010 06:35:45 -0400 Received: from mailout08.t-online.de ([194.25.134.20]:39463) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1zwd-0006Fi-TI for grub-devel@gnu.org; Wed, 14 Apr 2010 06:35:44 -0400 Received: from fwd02.aul.t-online.de (fwd02.aul.t-online.de ) by mailout08.t-online.de with smtp id 1O1zwc-0001IT-6b; Wed, 14 Apr 2010 12:35:42 +0200 Received: from [192.168.2.100] (Gcl+KwZlYhMzddwD2Cjxm5g7kW+RA8UOfGPkzWopjUtGZmTY6ZVT-CmFY1Z508OQ42@[217.235.186.228]) by fwd02.aul.t-online.de with esmtp id 1O1zwY-1KMyJ60; Wed, 14 Apr 2010 12:35:38 +0200 Message-ID: <4BC59A74.5080900@t-online.de> Date: Wed, 14 Apr 2010 12:35:32 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100205 SeaMonkey/2.0.3 MIME-Version: 1.0 To: The development of GNU GRUB References: <4BC4C189.6020409@t-online.de> <4BC4C4FA.2050005@gmail.com> In-Reply-To: <4BC4C4FA.2050005@gmail.com> Content-Type: multipart/mixed; boundary="------------000401050604040208060007" X-ID: Gcl+KwZlYhMzddwD2Cjxm5g7kW+RA8UOfGPkzWopjUtGZmTY6ZVT-CmFY1Z508OQ42 X-TOI-MSGID: b5c77559-c6d3-4146-b8fa-0743039cb049 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: NEED_REGISTER_FRAME_INFO can be replaced by -static-libgcc X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 10:35:52 -0000 This is a multi-part message in MIME format. --------------000401050604040208060007 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Vladimir 'φ-coder/phcoder' Serbinenko wrote: > Christian Franke wrote: > > >> The *_frame_info symbols are set undefined to force linkage of the >> libgcc_s shared library or dll. >> >> This can be prevented by TARGET_LDFLAGS=-static-libgcc. To build from >> grub-1.98 tarball on Cygwin, run configure with this argument. >> >> May also be necessary on other build platforms when -shared-libgcc is >> the default. It may be possible simply set -static-libgcc >> unconditionally. >> >> > We already supply -lgcc --static-libgcc. Do you know why it still had > issues? > The above is only set when linking the kernel image. According to 'gcc -dumpspecs' of Cygwin gcc 4.3.4-3, options '-u ___[de]register_frame_info' are always passed to the linker if -static-libgcc is not specified. This is Cygwin and MinGW specific: In the exe startup code these symbols are loaded only if present, so the DLL must be forced to load first. As a consequence, the symbols are also set undefined when the GRUB pre-*.o files are generated with 'ld -r'. The attached patch works for me with the bzr revision preceding the NEED_REGISTER_FRAME_INFO fix. > And I also doubt usefullness of pulling these functions since reference > to them is purely dummy: no relocation uses it so it will only increase > code size. Another concern is the behviour of these functions in grub > environment if they ever get called. > > AFAICS from the gcc source, the functions are used in EH stack unwinding code in libgcc. The compiler itself does not generate calls to these functions. -- Regards, Christian Franke --------------000401050604040208060007 Content-Type: text/x-diff; name="grub2-static-libgcc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="grub2-static-libgcc.patch" === modified file 'Makefile.in' --- Makefile.in 2010-04-10 23:14:31 +0000 +++ Makefile.in 2010-04-14 08:04:34 +0000 @@ -98,12 +98,12 @@ OBJCONV = @OBJCONV@ TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ -Wall -W -TARGET_LDFLAGS = -nostdlib @TARGET_LDFLAGS@ +TARGET_LDFLAGS = -nostdlib -static-libgcc @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ TARGET_IMG_LDFLAGS = -nostdlib @TARGET_IMG_LDFLAGS@ TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@ TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ -kernel_img_LDFLAGS = -static-libgcc -lgcc +kernel_img_LDFLAGS = -lgcc EXEEXT = @EXEEXT@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ --------------000401050604040208060007--