From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KxVdS-0002lQ-Ht for mharc-grub-devel@gnu.org; Tue, 04 Nov 2008 18:48:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxVdR-0002kn-0y for grub-devel@gnu.org; Tue, 04 Nov 2008 18:48:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxVdQ-0002kB-7Q for grub-devel@gnu.org; Tue, 04 Nov 2008 18:48:32 -0500 Received: from [199.232.76.173] (port=33693 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxVdQ-0002k0-1m for grub-devel@gnu.org; Tue, 04 Nov 2008 18:48:32 -0500 Received: from c60.cesmail.net ([216.154.195.49]:28522) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1KxVdP-0004qO-R8 for grub-devel@gnu.org; Tue, 04 Nov 2008 18:48:32 -0500 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 04 Nov 2008 18:48:28 -0500 Received: from [192.168.0.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 0839834C6D; Tue, 4 Nov 2008 18:50:31 -0500 (EST) From: Pavel Roskin To: The development of GRUB 2 , Manoel In-Reply-To: <1225822685.6767.28.camel@manoel-laptop> References: <1224622323.31194.81.camel@localhost.localdomain> <1224784802.9254.56.camel@manoel-laptop> <1224788935.16720.38.camel@localhost.localdomain> <1224885201.7358.53.camel@manoel-laptop> <1225127982.4991.7.camel@dv> <1225814725.6767.20.camel@manoel-laptop> <1225815138.15410.19.camel@localhost.localdomain> <1225822685.6767.28.camel@manoel-laptop> Content-Type: text/plain Date: Tue, 04 Nov 2008 18:48:26 -0500 Message-Id: <1225842506.2997.21.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Carlos Roberto do Nascimento Costa , Hollis Blanchard Subject: Re: PPC64 mlongcall gcc flag X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 23:48:33 -0000 On Tue, 2008-11-04 at 16:18 -0200, Manoel wrote: > I did this patch to add a gcc flag to the modules compilation. Is that > the correct place to put this flag? It's a wrong place. It breaks compilation of i386: cc1: error: unrecognized command line option "-mlongcall" This option should added in configure for PowerPC targets only. There is already code for adding flags to TARGET_CFLAGS for i386, so that would be the natural place to do it for PowerPC as well: Index: configure.ac =================================================================== --- configure.ac (revision 1893) +++ configure.ac (working copy) @@ -291,6 +291,11 @@ TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi fi + + # Force long calls on PowerPC. + if test "x$target_cpu" = xpowerpc; then + TARGET_CFLAGS="$TARGET_CFLAGS -mlongcall" + fi fi if test "x$target_m32" = x1; then Don't forget to run autogen.sh to regenerate configure from configure.ac if you want to test it. However, it would be nice to have a better explanation why "-mlongcall" is needed. If it's only needed for modules and has significant overhead, we may want to introduce MODULE_CFLAGS, which would only be used for modules. By the way, I tried cross-compiling for PowerPC with and without "-mlongcall" with gcc 4.2.4. With "-mlongcall", the size of all modules combined is 426424 bytes. Without "-mlongcall", the size of all modules combined is 354464 bytes. That's a significant difference for a bootloader and should be avoided if possible. Maybe there is a way to keep the modules and the core in the first 32 megabytes? -- Regards, Pavel Roskin