commit | b32c6d18a458d8a4d18f5b3efa5a9d7ffb2abba9 | [log] [tgz] |
---|---|---|
author | Rainer Orth <ro@gcc.gnu.org> | Mon May 05 20:57:41 2025 +0200 |
committer | GitHub <noreply@github.com> | Mon May 05 20:57:41 2025 +0200 |
tree | 85877c5a0ca569a1d3819eeeb8b15ddc455d4e85 | |
parent | 4fb7d1953d3f72f73d580f8549838bedad031d0b [diff] |
[OpenMP] Fix KMP_OS_AIX handling (#138499) When building `openmp` on Linux/sparc64, I get ``` In file included fromopenmp/runtime/src/kmp_utility.cpp:16: openmp/runtime/src/kmp_wrapper_getpid.h:47:2: warning: No gettid found, use getpid instead [-W#warnings] 47 | #warning No gettid found, use getpid instead | ^ ``` This is highly confusing since `<sys/syscall.h>` **does** define `SYS_gettid` and the header is supposed to be included: ``` #if !defined(KMP_OS_AIX) && !defined(KMP_OS_HAIKU) #include <sys/syscall.h> #endif ``` However, this actually is **not** the case for two reasons: - `KMP_OS_HAIKU` is always defined, either as 1 on Haiku or as 0 otherwise. - `KMP_OS_AIX` is even worse: it is only defined as 1 on on AIX, but undefined otherwise. All those `KMP_OS_*` macros are supposed to always be defined as 1/0 as appropriate, and to be checked with `#if`, not `#ifdef`. AIX is violating this, causing the problem above. Other targets probably get `<sys/syscall.h>` indirectly otherwise, but Linux/sparc64 does not. This patch fixes this by also defining `KMP_OS_AIX` as 0 on other OSes and changing the checks to `#if` as necessary. Tested on `sparc64-unknown-linux-gnu`, `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and `x86_64-pc-linux-gnu`.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.