[Openmp-commits] [openmp] d6ab42d - [openmp] Fix build break for less common architectures
Martin Storsjö via Openmp-commits
openmp-commits at lists.llvm.org
Fri Nov 25 11:47:05 PST 2022
Author: Martin Storsjö
Date: 2022-11-25T21:46:31+02:00
New Revision: d6ab42dec492ccd3f1b515796d9d2fb020c520bd
URL: https://github.com/llvm/llvm-project/commit/d6ab42dec492ccd3f1b515796d9d2fb020c520bd
DIFF: https://github.com/llvm/llvm-project/commit/d6ab42dec492ccd3f1b515796d9d2fb020c520bd.diff
LOG: [openmp] Fix build break for less common architectures
fb947c358661b3bd3d5e1fa776ec74cc0f308854 introduced the gas
macro COMMON, but it was only defined within ifdefs of the form:
#if (KMP_OS_LINUX || KMP_OS_DARWIN || KMP_OS_WINDOWS) && KMP_ARCH_AARCH64
It was used, however, within other conditions:
#if KMP_ARCH_ARM || KMP_ARCH_MIPS
and:
#if KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64
Move the definition of the COMMON macro out from the current ifdef,
so that it always gets defined (as it's only dependent on the target
platform).
This fixes building on ARM (and presumably all the other mentioned
architectures except aarch64).
Differential Revision: https://reviews.llvm.org/D138703
Added:
Modified:
openmp/runtime/src/z_Linux_asm.S
Removed:
################################################################################
diff --git a/openmp/runtime/src/z_Linux_asm.S b/openmp/runtime/src/z_Linux_asm.S
index ff4c4910d3b77..bd008fa20ef9d 100644
--- a/openmp/runtime/src/z_Linux_asm.S
+++ b/openmp/runtime/src/z_Linux_asm.S
@@ -117,9 +117,6 @@ KMP_PREFIX_UNDERSCORE(\proc):
.macro ALIGN
.align $0
.endmacro
-.macro COMMON name, size, align_power
- .comm \name, \size
-.endm
.macro DEBUG_INFO
/* Not sure what .size does in icc, not sure if we need to do something
@@ -140,9 +137,6 @@ KMP_PREFIX_UNDERSCORE($0):
.macro ALIGN size
.align 1<<(\size)
.endm
-.macro COMMON name, size, align_power
- .comm \name, \size, \align_power
-.endm
.macro DEBUG_INFO proc
ALIGN 2
@@ -161,9 +155,6 @@ KMP_PREFIX_UNDERSCORE(\proc):
.macro ALIGN size
.align 1<<(\size)
.endm
-.macro COMMON name, size, align_power
- .comm \name, \size, (1<<(\align_power))
-.endm
.macro DEBUG_INFO proc
.cfi_endproc
@@ -183,6 +174,16 @@ KMP_PREFIX_UNDERSCORE(\proc):
#endif // (KMP_OS_LINUX || KMP_OS_DARWIN || KMP_OS_WINDOWS) && KMP_ARCH_AARCH64
+.macro COMMON name, size, align_power
+#if KMP_OS_DARWIN
+ .comm \name, \size
+#elif KMP_OS_WINDOWS
+ .comm \name, \size, \align_power
+#else // !KMP_OS_DARWIN && !KMP_OS_WINDOWS
+ .comm \name, \size, (1<<(\align_power))
+#endif
+.endm
+
// -----------------------------------------------------------------------
// data
// -----------------------------------------------------------------------
More information about the Openmp-commits
mailing list