Skip to content

Commit ee77955

Browse files
committed
Add CMAKE ASM workaround for newer clang
1 parent 165e1ca commit ee77955

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

eng/native/configurecompiler.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,13 @@ if (CLR_CMAKE_HOST_WIN32)
787787
endif()
788788

789789
elseif (NOT CLR_CMAKE_HOST_BROWSER)
790+
# This is a workaround for upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22995.
791+
#
792+
# In Clang.cmake, the decision to use single or double hyphen for target and gcc-toolchain is made
793+
# based on CMAKE_${LANG}_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN, but CMAKE_ASM_COMPILER_VERSION is empty
794+
# so it picks up single hyphen options, which new clang versions don't recognize.
795+
set (CMAKE_ASM_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}")
796+
790797
enable_language(ASM)
791798

792799
endif(CLR_CMAKE_HOST_WIN32)

eng/native/ijw/IJW.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (CLR_CMAKE_HOST_WIN32)
3232
endfunction()
3333

3434
# 4365 - signed/unsigned mismatch
35-
# 4679 - Could not import member. This is an issue with IJW and static abstract methods in interfaces.
35+
# 4679 - Could not import member. This is an issue with IJW and static abstract methods in interfaces.
3636
add_compile_options(/wd4365 /wd4679)
3737

3838
# IJW

eng/native/init-os-and-arch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ case "$CPUName" in
6868

6969
s390x)
7070
arch=s390x
71-
;;
71+
;;
7272

7373
ppc64le)
74-
arch=ppc64le
75-
;;
74+
arch=ppc64le
75+
;;
7676
*)
7777
echo "Unknown CPU $CPUName detected!"
7878
exit 1

0 commit comments

Comments
 (0)