All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>,
	Manoel <mrabran@linux.vnet.ibm.com>
Cc: Carlos Roberto do Nascimento Costa <crncosta@linux.vnet.ibm.com>,
	Hollis Blanchard <hollisb@us.ibm.com>
Subject: Re: PPC64 mlongcall gcc flag
Date: Tue, 04 Nov 2008 18:48:26 -0500	[thread overview]
Message-ID: <1225842506.2997.21.camel@dv> (raw)
In-Reply-To: <1225822685.6767.28.camel@manoel-laptop>

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



  parent reply	other threads:[~2008-11-04 23:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 20:52 PPC64 Hollis Blanchard
2008-10-21 22:04 ` PPC64 Pavel Roskin
2008-10-21 22:40   ` PPC64 Hollis Blanchard
2008-10-23  5:25     ` PPC64 Pavel Roskin
2008-10-23 15:06       ` PPC64 Hollis Blanchard
2008-10-23 16:52         ` PPC64 Pavel Roskin
2008-10-23 18:00 ` PPC64 Manoel
2008-10-23 19:08   ` PPC64 Hollis Blanchard
2008-10-24 12:10     ` PPC64 Manoel
2008-10-24 14:51       ` PPC64 Hollis Blanchard
2008-10-24 21:53     ` PPC64 Manoel
2008-10-27 17:19       ` PPC64 Pavel Roskin
2008-11-04 16:05         ` PPC64 Manoel
2008-11-04 16:12           ` PPC64 Hollis Blanchard
2008-11-04 18:18             ` PPC64 mlongcall gcc flag Manoel
2008-11-04 18:21               ` Manoel
2008-11-04 19:16               ` Robert Millan
2008-11-04 23:48               ` Pavel Roskin [this message]
2008-11-05  9:43                 ` Robert Millan
2008-11-05 15:35                   ` Pavel Roskin
2008-11-05 17:25                 ` Hollis Blanchard
2008-11-05 19:27                   ` Manoel
2008-11-06 15:12                   ` Robert Millan
2008-11-06 17:42                     ` Manoel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1225842506.2997.21.camel@dv \
    --to=proski@gnu.org \
    --cc=crncosta@linux.vnet.ibm.com \
    --cc=grub-devel@gnu.org \
    --cc=hollisb@us.ibm.com \
    --cc=mrabran@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.