Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

[OpenMP] Fix build for X32 ABI #90395

wants to merge 1 commit into from

Conversation

abatyiev
Copy link

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

X32 ABI is special 32bit ABI for long mode (64bit) of X86_64 with 32bit
pointers and integer types.

Fixes llvm#90346
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

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
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

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.

@llvmbot llvmbot added the openmp:libomp OpenMP host runtime label Apr 28, 2024
@brad0 brad0 changed the title Fix build for X32 ABI [OpenMP] Fix build for X32 ABI Apr 29, 2024
@brad0
Copy link
Contributor

brad0 commented Apr 29, 2024

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__
Copy link
Contributor

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.

Copy link

github-actions bot commented May 3, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PATCH][OpenMP] OpenMP does not build for X32 ABI
3 participants