All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
@ 2015-08-19 18:35 Mark H Weaver
  2015-08-21  4:05 ` Andrei Borzenkov
  0 siblings, 1 reply; 29+ messages in thread
From: Mark H Weaver @ 2015-08-19 18:35 UTC (permalink / raw)
  To: grub-devel; +Cc: Mark H Weaver

Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
code for the O32 ABI when targetting MIPS, since the MIPS assembly code
in GRUB assumes this.  This flag is also needed when compiling
asm-tests/mips.S from configure, because GNU as rejects MIPS register
names such as $t2 unless the O32 ABI is selected.
---
 conf/Makefile.common | 4 ++++
 configure.ac         | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/conf/Makefile.common b/conf/Makefile.common
index fcb8d2e..bd125da 100644
--- a/conf/Makefile.common
+++ b/conf/Makefile.common
@@ -20,6 +20,10 @@ endif
 if COND_powerpc_ieee1275
   CFLAGS_PLATFORM += -mcpu=powerpc
 endif
+if COND_mips
+  CFLAGS_PLATFORM += -mabi=32
+  CCASFLAGS_PLATFORM = -mabi=32
+endif
 
 #FIXME: discover and check XEN headers
 CPPFLAGS_XEN = -I/usr/include
diff --git a/configure.ac b/configure.ac
index c864311..1f5e8a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,8 @@
 
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010  Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,
+#   2012,2013,2014,2015  Free Software Foundation, Inc.
 #
 # This configure.ac is free software; the author
 # gives unlimited permission to copy and/or distribute it,
@@ -599,9 +600,11 @@ fi
 
 AC_CACHE_CHECK([for options to compile assembly], [grub_cv_cc_target_asm_compile], [
 test_program=
+test_ccasflags=
 case "x$target_cpu-$platform" in
      xmips-* | xmipsel-*)
         test_program=mips
+        test_ccasflags=-mabi=32
 	;;
      xi386-pc)
        test_program=i386-pc
@@ -618,7 +621,7 @@ if test x"$test_program" = x ; then
 else
   found=no
   for arg in "" "-no-integrated-as"; do
-    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
+    cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $test_ccasflags $arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
     echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
     if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
       grub_cv_cc_target_asm_compile="$arg"
-- 
2.4.3



^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-10-15 22:04 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-19 18:35 [PATCH] Ensure that MIPS target code is compiled for the O32 ABI Mark H Weaver
2015-08-21  4:05 ` Andrei Borzenkov
2015-08-22 18:04   ` Mark H Weaver
2015-08-23  9:51     ` Andrei Borzenkov
2015-08-23 17:27       ` Mark H Weaver
2015-08-24  6:50       ` [PATCH v2] " Mark H Weaver
2015-09-08 17:11         ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-09-09  1:37           ` Mark H Weaver
2015-09-13  6:32           ` Andrei Borzenkov
2015-10-09 21:14             ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-10  0:28               ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-10-14  4:49                 ` Andrei Borzenkov
2015-10-14 12:16                   ` Vladimir 'phcoder' Serbinenko
2015-10-14 17:57                     ` Andrei Borzenkov
2015-08-24  7:19     ` [PATCH] " Andrei Borzenkov
2015-08-24  7:57       ` Mark H Weaver
2015-08-24  8:12         ` Andrei Borzenkov
2015-08-24  9:27           ` Andrei Borzenkov
2015-08-25 18:18             ` Mark H Weaver
2015-09-11 15:06               ` Andrei Borzenkov
2015-09-13  2:41                 ` Mark H Weaver
2015-09-13  3:46                   ` Mark H Weaver
2015-09-13 14:10                   ` Andrei Borzenkov
2015-09-13 23:37                     ` Mark H Weaver
2015-09-20  4:44                       ` Andrei Borzenkov
2015-09-21 16:09                         ` Mark H Weaver
2015-09-21 17:56                           ` Andrei Borzenkov
2015-09-22 15:03                             ` Mark H Weaver
2015-09-22 17:26                               ` Andrei Borzenkov

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.