[PATCH] D66682: Fix stack_trace_compressor builds for Clang < 6.0

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 25 08:32:08 PDT 2019


tejohnson added a comment.

In D66682#1644286 <https://reviews.llvm.org/D66682#1644286>, @sylvestre.ledru wrote:

> @hctim
>
> On Ubuntu Xenial with cmake 3.5.1, it fails with:
>
>   Make Error at projects/compiler-rt/lib/gwp_asan/CMakeLists.txt:108 (if):
>     if given arguments:
>  
>       "COMPILER_RT_BUILD_LIBFUZZER" "AND" "GNU" "STREQUAL" "Clang" "AND" "CMAKE_CXX_COMPILER_VERSION" "VERSION_GREATER_EQUAL" "6.0"
>  
>     Unknown arguments specified
>  
>
>
> Any idea how to fix this? Thanks


Looks like cmake evaluates the VERSION_GREATER_EQUAL before the AND (https://cmake.org/cmake/help/v3.5/command/if.html#condition-syntax), which presumably leads to this issue since GNU must not have CMAKE_CXX_COMPILER_VERSION defined. According to that cmake documentation, parentheses could be added to force the correct evaluation order. Can you check if the following fixes your issue:

  if (COMPILER_RT_BUILD_LIBFUZZER AND
      ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND
      CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)

If that still fails then I guess it will be necessary to use nested ifs.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66682/new/

https://reviews.llvm.org/D66682





More information about the llvm-commits mailing list