From 3000c19df64f89ff319590f3a6e4d6b93d20983d Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Tue, 15 Dec 2020 08:12:44 +0200 Subject: [PATCH] [Compiler-rt][AArch64] Workaround for .cfi_startproc assembler parser bug. Put .cfi_startproc on a new line to avoid hitting the assembly parser bug in MasmParser::parseDirectiveCFIStartProc(). Reviewed By: tambre Differential Revision: https://reviews.llvm.org/D93236 --- compiler-rt/lib/builtins/aarch64/lse.S | 9 ++++++--- compiler-rt/lib/builtins/assembly.h | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 770f098..e1c801c 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -113,7 +113,8 @@ HIDDEN(__aarch64_have_lse_atomics) .endm #ifdef L_cas -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(cas)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(cas)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(cas)) JUMP_IF_NOT_LSE 8f #if SIZE < 16 #ifdef HAS_ASM_LSE @@ -166,7 +167,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(NAME(cas)) #else #define SWP .inst 0x38208020 + B + N #endif -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(swp)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(swp)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(swp)) JUMP_IF_NOT_LSE 8f SWP // s(0), s(0), [x1] ret @@ -209,7 +211,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(NAME(swp)) #define LDOP .inst 0x38200020 + OPN + B + N #endif -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(LDNM)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(LDNM)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(LDNM)) JUMP_IF_NOT_LSE 8f LDOP // s(0), s(0), [x1] ret diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h index 66625a9..3b00a5d 100644 --- a/compiler-rt/lib/builtins/assembly.h +++ b/compiler-rt/lib/builtins/assembly.h @@ -243,12 +243,16 @@ DECLARE_FUNC_ENCODING \ name: -#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(name) \ +// TODO(ilinpv) START & END parts will be merged when assembly parser bug +// (kristina) in MasmParser::parseDirectiveCFIStartProc() is fixed. +#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(name) \ DEFINE_CODE_STATE \ FUNC_ALIGN \ .globl name SEPARATOR \ SYMBOL_IS_FUNC(name) SEPARATOR \ - DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \ + DECLARE_SYMBOL_VISIBILITY(name) + +#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(name) \ CFI_START SEPARATOR \ DECLARE_FUNC_ENCODING \ name: SEPARATOR BTI_C -- 2.7.4