-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][Driver] Link with sycl libs at link step of clang-cl -fsycl #12793
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
This PR is addressing the following scenario: clang-cl -I[path to sycl headers] sycl_program.cpp # program compiled but without sycl libs clang-cl -fsycl sycl_program.obj # user expects sycl libs to be linked automatically here. Without this fix this scenario fails at link step because sycl libraries are not pulled in. This scenario already works for clang driver, so only clang-cl needs a fix.
ESIMD/regression/complex-lib-lin.cpp failure unrelated and was seen on another PRs, e.g. #12367 |
These tests are also failing in #12367 and #12783 and are unrelated to this PR. |
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. I could imagine scenarios where the object is built with -fpreview-breaking-changes
but the option is not used during the link (or vice-versa) causing different sycl libs to be linked in. Is there anything we can do about that?
Oh, good question, I don't have quick ideas, will need to try experiment locally. |
…fsycl (intel#12793)" This reverts commit d6eecfa.
…fsycl (#12793)" (#13326) This reverts commit d6eecfa. This was commit was trying to cover the scenario: ``` clang-cl -I[path to sycl headers] sycl_program.cpp clang-cl -fsycl sycl_program.obj ``` and automatically link with sycl library at link step in such case. But problem is that at link step there is no way to know if -fsycl -MDd option was used at compile step or not. if -fsycl -MDd is used at compilation step then driver adds --dependent-lib=msvcrtd --dependent-lib=sycl7d options: `clang-cl -fsycl -MDd sycl_program.cpp # --dependent-lib=msvcrtd --dependent-lib=sycl7d` If then user links the program like this (without -MDd): `clang-cl -fsycl sycl_program.obj` then we will also link with sycl7 library (release version) which will cause a problem. Because at link step we don't know if we need to use debug of release version of the library. So, from my understanding this case: ``` clang-cl -I[path to sycl headers] sycl_program.cpp clang-cl -fsycl sycl_program.obj ``` can't be supported and needs to be considered as user's mistake.
This PR is addressing the following scenario:
clang-cl -I[path to sycl headers] sycl_program.cpp # program compiled but without sycl libs
clang-cl -fsycl sycl_program.obj # user expects sycl libs to be linked automatically here.
Without this fix this scenario fails at link step because sycl libraries are not pulled in.
This scenario already works for clang driver, so only clang-cl needs a fix.