[Openmp-commits] [PATCH] D138703: [openmp] Fix build break for less common architectures

Martin Storsjö via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 25 04:22:21 PST 2022


mstorsjo created this revision.
mstorsjo added reviewers: AndreyChurbanov, JonChesterfield, natgla, jdoerfert, Meinersbur, DavidSpickett.
Herald added subscribers: luismarques, s.egerton, PkmX, atanasyan, guansong, simoncook, kristof.beyls, arichardson, yaxunl, sdardis.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added subscribers: pcwang-thead, sstefan1.
Herald added a project: OpenMP.

fb947c358661b3bd3d5e1fa776ec74cc0f308854 <https://reviews.llvm.org/rGfb947c358661b3bd3d5e1fa776ec74cc0f308854> 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 presumabily all the other mentioned
architectures except aarch64).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138703

Files:
  openmp/runtime/src/z_Linux_asm.S


Index: openmp/runtime/src/z_Linux_asm.S
===================================================================
--- openmp/runtime/src/z_Linux_asm.S
+++ openmp/runtime/src/z_Linux_asm.S
@@ -117,9 +117,6 @@
 .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 @@
 .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 @@
 .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,20 @@
 
 #endif // (KMP_OS_LINUX || KMP_OS_DARWIN || KMP_OS_WINDOWS) && KMP_ARCH_AARCH64
 
+#if KMP_OS_DARWIN
+.macro COMMON name, size, align_power
+	.comm \name, \size
+.endm
+#elif KMP_OS_WINDOWS
+.macro COMMON name, size, align_power
+	.comm \name, \size, \align_power
+.endm
+#else // KMP_OS_DARWIN || KMP_OS_WINDOWS
+.macro COMMON name, size, align_power
+	.comm \name, \size, (1<<(\align_power))
+.endm
+#endif // (KMP_OS_DARWIN || KMP_OS_WINDOWS || (else))
+
 // -----------------------------------------------------------------------
 // data
 // -----------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138703.477914.patch
Type: text/x-patch
Size: 1421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221125/6049e4e3/attachment.bin>


More information about the Openmp-commits mailing list