Skip to content

Commit 0106e5a

Browse files
committed
[libc] Temporarily disable LTO flags for AMDGPU crt1.o
Summary: Some recent changes seem to have introduced a bug that breaks this. Turn it off while I triage it.
1 parent 3e59b00 commit 0106e5a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libc/startup/gpu/CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ function(add_startup_object name)
3333
set_target_properties(${fq_target_name}.exe PROPERTIES
3434
RUNTIME_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR}
3535
RUNTIME_OUTPUT_NAME ${name}.o)
36-
target_link_options(${fq_target_name}.exe PRIVATE
37-
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm")
36+
# FIXME: A bug in the AMDGPU LTO pass is incorrectly removing the kernels.
37+
if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
38+
target_link_options(${fq_target_name}.exe PRIVATE
39+
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm")
40+
else()
41+
target_link_options(${fq_target_name}.exe PRIVATE
42+
"-r" "-nostdlib" "-Wl,--lto-emit-llvm")
43+
endif()
3844
endif()
3945
endfunction()
4046

0 commit comments

Comments
 (0)