[compiler-rt] [CMake] [compiler-rt] fix architecture checks in runtime builds (PR #66374)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 8 00:14:30 PST 2023


================
@@ -124,15 +125,9 @@ macro(test_target_arch arch def)
                        SOURCE "#include <limits.h>\nint foo(int x, int y) { return x + y; }\n"
                        FLAGS ${TARGET_${arch}_CFLAGS})
     else()
-      set(FLAG_NO_EXCEPTIONS "")
-      if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG)
-        set(FLAG_NO_EXCEPTIONS " -fno-exceptions ")
-      endif()
       set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${argstring}")
-      try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
-                  COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}"
----------------
petrhosek wrote:

This logic is already quite fragile so I'd prefer minimizing the changes. Would it be feasible to just pass `${CMAKE_REQUIRED_FLAGS}` here?

https://github.com/llvm/llvm-project/pull/66374


More information about the llvm-commits mailing list