From 2ed59c3a347b0e31f69f0c899b17d2e53d16d04f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 13 Sep 2022 08:14:21 -0400 Subject: [PATCH] Add CMAKE ASM workaround for newer clang (backport of #74696) --- eng/native/configurecompiler.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index c6f4a6a5627542..f3526deb19fa0d 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -670,6 +670,13 @@ if (CLR_CMAKE_HOST_WIN32) endif() else (CLR_CMAKE_HOST_WIN32) + # This is a workaround for upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22995. + # + # In Clang.cmake, the decision to use single or double hyphen for target and gcc-toolchain + # is made based on CMAKE_${LANG}_COMPILER_VERSION, but CMAKE_ASM_COMPILER_VERSION is empty + # so it picks up single hyphen options, which new clang versions don't recognize. + set (CMAKE_ASM_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}") + enable_language(ASM) endif(CLR_CMAKE_HOST_WIN32)