-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OpenMP] Fix build for X32 ABI #90395
base: main
Are you sure you want to change the base?
Conversation
X32 ABI is special 32bit ABI for long mode (64bit) of X86_64 with 32bit pointers and integer types. Fixes llvm#90346
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
Your commit should also be prefixed with [OpenMP] |
@@ -222,14 +222,19 @@ class KMPHwlocAffinity : public KMPAffinity { | |||
#error Wrong code for getaffinity system call. | |||
#endif /* __NR_sched_getaffinity */ | |||
#elif KMP_ARCH_X86_64 | |||
#ifndef __ILP32__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if this is inverted.
You can test this locally with the following command:git-clang-format --diff ff03f23be8bc6df701efd9e1093779fbcf382d87 7d230d1974aae201441dbb81f033b36323b59ed7 -- openmp/runtime/src/kmp_affinity.h openmp/runtime/src/kmp_os.h View the diff from clang-format here.diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
index 59a81557e0..a5543f2710 100644
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -189,7 +189,8 @@ typedef unsigned long long kmp_uint64;
#error "Can't determine size_t printf format specifier."
#endif
-#if KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_WASM || KMP_ARCH_PPC || defined(__ILP32__)
+#if KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_WASM || KMP_ARCH_PPC || \
+ defined(__ILP32__)
#define KMP_SIZE_T_MAX (0xFFFFFFFF)
#else
#define KMP_SIZE_T_MAX (0xFFFFFFFFFFFFFFFF)
|
X32 ABI is special 32bit ABI for long mode (64bit) of X86_64 with 32bit pointers and integer types.
Syscall numbering scheme uses second highest bit to tell difference between regular 64bit calls and X32 ABI calls.
Fixes #90346