Skip to content

Commit 72ebda2

Browse files
committed
[libc] Ensure the RPC server is alwaus used
Summary: Previous change made us no longer link `exit` by default which implied the RPC server. This is a required symbol for the loader. This will be fixed later when I port the loader to LLVMOffload. For now just work around it to fix the bots.
1 parent f1eb7e5 commit 72ebda2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libc/startup/gpu/amdgpu/start.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ namespace LIBC_NAMESPACE_DECL {
2121
// FIXME: Factor this out into common logic so we don't need to stub it here.
2222
void teardown_main_tls() {}
2323

24+
// FIXME: Touch this symbol to force this to be linked in statically.
25+
volatile void *dummy = &LIBC_NAMESPACE::rpc::client;
26+
2427
DataEnvironment app;
2528

2629
extern "C" uintptr_t __init_array_start[];

libc/startup/gpu/nvptx/start.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ DataEnvironment app;
2323
// FIXME: Factor this out into common logic so we don't need to stub it here.
2424
void teardown_main_tls() {}
2525

26+
// FIXME: Touch this symbol to force this to be linked in statically.
27+
volatile void *dummy = &LIBC_NAMESPACE::rpc::client;
28+
2629
extern "C" {
2730
// Nvidia's 'nvlink' linker does not provide these symbols. We instead need
2831
// to manually create them and update the globals in the loader implememtation.

0 commit comments

Comments
 (0)