This is an archive of the discontinued LLVM Phabricator instance.

[libc] Fix installing GPU headers
ClosedPublic

Authored by jhuber6 on Jun 23 2023, 8:44 AM.

Details

Summary

The patch in D152592 changed the logic for this. We could never check if
we were on the GPU as this was before the variable was defined so I
moved it later. Secondly, we cannot use the LLVM_BINARY_DIR here, and
I do not know if that works in general. The problem is that it will
isntall the headers under a normal path outside of the
LLVM_ENABLE_RUNTIMES build. I don't know if that's correct for the
other targets, but for the GPU I need to set it back to the
CMAKE_BINARY_DIR so it works.

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 23 2023, 8:44 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 23 2023, 8:44 AM
jhuber6 requested review of this revision.Jun 23 2023, 8:44 AM
phosek added inline comments.Jun 23 2023, 10:47 AM
libc/CMakeLists.txt
90

Should this also be changed to ${CMAKE_BINARY_DIR}/lib? I'd expect for either both LLVM_BINARY_DIR and LLVM_LIBRARY_OUTPUT_INTDIR to be defined, or neither.

jhuber6 added inline comments.Jun 23 2023, 11:27 AM
libc/CMakeLists.txt
90

I think previously it was the one with the host triple, but it should probably just go under /lib since we call it libcgpu.a.

jhuber6 updated this revision to Diff 534027.Jun 23 2023, 11:28 AM

PUt the libcgpu.a and libmgpu.a in the binary directory.

phosek accepted this revision.Jun 23 2023, 11:47 AM

LGTM

This revision is now accepted and ready to land.Jun 23 2023, 11:47 AM
This revision was automatically updated to reflect the committed changes.