From 785ce571d9fee8fec2b27092dfcfe2cf17c896c3 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Tue, 12 Feb 2019 01:09:07 +0000 Subject: [CMake][XRay] Silence llvm-config error when checking library support Otherwise this propagates all the way to CMake and results in an error during configuration. We check and handle the result and report warning separately so this is not changing the behavior. Differential Revision: https://reviews.llvm.org/D58086 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353784 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/Modules/CompilerRTUtils.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmake/Modules/CompilerRTUtils.cmake') diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index 5348f2064..3ebd92739 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -233,7 +233,8 @@ macro(load_llvm_config) execute_process( COMMAND ${LLVM_CONFIG_PATH} "--ldflags" "--libs" "xray" RESULT_VARIABLE HAD_ERROR - OUTPUT_VARIABLE CONFIG_OUTPUT) + OUTPUT_VARIABLE CONFIG_OUTPUT + ERROR_QUIET) if (HAD_ERROR) message(WARNING "llvm-config finding xray failed with status ${HAD_ERROR}") set(COMPILER_RT_HAS_LLVMXRAY FALSE) @@ -250,7 +251,8 @@ macro(load_llvm_config) execute_process( COMMAND ${LLVM_CONFIG_PATH} "--ldflags" "--libs" "testingsupport" RESULT_VARIABLE HAD_ERROR - OUTPUT_VARIABLE CONFIG_OUTPUT) + OUTPUT_VARIABLE CONFIG_OUTPUT + ERROR_QUIET) if (HAD_ERROR) message(WARNING "llvm-config finding testingsupport failed with status ${HAD_ERROR}") else() -- cgit v1.2.1 From 9f496373305ea9aff3ef6780dbfa116f8bf92ee4 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 15 Mar 2019 20:14:46 +0000 Subject: [CMake] Fix broken uses of `try_compile_only()` and improve the function. Summary: There were existing calls to `try_compile_only()` with arguments not prefixed by `SOURCE` or `FLAGS`. These were silently being ignored. It looks like the `SOURCE` and `FLAGS` arguments were first introduced in r278454. One implication of this is that for a builtins only build for Darwin (see `darwin_test_archs()`) it would mean we weren't actually passing `-arch ` to the compiler). This would result in compiler-rt claiming all supplied architectures could be targetted provided the compiler could build for Clang's default architecture. This patch fixes this in several ways. * Fixes all incorrect calls to `try_compile_only()`. * Adds code to `try_compile_only()` to check for unhandled arguments and raises a fatal error if this occurs. This should stop any incorrect calls in the future. * Improve the documentation on `try_compile_only()` which seemed completely wrong. rdar://problem/48928526 Reviewers: beanz, fjricci, dsanders, kubamracek, yln, dcoughlin Subscribers: mgorny, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59429 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@356295 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/Modules/CompilerRTUtils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake/Modules/CompilerRTUtils.cmake') diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index 3ebd92739..957452cff 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -128,7 +128,7 @@ macro(test_target_arch arch def) if(NOT HAS_${arch}_DEF) set(CAN_TARGET_${arch} FALSE) elseif(TEST_COMPILE_ONLY) - try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS}) + try_compile_only(CAN_TARGET_${arch} FLAGS ${TARGET_${arch}_CFLAGS}) else() set(FLAG_NO_EXCEPTIONS "") if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) -- cgit v1.2.1