-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
Conversation
@frasercrmck could you please review? thanks |
…ch_suffix Currently link_bc command depends on the bitcode file that is associated with custom target builtins.link.clc-arch_suffix. On windows we randomly see following error: ` Generating builtins.link.clc-${ARCH}--.bc Generating builtins.link.libspirv-${ARCH}.bc error : The requested operation cannot be performed on a file with a user-mapped section open. ` I suspect that builtins.link.clc-${ARCH}--.bc file is being generated while it is being used in link_bc. This PR adds target-level dependency to ensure builtins.link.clc-${ARCH}--.bc is generated first.
a423c4d
to
6ce54aa
Compare
libclc/cmake/modules/AddLibclc.cmake
Outdated
@@ -211,8 +211,9 @@ endfunction() | |||
# * ALIASES <string> ... | |||
# List of aliases | |||
# * INTERNAL_LINK_DEPENDENCIES <string> ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this comment is to be updated it should probably say <target> ...
? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
libclc/cmake/modules/AddLibclc.cmake
Outdated
@@ -313,8 +314,8 @@ function(add_libclc_builtin_set) | |||
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} | |||
$<TARGET_PROPERTY:${ARG_INTERNAL_LINK_DEPENDENCIES},TARGET_FILE> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this will work correctly if ARG_INTERNAL_LINK_DEPENDENCIES
is a list. You won't be able to find a property on foo-target;bar-target
, for example. It might silently do the wrong thing, or it might error, I'm not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, changed to reading TARGE_FILE from each target
I've tested on Windows for half a day, it seems this PR can fix the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Currently link_bc command depends on the bitcode file that is associated with custom target builtins.link.clc-arch_suffix.
On windows we randomly see following error:
Generating builtins.link.clc-${ARCH}--.bc Generating builtins.link.libspirv-${ARCH}.bc error : The requested operation cannot be performed on a file with a user-mapped section open.
I suspect that builtins.link.clc-${ARCH}--.bc file is being generated while it is being used in link_bc.
This PR adds target-level dependency to ensure builtins.link.clc-${ARCH}--.bc is generated first.