[SYCL][Driver] Link with sycl libs at link step of clang-cl -fsycl
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. https://github.com/intel/llvm/pull/12367
Failed Tests (8):
SYCL :: Assert/assert_in_kernels_win.cpp
SYCL :: Assert/assert_in_multiple_tus_one_ndebug_win.cpp
SYCL :: Assert/assert_in_multiple_tus_win.cpp
SYCL :: Assert/assert_in_one_kernel_win.cpp
SYCL :: Assert/assert_in_simultaneous_kernels_win.cpp
SYCL :: Assert/assert_in_simultaneously_multiple_tus.cpp
SYCL :: Assert/assert_in_simultaneously_multiple_tus_one_ndebug.cpp
SYCL :: Plugin/sycl-ls-unified-runtime.cpp
These tests are also failing in https://github.com/intel/llvm/pull/12367 and https://github.com/intel/llvm/pull/12783 and are unrelated to this PR.
LGTM. I could imagine scenarios where the object is built with
-fpreview-breaking-changesbut 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.