[openmp][devicertl] Freestanding nvptx via stub printf
authorJon Chesterfield <jonathanchesterfield@gmail.com>
Mon, 23 Aug 2021 22:07:46 +0000 (23:07 +0100)
committerJon Chesterfield <jonathanchesterfield@gmail.com>
Mon, 23 Aug 2021 22:07:47 +0000 (23:07 +0100)
commitd26000e4cc2bc65e207a84fa26cb6e374d60aa12
tree4af65dfe9f5e81664f1ec0b9200369a7739d34f5
parent1055c5e1d316164c70e0c9f016411a28f3b4792e
[openmp][devicertl] Freestanding nvptx via stub printf

Compiled nvptx devicertl as freestanding, breaking the
dependency on host glibc and gcc-multilibs. Thus build it by default.

Comes at the cost of #defining out printf. Tried mapping it onto
__builtin_printf but that gets transformed back to printf instead
of hitting the cuda/openmp lowering transform.

Printf could be preserved by one of:
- dropping all the standard headers and ffreestanding
- providing a header only printf implementation
- changing the compiler handling of printf

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D108349
openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu
openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h