[SYCL][UR] Fix build with libc++ #19521
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We previously added support for building
libsycl
individually withlibc++
. At that time,libsycl
didn't link againstlibLLVM
so they did not need to be using the same STL implementation.Now,
libsycl
does link againstlibLLVM
, one example here.Remove all the code that was to support
libsycl
in particular and just make it work with the normal option LLVM uses,LLVM_ENABLE_LIBCXX
. Most of the code I added actually checksLLVM_LIBCXX_USED
, because LLVM checks at configure time iflibc++
actually works even when passedLLVM_ENABLE_LIBCXX
, and if it fails, it falls back tolibstdc++
, and most of the time we actually want to know if we are actually usinglibc++
.I added a CMake option
SYCL_LIBDEVICE_CXX_FLAGS
to set the flags for libdevice because it will be required if someone doesn't use the LLVM option and just does it throughCMAKE_CXX_FLAGS
, as those aren't used for libdevice but it still uses the STL.The two changes in
unified-runtime/source/loader/layers/sanitizer/msan/msan_libdevice.hpp
andsycl/source/builtins/common_functions.cpp
fix compile errors withlibc++
.I also plan to add a job to the nightly to lock this down.
#19347