Skip to content

[libclc] link_bc target should depends on target builtins.link.clc-arch_suffix #132338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
GEN_FILES ${opencl_gen_files}
ALIASES ${${d}_aliases}
# Link in the CLC builtins and internalize their symbols
INTERNAL_LINK_DEPENDENCIES $<TARGET_PROPERTY:builtins.link.clc-${arch_suffix},TARGET_FILE>
INTERNAL_LINK_DEPENDENCIES builtins.link.clc-${arch_suffix}
)
endforeach( d )
endforeach( t )
15 changes: 10 additions & 5 deletions libclc/cmake/modules/AddLibclc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ endfunction()
# Optimization options (for opt)
# * ALIASES <string> ...
# List of aliases
# * INTERNAL_LINK_DEPENDENCIES <string> ...
# A list of extra bytecode files to link into the builtin library. Symbols
# from these link dependencies will be internalized during linking.
# * INTERNAL_LINK_DEPENDENCIES <target> ...
# A list of extra bytecode file's targets. The bitcode files will be linked
# into the builtin library. Symbols from these link dependencies will be
# internalized during linking.
function(add_libclc_builtin_set)
cmake_parse_arguments(ARG
"CLC_INTERNAL"
Expand Down Expand Up @@ -309,12 +310,16 @@ function(add_libclc_builtin_set)
INPUTS ${bytecode_files}
DEPENDENCIES ${builtins_comp_lib_tgt}
)
set( internal_link_depend_files )
foreach( tgt ${ARG_INTERNAL_LINK_DEPENDENCIES} )
list( APPEND internal_link_depend_files $<TARGET_PROPERTY:${tgt},TARGET_FILE> )
endforeach()
link_bc(
INTERNALIZE
TARGET ${builtins_link_lib_tgt}
INPUTS $<TARGET_PROPERTY:${builtins_link_lib_tmp_tgt},TARGET_FILE>
${ARG_INTERNAL_LINK_DEPENDENCIES}
DEPENDENCIES ${builtins_link_lib_tmp_tgt}
${internal_link_depend_files}
DEPENDENCIES ${builtins_link_lib_tmp_tgt} ${ARG_INTERNAL_LINK_DEPENDENCIES}
)
endif()

Expand Down