[PATCH] D22387: [compiler-rt] Update compiler-rt for cross-compilation with multiple architectures

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 10:16:04 PDT 2016


compnerd added a comment.

The various architecture spellings are available in config-ix.cmake, and it seems nicer to re-use those.  Note that the alternate that I proposed I just wrote up, didnt actually run, so it probably requires tweaking :-)


================
Comment at: cmake/Modules/CompilerRTUtils.cmake:147
@@ -168,1 +146,3 @@
+  endforeach()
+  set(CMAKE_REQUIRED_FLAGS "${SAVED_CMAKE_REQUIRED_FLAGS}")
 endmacro()
----------------
I think that this is better written as:

    set(SAVED_CMAKE_REQUIRED_FLAS "${CMAKE_REQUIRED_FLAGS}")
    foreach(arch ARM64;ARM32;X86;X86_64;MIPS32;MIPS64;S390X;WASM32;WASM64)
      set(CMAKE_REQUIRED_FLAGS "${SAVED_CMAKE_REQUIRED_FLAGS} ${${TARGET_${arch}_CFLAGS}}")
      foreach(spelling ${${arch}})
        check_symbol_exists(__${spelling}__ "" __${arch}_${spelling})
        if(__${arch}_${spelling})
          add_default_target_arch("${arch}")
          break()
        endif()
      endforeach()
    endforeach()


https://reviews.llvm.org/D22387





More information about the llvm-commits mailing list