Skip to content

Commit 201526d

Browse files
jsjiKornevNikita
authored andcommitted
[libclc] Add -fshort-wchar to windows build after f07988f
We were *hacking* the bc file in prepare-builtins by remvoing wchar_size attributes since 8aa3513 Aftre prepare-builtin removal in f07988f, we start to see linking failures in SYCL :: OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp SYCL :: OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp This add the option to build libclc with -fshort-wchar on windows. We are no using wchar anyhow.
1 parent fa59295 commit 201526d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libclc/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
490490
# Add platform specific flags
491491
if(WIN32)
492492
list(APPEND build_flags -D_WIN32)
493+
# wchar is not used in libclc,however,llvm ir contains wchar_size in attr
494+
# the default on windows is 2 vs 4 in clang
495+
# set it to 2 to avoid linking failures due to conflicts.
496+
list(APPEND build_flags -fshort-wchar)
493497
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
494498
list(APPEND build_flags -D__APPLE__)
495499
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

0 commit comments

Comments
 (0)