Note: older versions may work but support is limited
Experimental support for clang 3.3 or later (results in much bigger binaries)
- for i386, x86_64, arm (except thumb), arm64, mips(el), powerpc
+ for i386, x86_64, arm (except thumb), arm64, mips(el), powerpc, sparc64
Note: clang 3.2 or later works for i386 and x86_64 targets but results in
much bigger binaries.
earlier versions not tested
fail.
Note: clang 3.2 or later works for powerpc
earlier versions not tested
- Note: clang doesn't support -mno-app-regs and so can't be used for sparc64
+ Note: clang 3.5 or later works for sparc64
+ earlier versions return "error: unable to interface with target machine"
Note: clang has no support for ia64 and hence you can't compile GRUB
for ia64 with clang
* GNU Make
TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_soft_float"
fi
+if test x"$target_cpu" = xsparc64 ; then
+ AC_CACHE_CHECK([for options to reserve application registers], grub_cv_target_cc_mno_app_regs, [
+ grub_cv_target_cc_mno_app_regs=no
+ for cand in "-mllvm -sparc-reserve-app-registers" \
+ "-mno-app-regs"; do
+ if test x"$grub_cv_target_cc_mno_app_regs" != xno ; then
+ break
+ fi
+ CFLAGS="$TARGET_CFLAGS $cand -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [grub_cv_target_cc_mno_app_regs="$cand"], [])
+ done
+ ])
+
+ if test x"$grub_cv_target_cc_mno_app_regs" = xno ; then
+ AC_MSG_ERROR([could not reserve application registers])
+ fi
+ if test x"$grub_cv_target_cc_mno_app_regs" = x"-mllvm -sparc-reserve-app-registers" ; then
+ # A trick so that clang doesn't see it on link stŠ°ge
+ TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_app_regs"
+ else
+ TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mno_app_regs"
+ fi
+
+ AC_CACHE_CHECK([for no-relax options], grub_cv_target_cc_mno_relax, [
+ grub_cv_target_cc_mno_relax=no
+ for cand in "-mno-relax" "-Wl,--no-relax"; do
+ if test x"$grub_cv_target_cc_mno_relax" != xno ; then
+ break
+ fi
+ LDFLAGS="$TARGET_LDFLAGS $cand -nostdlib -static"
+ CFLAGS="$TARGET_CFLAGS -Werror"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ asm (".globl start; start:");
+ void __main (void);
+ void __main (void) {}
+ int main (void);
+ ]], [[]])], [grub_cv_target_cc_mno_relax="$cand"], [])
+ done
+ ])
+ LDFLAGS="$TARGET_LDFLAGS"
+ CFLAGS="$TARGET_CFLAGS"
+
+ if test x"$grub_cv_target_cc_mno_relax" = xno ; then
+ AC_MSG_ERROR([could not find no-relax options])
+ fi
+ TARGET_LDFLAGS="$TARGET_LDFLAGS $grub_cv_target_cc_mno_relax"
+fi
+
# By default, GCC 4.4 generates .eh_frame sections containing unwind
# information in some cases where it previously did not. GRUB doesn't need
# these and they just use up vital space. Restore the old compiler
LDFLAGS="$TARGET_LDFLAGS"
-if test "$target_cpu" = x86_64 || test "$target_cpu-$platform" = sparc64-emu ; then
+if test "$target_cpu" = x86_64 || test "$target_cpu" = sparc64 ; then
# Use large model to support 4G memory
AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
CFLAGS="$TARGET_CFLAGS -mcmodel=large"
])
if test "x$grub_cv_cc_mcmodel" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
- elif test "$target_cpu-$platform" = sparc64-emu; then
+ elif test "$target_cpu" = sparc64; then
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=medany"
fi
fi