Commit f8983a6
Fix build with libc++ (#19521)
We previously added support for building `libsycl` individually with
`libc++`. At that time, `libsycl` didn't link against `libLLVM` so they
did not need to be using the same STL implementation.
Now, `libsycl` does link against `libLLVM`, one example
[here](https://github.com/intel/llvm/blob/sycl/sycl/source/CMakeLists.txt#L98).
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 checks `LLVM_LIBCXX_USED`, because
LLVM checks at configure time if `libc++` actually works even when
passed `LLVM_ENABLE_LIBCXX`, and if it fails, it falls back to
`libstdc++`, and most of the time we actually want to know if we are
actually using `libc++`.
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 through `CMAKE_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`
and `sycl/source/builtins/common_functions.cpp` fix compile errors with
`libc++`.
I also plan to add a job to the nightly to lock this down.
intel/llvm#19347
---------
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>1 parent 0679ee4 commit f8983a6
2 files changed
Lines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 214 | | |
223 | 215 | | |
224 | 216 | | |
225 | 217 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | 218 | | |
230 | 219 | | |
231 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments