Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorAlvin Wong <alvin@alvinhc.com>2022-11-05 01:22:50 +0300
committerMartin Storsjö <martin@martin.st>2022-11-08 16:27:03 +0300
commita356782426f5bf54a00570e1f925345e5fda7b2e (patch)
tree6a6ca4eee5ef26c747fddd32887f8bbd74c7d53e /openmp
parentdf766fb65cc939bd88c25cb8e478b07f7b4ce123 (diff)
[OpenMP][mingw] Fix build for aarch64 target
This patch changes AArch64 + `__GNUC__` to use `__sync` builtins to implement internal atomic macros just like for Unix, because mingw-w64 is missing some of the intrinsics which the MSVC codepath is using. Then some remaining intel-only functions are removed from dllexport to fix linking. This should fix https://github.com/llvm/llvm-project/issues/56349. Reviewed By: natgla Differential Revision: https://reviews.llvm.org/D137168
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/src/dllexports2
-rw-r--r--openmp/runtime/src/kmp_os.h2
-rw-r--r--openmp/runtime/src/kmp_utility.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/openmp/runtime/src/dllexports b/openmp/runtime/src/dllexports
index 2fd1d90982a3..a541f582a940 100644
--- a/openmp/runtime/src/dllexports
+++ b/openmp/runtime/src/dllexports
@@ -1243,7 +1243,6 @@ kmp_set_disp_num_buffers 890
%ifdef IS_IA_ARCH
__kmpc_atomic_float10_max 2139
__kmpc_atomic_float10_min 2140
- %endif
__kmpc_atomic_float10_max_cpt 2141
__kmpc_atomic_float10_min_cpt 2142
@@ -1263,6 +1262,7 @@ kmp_set_disp_num_buffers 890
__kmpc_atomic_val_2_cas_cpt 2156
__kmpc_atomic_val_4_cas_cpt 2157
__kmpc_atomic_val_8_cas_cpt 2158
+ %endif
%endif
diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
index 458609cb6fe7..1a802ced69c1 100644
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -456,7 +456,7 @@ enum kmp_mem_fence_type {
// Synchronization primitives
-#if KMP_ASM_INTRINS && KMP_OS_WINDOWS
+#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && !(KMP_ARCH_AARCH64 && defined(__GNUC__))
#if KMP_MSVC_COMPAT && !KMP_COMPILER_CLANG
#pragma intrinsic(InterlockedExchangeAdd)
diff --git a/openmp/runtime/src/kmp_utility.cpp b/openmp/runtime/src/kmp_utility.cpp
index 48d31e5ee7b7..53ff1788a074 100644
--- a/openmp/runtime/src/kmp_utility.cpp
+++ b/openmp/runtime/src/kmp_utility.cpp
@@ -370,7 +370,7 @@ void __kmp_expand_file_name(char *result, size_t rlen, char *pattern) {
case 'I':
case 'i': {
pid_t id = getpid();
-#if KMP_ARCH_X86_64 && defined(__MINGW32__)
+#if (KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && defined(__MINGW32__)
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*lld", width, id);
#else
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*d", width, id);