[compiler-rt] r244549 - [cmake] Hoist check for LLD sources up into root CMakeLists.txt

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 21:31:01 PDT 2015


Hi Reid,

On Mon, Aug 10, 2015 at 5:33 PM, Reid Kleckner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rnk
> Date: Mon Aug 10 19:33:07 2015
> New Revision: 244549
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244549&view=rev
> Log:
> [cmake] Hoist check for LLD sources up into root CMakeLists.txt
>
> We will use this for ASan on Windows soon. When the ELF port of LLD
> matures, we can add other sanitizer integration tests to make sure they
> work with LLD.
>
> Modified:
>     compiler-rt/trunk/CMakeLists.txt
>     compiler-rt/trunk/test/cfi/CMakeLists.txt
>     compiler-rt/trunk/test/lit.common.cfg
>     compiler-rt/trunk/test/lit.common.configured.in
>
> Modified: compiler-rt/trunk/CMakeLists.txt
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=244549&r1=244548&r2=244549&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/CMakeLists.txt (original)
> +++ compiler-rt/trunk/CMakeLists.txt Mon Aug 10 19:33:07 2015
> @@ -355,6 +355,14 @@ else()
>    set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE)
>  endif()
>
> +set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)
>
Please make it work for the external lld source case.
At the very least, the LLVM_EXTERNAL_LLD_SOURCE_DIR variable should be
used, if it's there and we don't have lld in the main source dir.


> +if(EXISTS ${COMPILER_RT_LLD_PATH}/)
> +  set(COMPILER_RT_HAS_LLD_SOURCES TRUE)
> +else()
> +  set(COMPILER_RT_HAS_LLD_SOURCES FALSE)
> +endif()
> +pythonize_bool(COMPILER_RT_HAS_LLD_SOURCES)
> +
>  add_subdirectory(lib)
>
>  if(COMPILER_RT_INCLUDE_TESTS)
>
> Modified: compiler-rt/trunk/test/cfi/CMakeLists.txt
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/CMakeLists.txt?rev=244549&r1=244548&r2=244549&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/cfi/CMakeLists.txt (original)
> +++ compiler-rt/trunk/test/cfi/CMakeLists.txt Mon Aug 10 19:33:07 2015
> @@ -19,7 +19,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)
>        LTO
>      )
>    endif()
> -  if(WIN32 AND EXISTS ${CMAKE_SOURCE_DIR}/tools/lld)
> +  if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES)
>      list(APPEND CFI_TEST_DEPS
>        lld
>      )
>
> Modified: compiler-rt/trunk/test/lit.common.cfg
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=244549&r1=244548&r2=244549&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/lit.common.cfg (original)
> +++ compiler-rt/trunk/test/lit.common.cfg Mon Aug 10 19:33:07 2015
> @@ -106,6 +106,10 @@ sanitizer_can_use_cxxabi = getattr(confi
>  if sanitizer_can_use_cxxabi:
>    config.available_features.add('cxxabi')
>
> +# Test lld if it is available.
> +if config.has_lld:
> +  config.available_features.add('lld')
> +
>  lit.util.usePlatformSdkOnDarwin(config, lit_config)
>
>  def is_darwin_lto_supported():
>
> Modified: compiler-rt/trunk/test/lit.common.configured.in
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.configured.in?rev=244549&r1=244548&r2=244549&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/lit.common.configured.in (original)
> +++ compiler-rt/trunk/test/lit.common.configured.in Mon Aug 10 19:33:07
> 2015
> @@ -28,6 +28,7 @@ set_default("compiler_rt_debug", @COMPIL
>  set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")
>  set_default("emulator", "@COMPILER_RT_EMULATOR@")
>  set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@
> )
> +set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@)
>
>  # LLVM tools dir can be passed in lit parameters, so try to
>  # apply substitution.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150810/de138a53/attachment.html>


More information about the llvm-commits mailing list