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


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to