From ad00a3db4dde0507f8a6be5f1c5eb2b54d242f0a Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 23 May 2023 09:16:30 -0500 Subject: [PATCH] [libc][AMDGPU] Disable the AMDGPU backend's ctor/dtor lowering for libc The AMDGPU backend has a built-in pass to lower constructors. We do this manually in the `start.cpp` implementation so we can disable this to keep the binaries smaller. Differential Revision: https://reviews.llvm.org/D151213 --- libc/startup/gpu/amdgpu/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/libc/startup/gpu/amdgpu/CMakeLists.txt b/libc/startup/gpu/amdgpu/CMakeLists.txt index 0f1d4edf285d..e7c0aeafafd9 100644 --- a/libc/startup/gpu/amdgpu/CMakeLists.txt +++ b/libc/startup/gpu/amdgpu/CMakeLists.txt @@ -25,4 +25,5 @@ target_link_libraries( "-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE}" "--target=${LIBC_GPU_TARGET_TRIPLE}" "-flto" + "-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" )