On Wednesday 11 April 2012 16:35:24 Andrey Utkin wrote:
> Hi. I can successfully build ffmpeg libs for iOS with --disable-asm,
> but i'd like to enable it and compilation fails.

The ancient version of gcc shipped by Apple doesn't handle some of the 
embedded assembly properly.  The attached patch disables the bits that don't 
compile in the least invasive way I know of.

-- 
Gavin Kinsey
AD Holdings Plc


This email and any files transmitted with it are CONFIDENTIAL and intended 
solely for the use of the individual or entity to whom they are addressed. 
Please notify the sender immediately by e-mail if you have received this e-mail 
by mistake and delete this e-mail from your system; you may not copy this 
message or disclose its contents to anyone. The recipient should check this 
email and any attachments for the presence of viruses. The Company accepts no 
liability for any damage caused by any virus transmitted by this email. Please 
note that any views or opinions presented in this email are solely those of the 
author and do not necessarily represent those of the Company. Contact Customer 
Services for details [email protected]
diff --git a/libavutil/arm/intmath.h b/libavutil/arm/intmath.h
index 52af66e..b767588 100644
--- a/libavutil/arm/intmath.h
+++ b/libavutil/arm/intmath.h
@@ -75,6 +75,8 @@ static av_always_inline av_const int16_t av_clip_int16_arm(int a)
     return x;
 }
 
+#if AV_GCC_VERSION_AT_LEAST(4,5)
+
 #define av_clip_uintp2 av_clip_uintp2_arm
 static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
 {
@@ -83,6 +85,8 @@ static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
     return x;
 }
 
+#endif /* AV_GCC_VERSION_AT_LEAST(4,5) */
+
 
 #else /* HAVE_ARMV6 */
 
@@ -97,12 +101,16 @@ static av_always_inline av_const int FASTDIV(int a, int b)
 
 #endif /* HAVE_ARMV6 */
 
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+
 #define av_clipl_int32 av_clipl_int32_arm
 static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
 {
     int x, y;
     __asm__ ("adds   %1, %R2, %Q2, lsr #31  \n\t"
+#if CONFIG_THUMB
              "itet   ne                     \n\t"
+#endif
              "mvnne  %1, #1<<31             \n\t"
              "moveq  %0, %Q2                \n\t"
              "eorne  %0, %1,  %R2, asr #31  \n\t"
@@ -110,6 +118,8 @@ static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
     return x;
 }
 
+#endif /* AV_GCC_VERSION_AT_LEAST(4,3) */
+
 #endif /* HAVE_INLINE_ASM */
 
 #endif /* AVUTIL_ARM_INTMATH_H */
diff --git a/libavutil/arm/intreadwrite.h b/libavutil/arm/intreadwrite.h
index 0292aab..61aa4a5 100644
--- a/libavutil/arm/intreadwrite.h
+++ b/libavutil/arm/intreadwrite.h
@@ -52,6 +52,9 @@ static av_always_inline void AV_WN32(void *p, uint32_t v)
     __asm__ ("str  %1, %0" : "=m"(*(uint32_t *)p) : "r"(v));
 }
 
+
+#if AV_GCC_VERSION_AT_LEAST(4,4)
+
 #define AV_RN64 AV_RN64
 static av_always_inline uint64_t AV_RN64(const void *p)
 {
@@ -72,6 +75,8 @@ static av_always_inline void AV_WN64(void *p, uint64_t v)
              : "r"(v));
 }
 
+#endif /* AV_GCC_VERSION_AT_LEAST(4,4) */
+
 #endif /* HAVE_INLINE_ASM */
 
 #endif /* AVUTIL_ARM_INTREADWRITE_H */
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to