Skip to content

Commit

Permalink
[OpenMP] libomp: disable definitions of 5.1 atomics for non-x86 arch.
Browse files Browse the repository at this point in the history
Declarations of 5.1 atomic entries were added under
"#if KMP_ARCH_X86 || KMP_ARCH_X86_64" in kmp_atomic.h,
but definitions of the functions missed architecture guard in kmp_atomic.cpp.
As a result mangled symbols were available on non-x86 architecture.
The patch eliminates these unexpected symbols from the library.

Differential Revision: https://reviews.llvm.org/D112261
  • Loading branch information
AndreyChurbanov committed Oct 25, 2021
1 parent 1bd258f commit e38a1de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openmp/runtime/src/kmp_atomic.cpp
Expand Up @@ -3694,6 +3694,8 @@ void __kmpc_atomic_end(void) {
__kmp_release_atomic_lock(&__kmp_atomic_lock, gtid);
}

#if KMP_ARCH_X86 || KMP_ARCH_X86_64

// OpenMP 5.1 compare and swap

/*!
Expand Down Expand Up @@ -3855,6 +3857,7 @@ kmp_int64 __kmpc_atomic_val_8_cas_cpt(ident_t *loc, int gtid, kmp_int64 *x,
}

// End OpenMP 5.1 compare + capture
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64

/*!
@}
Expand Down

0 comments on commit e38a1de

Please sign in to comment.