Skip to contentSkip to conversation

: Don't try to use -mcmodel=large on sparc

PATCH In review David Miller 2 participants 3 messages Mar 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 4/7 : Don't try to use -mcmodel=large on sparc

We don't have that code model, and such a code model is unnecessary on sparc64.

2009-03-03 David S. Miller <[email protected]>

* configure.ac: Don't try to use -mcmodel=large on sparc.
* configure: Rebuilt.

---
 configure    |    9 ++++++++-
 configure.ac |    9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
configure +8 -1
index c3677c6..a4b9603 100755
@@ -1999,7 +1999,8 @@ esac
 
 case "$target_cpu" in
   i386 | powerpc) target_m32=1 ;;
-  x86_64 | sparc64) target_m64=1 ;;
+  x86_64) target_m64_large=1 ;;
+  sparc64) target_m64=1 ;;
 esac
 
 case "$host_os" in
@@ -6774,6 +6775,12 @@ fi
 
 if test "x$target_m64" = x1; then
   # Force 64-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+fi
+
+if test "x$target_m64_large" = x1; then
+  # Force 64-bit mode.
   { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5
 echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; }
 if test "${grub_cv_cc_mcmodel+set}" = set; then
configure.ac +8 -1
index fd89d30..9a8713d 100644
@@ -96,7 +96,8 @@ esac
 
 case "$target_cpu" in
   i386 | powerpc) target_m32=1 ;;
-  x86_64 | sparc64) target_m64=1 ;;
+  x86_64) target_m64_large=1 ;;
+  sparc64) target_m64=1 ;;
 esac
 
 case "$host_os" in
@@ -299,6 +300,12 @@ fi
 
 if test "x$target_m64" = x1; then
   # Force 64-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+fi
+
+if test "x$target_m64_large" = x1; then
+  # Force 64-bit mode.
   AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
     CFLAGS="-m64 -mcmodel=large"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
Signature · 1 line
1.6.1.2.253.ga34a
#1 lore raw
Quoted 3 lines · David Miller

We don't have that code model, and such a code model is unnecessary on sparc64.

Hi,

Oh, thanks for pointing out. In fact, mcmodel=large is only needed in x86_64-efi. I move the test to its own section, it would not interfere with sparc64 now.

Signature · 1 line
Bean
#2 lore raw

From: Bean <[email protected]>
Date: Wed, 4 Mar 2009 13:58:50 +0800

Quoted 10 lines · David Miller
Quoted 3 lines

We don't have that code model, and such a code model is unnecessary on sparc64.

Hi,

Oh, thanks for pointing out. In fact, mcmodel=large is only needed in x86_64-efi. I move the test to its own section, it would not interfere with sparc64 now.

Thanks.