[Liboil] [PATCH] remove -Wa,-maltivec from configure.ac

Sebastian Andrzej Siewior sebastian at breakpoint.cc
Tue Aug 17 13:08:31 PDT 2010


From: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

This option passes -maltivec directly to the assembler which enables
parsing Altivec code if supported. This option as it is kind of useless
because if it fails nothing changes.
I would prefer to pass the -maltivec option to gcc. This has the benefit
that it will tell you if this option is not supported on its current
configuration. On powerpc-linux-gnuspe the default CPU is 8540 which
does not support Altivec (and the opcode range clashes with floating
point). So trying -maltivec will result in a failure. The assembler
still supportes and understands -maltivec.
So I recommend to pass this option only to files which contain
AltiVec code. Making this globally could lead to some trouble _if_ the
compiler decides to optimize general code with AltiVec.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
 configure.ac                          |    3 ---
 liboil/motovec/Makefile.am            |    2 +-
 liboil/powerpc/Makefile.am            |    3 +--
 liboil/powerpc_asm_blocks/Makefile.am |    2 +-
 m4/as-intrinsics.m4                   |    3 ++-
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 98c81fb..9a3fe06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,9 +171,6 @@ then
   AS_COMPILER_FLAG(-Werror, LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Werror")
 fi
 if test x$HAVE_GCC_ASM = xyes -a x$HAVE_POWERPC = xyes ; then
-  AS_COMPILER_FLAG(["-Wa,-maltivec"],
-    [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wa,-maltivec"],
-    true)
   AS_COMPILER_FLAG(["-Wa,-mregnames"],
     [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wa,-mregnames"],
     true)
diff --git a/liboil/motovec/Makefile.am b/liboil/motovec/Makefile.am
index 10660a2..e6f8bed 100644
--- a/liboil/motovec/Makefile.am
+++ b/liboil/motovec/Makefile.am
@@ -7,5 +7,5 @@ libmotovec_la_SOURCES = \
 	vec_memset.S
 libmotovec_la_LIBADD = 
 libmotovec_la_CFLAGS = $(LIBOIL_CFLAGS)
-libmotovec_la_CCASFLAGS = $(LIBOIL_CFLAGS)
+libmotovec_la_CCASFLAGS = $(LIBOIL_CFLAGS) $(ALTIVEC_CFLAGS)
 
diff --git a/liboil/powerpc/Makefile.am b/liboil/powerpc/Makefile.am
index 73851b9..0eb89de 100644
--- a/liboil/powerpc/Makefile.am
+++ b/liboil/powerpc/Makefile.am
@@ -18,5 +18,4 @@ sources = \
 
 libpowerpc_la_SOURCES = \
 	$(sources)
-libpowerpc_la_CFLAGS = $(LIBOIL_CFLAGS)
-
+libpowerpc_la_CFLAGS = $(LIBOIL_CFLAGS) $(ALTIVEC_CFLAGS)
diff --git a/liboil/powerpc_asm_blocks/Makefile.am b/liboil/powerpc_asm_blocks/Makefile.am
index a730772..741bd85 100644
--- a/liboil/powerpc_asm_blocks/Makefile.am
+++ b/liboil/powerpc_asm_blocks/Makefile.am
@@ -8,5 +8,5 @@ sources = \
 
 libpowerpc_asm_blocks_la_SOURCES = \
 	$(sources)
-libpowerpc_asm_blocks_la_CFLAGS = $(LIBOIL_CFLAGS)
+libpowerpc_asm_blocks_la_CFLAGS = $(LIBOIL_CFLAGS) $(ALTIVEC_CFLAGS)
 
diff --git a/m4/as-intrinsics.m4 b/m4/as-intrinsics.m4
index 4781ebd..6705a07 100644
--- a/m4/as-intrinsics.m4
+++ b/m4/as-intrinsics.m4
@@ -194,11 +194,12 @@ AC_DEFUN([AS_ALTIVEC_INTRINSICS],
   AC_TRY_COMPILE([#include <altivec.h>], [__vector a; a = vec_or(a,a)], [flag_ok=yes], [flag_ok=no])
   CFLAGS="$save_CFLAGS"
 
-  $1="-maltivec"
   if test "X$flag_ok" = Xyes ; then
+    $1="-maltivec"
     $2
     true
   else
+    $1=""
     $3
     true
   fi
-- 
1.5.6.5



More information about the Liboil mailing list