[all-commits] [llvm/llvm-project] 156842: [libomptarget][amdgcn] Drop use of inttypes.h, mov...

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Mon Mar 15 09:55:26 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 156842937f5117176afae659d413f2891b81d4b9
      https://github.com/llvm/llvm-project/commit/156842937f5117176afae659d413f2891b81d4b9
  Author: Jon Chesterfield <jonathanchesterfield at gmail.com>
  Date:   2021-03-15 (Mon, 15 Mar 2021)

  Changed paths:
    M openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
    M openmp/libomptarget/deviceRTLs/common/include/target/shuffle.h

  Log Message:
  -----------
  [libomptarget][amdgcn] Drop use of inttypes.h, moving closer to freestanding

[libomptarget][amdgcn] Drop use of inttypes.h, moving closer to freestanding

The glibc headers are a periodic source of problems compiling the devicertl.
This patch resolves the following error run into while building llvm on a slightly
different linux system.
```
In file included from .../lib/clang/13.0.0/include/inttypes.h:21:
In file included from /usr/include/inttypes.h:25:
/usr/include/features.h:461:12: fatal error: 'sys/cdefs.h' file not found
#  include <sys/cdefs.h>
           ^~~~~~~~~~~~~
```
As a second patch, removing assert.h from shuffle will let amdgcn build as
-ffreestanding, at which point only the headers that clang itself provides are
used and interactions with the host glibc are eliminated. Doing the same for
nvptx is complicated by printf handling but also seems worthwhile.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D98565




More information about the All-commits mailing list