Skip to content
Snippets Groups Projects
Commit d5a55981 authored by Janne Grunau's avatar Janne Grunau
Browse files

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.
parent 896a5bff
No related branches found
No related tags found
No related merge requests found
......@@ -1468,6 +1468,7 @@ SYSTEM_FUNCS="
TOOLCHAIN_FEATURES="
as_dn_directive
as_func
asm_mod_q
attribute_may_alias
attribute_packed
......@@ -3733,6 +3734,11 @@ if enabled asm; then
\n: .int 0
.endm
m x
EOF
check_as <<EOF && enable as_func
.func test
.endfunc
EOF
fi
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment