[compiler-rt] r314285 - [Builtins] ARM: Fix assembling files in thumb mode.

Manoj Gupta via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 02:33:14 PDT 2017


Author: manojgupta
Date: Wed Sep 27 02:33:14 2017
New Revision: 314285

URL: http://llvm.org/viewvc/llvm-project?rev=314285&view=rev
Log:
[Builtins] ARM: Fix assembling files in thumb mode.

Summary:
clang does not assemble files in thumb mode unless .thumb declaration
is present. Add .thumb/.arm decl to _FUNCTION macros to ensure that
files are assembled correctly.

Fixes PR 34715.

Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin

Reviewed By: compnerd

Subscribers: aemerson, javed.absar, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D38227

Modified:
    compiler-rt/trunk/lib/builtins/assembly.h

Modified: compiler-rt/trunk/lib/builtins/assembly.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/assembly.h?rev=314285&r1=314284&r2=314285&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/assembly.h (original)
+++ compiler-rt/trunk/lib/builtins/assembly.h Wed Sep 27 02:33:14 2017
@@ -75,7 +75,7 @@
  * - for '-mthumb -march=armv7' compiler defines '__thumb__' and '__thumb2__'
  */
 #if defined(__thumb2__) || defined(__thumb__)
-#define DEFINE_CODE_STATE .thumb
+#define DEFINE_CODE_STATE .thumb SEPARATOR
 #define DECLARE_FUNC_ENCODING    .thumb_func SEPARATOR
 #if defined(__thumb2__)
 #define USE_THUMB_2
@@ -89,7 +89,7 @@
 #define ITE(cond)
 #endif // defined(__thumb__2)
 #else // !defined(__thumb2__) && !defined(__thumb__)
-#define DEFINE_CODE_STATE .arm
+#define DEFINE_CODE_STATE .arm SEPARATOR
 #define DECLARE_FUNC_ENCODING
 #define IT(cond)
 #define ITT(cond)
@@ -146,6 +146,7 @@
 #endif
 
 #define DEFINE_COMPILERRT_FUNCTION(name)                                       \
+  DEFINE_CODE_STATE                                                            \
   FILE_LEVEL_DIRECTIVE SEPARATOR                                               \
   .globl SYMBOL_NAME(name) SEPARATOR                                           \
   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR                                  \
@@ -154,6 +155,7 @@
   SYMBOL_NAME(name):
 
 #define DEFINE_COMPILERRT_THUMB_FUNCTION(name)                                 \
+  DEFINE_CODE_STATE                                                            \
   FILE_LEVEL_DIRECTIVE SEPARATOR                                               \
   .globl SYMBOL_NAME(name) SEPARATOR                                           \
   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR                                  \
@@ -162,6 +164,7 @@
   SYMBOL_NAME(name):
 
 #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name)                               \
+  DEFINE_CODE_STATE                                                            \
   FILE_LEVEL_DIRECTIVE SEPARATOR                                               \
   .globl SYMBOL_NAME(name) SEPARATOR                                           \
   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR                                  \
@@ -170,6 +173,7 @@
   SYMBOL_NAME(name):
 
 #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name)                     \
+  DEFINE_CODE_STATE                                                            \
   .globl name SEPARATOR                                                        \
   SYMBOL_IS_FUNC(name) SEPARATOR                                               \
   HIDDEN(name) SEPARATOR                                                       \




More information about the llvm-commits mailing list