* configure.ac: Add -no-integrated-as if {addme|ame} isn't supported.

* INSTALL: Note that GRUBwas successfully compiled with clang 3.2 for
	ppc.
This commit is contained in:
Vladimir Serbinenko 2013-12-04 12:20:56 +01:00
parent 8a3f0a24b5
commit b73b70ebca
3 changed files with 31 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2013-12-04 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Add -no-integrated-as if {addme|ame} isn't supported.
* INSTALL: Note that GRUBwas successfully compiled with clang 3.2 for
ppc.
2013-12-04 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/main.c: Ignore missing prototype for main.

View File

@ -23,8 +23,8 @@ configuring the GRUB.
Note: clang 3.3 or later works for mips(el)
earlier versions fail to generate .reginfo and hence gprel relocations
fail.
Note: clang 3.4 or later works for powerpc
earlier versions suffer from vacopy bug (#15286)
Note: clang 3.2 or later works for powerpc
earlier versions not tested
Note: clang has no support for generating 64-bit sparc code and hence you
can't compile GRUB for sparc64 with clang
Note: clang has no support for ia64 and hence you can't compile GRUB

View File

@ -515,7 +515,9 @@ AC_CACHE_CHECK([which extra warnings work], [grub_cv_target_cc_w_extra_flags], [
TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_w_extra_flags"
AC_CACHE_CHECK([if compiling with clang], [grub_cv_cc_target_clang]
[AC_COMPILE_IFELSE(
[
CFLAGS="$TARGET_CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#ifdef __clang__
#error "is clang"
@ -533,6 +535,26 @@ if test "x$grub_cv_cc_target_clang" = xyes && ( test "x$target_cpu" = xi386 \
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
fi
if test "x$grub_cv_cc_target_clang" = xyes && test "x$target_cpu" = xpowerpc; then
AC_CACHE_CHECK([if clang can handle ame instruction], [grub_cv_cc_target_clang_ame]
[
CFLAGS="$TARGET_CFLAGS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
unsigned int a = 0, b = 0;
asm volatile ("{ame|addme} %0,%1" : "=r" (a) : "r" (b));
if (a)
return 1;
]])],
[grub_cv_cc_target_clang_ame=yes], [grub_cv_cc_target_clang_ame=no])])
# clang <= 3.3 doesn't handle most of ppc assembly, not even inline assembly
# used by gcrypt
if test x$grub_cv_cc_target_clang_ame = xno ; then
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
TARGET_CFLAGS="$TARGET_CCASFLAGS -no-integrated-as"
fi
fi
if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then
TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
fi