[FFmpeg-cvslog] build: check if AS supports the '.func' directive

Janne Grunau git at videolan.org
Wed Jun 4 12:53:02 CEST 2014


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Fri May 30 09:58:43 2014 +0200| [d5a55981986ac5d1a31aef3a8d16eaff8534a412] | committer: Janne Grunau

build: check if AS supports the '.func' directive

Not supported by Clang's integrated assembler. Since it just adds
debug information it can safely omitted.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d5a55981986ac5d1a31aef3a8d16eaff8534a412
---

 configure               |    6 ++++++
 libavutil/aarch64/asm.S |   12 +++++++++---
 libavutil/arm/asm.S     |   12 +++++++++---
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 13bcdfe..59f7273 100755
--- a/configure
+++ b/configure
@@ -1468,6 +1468,7 @@ SYSTEM_FUNCS="
 
 TOOLCHAIN_FEATURES="
     as_dn_directive
+    as_func
     asm_mod_q
     attribute_may_alias
     attribute_packed
@@ -3734,6 +3735,11 @@ if enabled asm; then
 .endm
 m x
 EOF
+
+    check_as <<EOF && enable as_func
+.func test
+.endfunc
+EOF
 fi
 
 check_inline_asm inline_asm_labels '"1:\n"'
diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S
index 3690a33..850f16b 100644
--- a/libavutil/aarch64/asm.S
+++ b/libavutil/aarch64/asm.S
@@ -26,10 +26,16 @@
 #   define ELF  #
 #endif
 
+#if HAVE_AS_FUNC
+#   define FUNC
+#else
+#   define FUNC #
+#endif
+
 .macro  function name, export=0, align=2
     .macro endfunc
 ELF     .size   \name, . - \name
-        .endfunc
+FUNC    .endfunc
         .purgem endfunc
     .endm
         .text
@@ -37,11 +43,11 @@ ELF     .size   \name, . - \name
     .if \export
         .global EXTERN_ASM\name
 ELF     .type   EXTERN_ASM\name, %function
-        .func   EXTERN_ASM\name
+FUNC    .func   EXTERN_ASM\name
 EXTERN_ASM\name:
     .else
 ELF     .type   \name, %function
-        .func   \name
+FUNC    .func   \name
 \name:
     .endif
 .endm
diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S
index 5884e17..93d74b6 100644
--- a/libavutil/arm/asm.S
+++ b/libavutil/arm/asm.S
@@ -34,6 +34,12 @@
 #   define T @
 #endif
 
+#if HAVE_AS_FUNC
+#   define FUNC
+#else
+#   define FUNC @
+#endif
+
 #if   HAVE_NEON
         .arch           armv7-a
 #elif HAVE_ARMV6T2
@@ -66,7 +72,7 @@ ELF     .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
         .noaltmacro
       .endif
 ELF     .size   \name, . - \name
-        .endfunc
+FUNC    .endfunc
         .purgem endfunc
     .endm
         .text
@@ -74,11 +80,11 @@ ELF     .size   \name, . - \name
     .if \export
         .global EXTERN_ASM\name
 ELF     .type   EXTERN_ASM\name, %function
-        .func   EXTERN_ASM\name
+FUNC    .func   EXTERN_ASM\name
 EXTERN_ASM\name:
     .else
 ELF     .type   \name, %function
-        .func   \name
+FUNC    .func   \name
 \name:
     .endif
 .endm



More information about the ffmpeg-cvslog mailing list