This patch introduces startup code for executing main on a device
compiled for the GPU. We will primarily use this to run standalone
integration tests on the GPU. The actual execution of this routine will
need to be provided by a loader utility to bootstrap execution on the
GPU.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Remove unrelated change.
I had a hard time testing these changes. For reasons unknown to me, this does
not seem to actually build the sources. Thus, the install does not have a file
to install. I copied the source mostly from the existing support for linux but
it seems like it doesn't create a standard object library that is linked in.
Rather we extract the object manually. This is also a bit problematic as we will
need to pass --target= to the link job to tell it to use the appropriate
toolchain for the linking job.
Reading the patch doesn't show me any obvious problems. Can you tell me how to reproduce what you are seeing?
The only issue right now is that I don't see the crt1.o being built anywhere. The install line then fails to find it at install time. I wasn't sure how this dependency is supposed to be handled. It might be difficult for you to reproduce right now because I'm assuming you don't have a GPU on your system. I'll need to add those lines that let you force a build of one GPU architecture for testing.
libc/startup/gpu/CMakeLists.txt | ||
---|---|---|
93 | The problem is here: replace ${LIBC_COMPONENT} with libc. |
Updating the component. This works now with ninja install-libc. it would be nice if we could add a public link interface to use --target= so that anything linking against the startup code will use the correct device linker.
The problem is here: replace ${LIBC_COMPONENT} with libc.