]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* configure.ac: Add -no-integrated-as if {addme|ame} isn't supported.
authorVladimir Serbinenko <phcoder@gmail.com>
Wed, 4 Dec 2013 11:20:56 +0000 (12:20 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 4 Dec 2013 11:20:56 +0000 (12:20 +0100)
* INSTALL: Note that GRUBwas successfully compiled with clang 3.2 for
ppc.

ChangeLog
INSTALL
configure.ac

index 96aacf1fb883bd25514f3a88e342251180e89838..d27eaba8e6f393180dce42afdf6ca468aae9bd63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/INSTALL b/INSTALL
index ad27f3d885a426988556ff1627205383a038e971..7602323b117183cd0b09426d80b781ea6db2c179 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -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
index 69be355c42f3d55b568b1ca6efc83a408512462c..c371a85b3e5a216b0486bc16b08ec9bcd8874a59 100644 (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