This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa4a26374aa11: [libc] Add support for creating wrapper
headers for offloading in clang (authored by jhuber6).
Repository:
rG LLVM Github Monorepo
jhuber6 updated this revision to Diff 537787.
jhuber6 added a comment.
Changing this to only apply to OpenMP for now. It breaks CUDA / HIP builds
because they already have forward declarations of things like `malloc` or
`memcpy` on the GPU that conflict. We'll need to clean those up later.
Repos
jdoerfert accepted this revision.
jdoerfert added a comment.
If it compiles, ship it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154036/new/
https://reviews.llvm.org/D154036
___
cfe-commits mailing li
JonChesterfield accepted this revision.
JonChesterfield added a comment.
This revision is now accepted and ready to land.
OK, let's go with this. It's a fairly alarming mess localised quite closely to
the language that requires the complexity, minimal damage to libc itself.
Repository:
rG LLV
jhuber6 added inline comments.
Comment at: libc/include/CMakeLists.txt:8
+if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
+ include(GetClangResourceDir)
+endif()
sivachandra wrote:
> Where does this come from?
It's a global CMake module that LLVM provides in
`cmake/Modules
sivachandra added a comment.
The libc specific changes are really minimal straightforward. The GPU side, the
clang driver changes etc. need a review by a GPU expert.
Comment at: libc/include/CMakeLists.txt:8
+if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
+ include(GetClangResourceDir)
jhuber6 updated this revision to Diff 537535.
jhuber6 added a comment.
Fix guard on the headers for offloading languages
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154036/new/
https://reviews.llvm.org/D154036
Files:
clang/lib/Driver/ToolChain
jhuber6 updated this revision to Diff 535983.
jhuber6 added a comment.
Add some checks to `stdlib.h` to ensure ABI compatibility for `div` functions.
Because this patch makes us always include the LLVM libc repo when offloading,
we mask off the wrappers if they were not installed by `libc`, so th
jhuber6 updated this revision to Diff 535835.
jhuber6 added a comment.
Semi-fix hack for `string.h` and fix `ctype.h`. `string.h` required undefining
C++ mode so we didn't use weird GNU C++ handling, which we then still need the
`extern "C"` for. The cytpe problems come from GNU defining everythin
jhuber6 updated this revision to Diff 535600.
jhuber6 added a comment.
Hack around the `string` problem. GNU likes to provide different prototypes for
C++. Manually disable this for now. Unsure if this will have reasonable
fallout, but it seems bizarre that `string.h` would define C++ constructs
jhuber6 added a comment.
For reference, here is what one of the newly generated headers looks like that
is used.
#ifndef __LLVM_LIBC_DECLARATIONS_STDIO_H
#define __LLVM_LIBC_DECLARATIONS_STDIO_H
#ifndef __LIBC_ATTRS
#define __LIBC_ATTRS
#endif
#ifdef __cplusplus
extern "C" {
jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, sivachandra, lntue,
michaelrj, tra, JonChesterfield.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commit
12 matches
Mail list logo