Skip to content

Commit d5a5598

Browse files
author
Janne Grunau
committed
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.
1 parent 896a5bf commit d5a5598

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,7 @@ SYSTEM_FUNCS="
14681468

14691469
TOOLCHAIN_FEATURES="
14701470
as_dn_directive
1471+
as_func
14711472
asm_mod_q
14721473
attribute_may_alias
14731474
attribute_packed
@@ -3733,6 +3734,11 @@ if enabled asm; then
37333734
\n: .int 0
37343735
.endm
37353736
m x
3737+
EOF
3738+
3739+
check_as <<EOF && enable as_func
3740+
.func test
3741+
.endfunc
37363742
EOF
37373743
fi
37383744

libavutil/aarch64/asm.S

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,28 @@
2626
# define ELF #
2727
#endif
2828

29+
#if HAVE_AS_FUNC
30+
# define FUNC
31+
#else
32+
# define FUNC #
33+
#endif
34+
2935
.macro function name, export=0, align=2
3036
.macro endfunc
3137
ELF .size \name, . - \name
32-
.endfunc
38+
FUNC .endfunc
3339
.purgem endfunc
3440
.endm
3541
.text
3642
.align \align
3743
.if \export
3844
.global EXTERN_ASM\name
3945
ELF .type EXTERN_ASM\name, %function
40-
.func EXTERN_ASM\name
46+
FUNC .func EXTERN_ASM\name
4147
EXTERN_ASM\name:
4248
.else
4349
ELF .type \name, %function
44-
.func \name
50+
FUNC .func \name
4551
\name:
4652
.endif
4753
.endm

libavutil/arm/asm.S

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
# define T @
3535
#endif
3636

37+
#if HAVE_AS_FUNC
38+
# define FUNC
39+
#else
40+
# define FUNC @
41+
#endif
42+
3743
#if HAVE_NEON
3844
.arch armv7-a
3945
#elif HAVE_ARMV6T2
@@ -66,19 +72,19 @@ ELF .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
6672
.noaltmacro
6773
.endif
6874
ELF .size \name, . - \name
69-
.endfunc
75+
FUNC .endfunc
7076
.purgem endfunc
7177
.endm
7278
.text
7379
.align \align
7480
.if \export
7581
.global EXTERN_ASM\name
7682
ELF .type EXTERN_ASM\name, %function
77-
.func EXTERN_ASM\name
83+
FUNC .func EXTERN_ASM\name
7884
EXTERN_ASM\name:
7985
.else
8086
ELF .type \name, %function
81-
.func \name
87+
FUNC .func \name
8288
\name:
8389
.endif
8490
.endm

0 commit comments

Comments
 (0)