Skip to content

[OpenMP] Simplify GNU strerror_r check for Android #148990

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions openmp/runtime/src/kmp_i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,7 @@ static char *sys_error(int err) {
int strerror_r( int, char *, size_t ); // XSI version
*/

#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || \
(defined(__BIONIC__) && defined(_GNU_SOURCE) && \
__ANDROID_API__ >= __ANDROID_API_M__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openmp is distributed as part of the NDK, so i think it's too early to drop apis 21 and 22.

@pirama-arumuga-nainar though, because for all i know we already only build openmp at a higher api level, so it's already broken.

actually, i can just check myself...

~/Downloads/android-ndk-r28b$ ~/toybox/toybox readelf -aW ./toolchains/llvm/prebuilt/linux-x86_64/lib/clang/19/lib/linux/aarch64/libomp.so | grep NT_VERSION
  Android              0x00000084	NT_VERSION	API level 21, NDK r27-beta1 (11883388)
~/Downloads/android-ndk-r28b$ 

if you wanted to extern "C" strerror_r() yourself, the XSI one has always been available, so you could remove bionic from this gnu side altogether (at the cost of either a manual extern "C" or not building with _GNU_SOURCE). but it's probably easier to just wait?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openmp is distributed as part of the NDK, so i think it's too early to drop apis 21 and 22.

@pirama-arumuga-nainar though, because for all i know we already only build openmp at a higher api level, so it's already broken.

Ok, I can leave it for now. No rush. Thanks.

#if (defined(__GLIBC__) || defined(__BIONIC__)) && defined(_GNU_SOURCE)
// GNU version of strerror_r.

char buffer[2048];
Expand Down
Loading