llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL][Driver] Link with sycl libs at link step of clang-cl -fsycl

Open againull opened this issue 1 year ago • 2 comments

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.

againull avatar Feb 22 '24 00:02 againull

ESIMD/regression/complex-lib-lin.cpp failure unrelated and was seen on another PRs, e.g. https://github.com/intel/llvm/pull/12367

againull avatar Feb 22 '24 03:02 againull

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.

againull avatar Feb 22 '24 05:02 againull

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.

againull avatar Feb 22 '24 15:02 againull