summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2017-04-17 11:58:20 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2017-04-17 11:58:20 +0000
commit44fea6b864b72b862bbdf9f1d214bb1b5890e65b (patch)
treee0de117ae0f831e0efa51d7a1e55698404fcd3f5 /openmp/runtime/src
parentf8429754d8a30eac5203cb4438ca8d9375cf1f8e (diff)
downloadbcm5719-llvm-44fea6b864b72b862bbdf9f1d214bb1b5890e65b.tar.gz
bcm5719-llvm-44fea6b864b72b862bbdf9f1d214bb1b5890e65b.zip
Fix crash in invoking microtask on ios arm64.
Patch by Ni Hui. Differential Revision: https://reviews.llvm.org/D31923 llvm-svn: 300448
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/z_Linux_asm.s29
-rw-r--r--openmp/runtime/src/z_Linux_util.cpp2
2 files changed, 26 insertions, 5 deletions
diff --git a/openmp/runtime/src/z_Linux_asm.s b/openmp/runtime/src/z_Linux_asm.s
index d6e1c0b7195..11fd0238226 100644
--- a/openmp/runtime/src/z_Linux_asm.s
+++ b/openmp/runtime/src/z_Linux_asm.s
@@ -109,8 +109,28 @@ KMP_PREFIX_UNDERSCORE(\proc):
# endif // KMP_OS_DARWIN
#endif // KMP_ARCH_X86 || KMP_ARCH_x86_64
-#if KMP_OS_LINUX && KMP_ARCH_AARCH64
+#if (KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64
+# if KMP_OS_DARWIN
+# define KMP_PREFIX_UNDERSCORE(x) _##x // extra underscore for OS X* symbols
+# define KMP_LABEL(x) L_##x // form the name of label
+
+.macro ALIGN
+ .align $0
+.endmacro
+
+.macro DEBUG_INFO
+/* Not sure what .size does in icc, not sure if we need to do something
+ similar for OS X*.
+*/
+.endmacro
+
+.macro PROC
+ ALIGN 4
+ .globl KMP_PREFIX_UNDERSCORE($0)
+KMP_PREFIX_UNDERSCORE($0):
+.endmacro
+# else // KMP_OS_DARWIN
# define KMP_PREFIX_UNDERSCORE(x) x // no extra underscore for Linux* OS symbols
// Format labels so that they don't override function names in gdb's backtraces
# define KMP_LABEL(x) .L_##x // local label hidden from backtraces
@@ -133,8 +153,9 @@ KMP_PREFIX_UNDERSCORE(\proc):
KMP_PREFIX_UNDERSCORE(\proc):
.cfi_startproc
.endm
+# endif // KMP_OS_DARWIN
-#endif // KMP_OS_LINUX && KMP_ARCH_AARCH64
+#endif // (KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64
// -----------------------------------------------------------------------
// data
@@ -1441,7 +1462,7 @@ KMP_LABEL(kmp_1_exit):
#endif /* KMP_ARCH_X86_64 */
// '
-#if KMP_OS_LINUX && KMP_ARCH_AARCH64
+#if (KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64
//------------------------------------------------------------------------
//
@@ -1553,7 +1574,7 @@ KMP_LABEL(kmp_1):
DEBUG_INFO __kmp_invoke_microtask
// -- End __kmp_invoke_microtask
-#endif /* KMP_OS_LINUX && KMP_ARCH_AARCH64 */
+#endif /* (KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64 */
#if KMP_ARCH_PPC64
diff --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp
index 2c034f9c560..857b147ee05 100644
--- a/openmp/runtime/src/z_Linux_util.cpp
+++ b/openmp/runtime/src/z_Linux_util.cpp
@@ -2516,7 +2516,7 @@ __kmp_get_load_balance( int max )
#endif // USE_LOAD_BALANCE
-#if !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_MIC || (KMP_OS_LINUX && KMP_ARCH_AARCH64) || KMP_ARCH_PPC64)
+#if !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_MIC || ((KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64) || KMP_ARCH_PPC64)
// we really only need the case with 1 argument, because CLANG always build
// a struct of pointers to shared variables referenced in the outlined function
OpenPOWER on IntegriCloud