This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][nvptx] Drop printf to enable ffreestanding
AbandonedPublic

Authored by JonChesterfield on Aug 2 2021, 3:48 PM.

Details

Reviewers
jdoerfert
Summary

The nvptx devicertl compiles on more platforms if separated from
glibc. This patch disables printf from the devicertl as the lowering in
clang does not trigger with ffreestanding enabled.

Without ffreestanding, stdint et al include the ones from glibc.

This does not solve the general problem of compiling openmp on systems where
glibc causes compilation failure. It does allow running tests that don't use
libc headers.

Diff Detail

Event Timeline

JonChesterfield created this revision.Aug 2 2021, 3:48 PM
JonChesterfield requested review of this revision.Aug 2 2021, 3:48 PM
Herald added a project: Restricted Project. · View Herald Transcript

The problems with stdio etc remain for tests that use it, symptoms are like

In file included from /usr/include/stdio.h:39:
/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h:12:3: error: unknown type name '__off_t'
  __off_t __pos;

usr/include/stdio.h:603:8: error: unknown type name '__ssize_t'; did you mean 'ssize_t'?
extern __ssize_t __getdelim (char **__restrict __lineptr,
JonChesterfield abandoned this revision.Aug 2 2021, 5:05 PM

Remembered nvptx64 is 32 bit, installed gcc-multilibs, can now build trunk without this patch. Closing.