This is an archive of the discontinued LLVM Phabricator instance.

[openmp] Fix build break for less common architectures
ClosedPublic

Authored by mstorsjo on Nov 25 2022, 4:22 AM.

Details

Summary

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 presumabily all the other mentioned
architectures except aarch64).

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 25 2022, 4:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 4:22 AM
mstorsjo requested review of this revision.Nov 25 2022, 4:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 4:22 AM
DavidSpickett added inline comments.Nov 25 2022, 4:29 AM
openmp/runtime/src/z_Linux_asm.S
185

This would be !KMP_OS_DARWIN && !KMP_OS_WINDOWS. Or !(KMP_OS_DARWIN || KMP_OS_WINDOWS) if you prefer.

You could also ifdef around just the .common line if you wanted to save repeating .macro.

mstorsjo updated this revision to Diff 477918.Nov 25 2022, 4:38 AM

Sharing .macro COMMON, fixed the #else comment

This revision is now accepted and ready to land.Nov 25 2022, 5:07 AM
This revision was automatically updated to reflect the committed changes.