[llvm] r354374 - Fix builds for older macOS deployment targets after r354365

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 12:31:57 PST 2019


This appears to have broken our builders on all platforms with the
following error:

CMake Error at /b/s/w/ir/kitchen-workdir/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake:920
(check_symbol_exists): Unknown CMake command "check_symbol_exists".
Call Stack (most recent call first): CMakeLists.txt:111 (include)

This full log can be seen here:
https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8921065003141899296/+/steps/clang/0/steps/build/0/stdout

Is there an include for check_symbol_exists missing?

On Tue, Feb 19, 2019 at 11:44 AM Daniel Sanders via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> Author: dsanders
> Date: Tue Feb 19 11:45:03 2019
> New Revision: 354374
>
> URL: http://llvm.org/viewvc/llvm-project?rev=354374&view=rev
> Log:
> Fix builds for older macOS deployment targets after r354365
>
> Surprisingly, check_symbol_exists is not sufficient. The macOS linker checks the
> called functions against a compatibility list for the given deployment target
> and check_symbol_exists doesn't trigger this check as it never calls the
> function.
>
> This fixes the GreenDragon bots where the deployment target is 10.9
>
> Modified:
>     llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
>
> Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=354374&r1=354373&r2=354374&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
> +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Tue Feb 19 11:45:03 2019
> @@ -917,25 +917,31 @@ get_compile_definitions()
>
>  option(LLVM_FORCE_ENABLE_STATS "Enable statistics collection for builds that wouldn't normally enable it" OFF)
>
> -check_symbol_exists(os_signpost_interval_begin "os/signpost.h" _signposts_available)
> -if(_signposts_available)
> -  set(LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS "WITH_ASSERTS" CACHE STRING
> -      "Enable support for Xcode signposts. Can be WITH_ASSERTS, FORCE_ON, FORCE_OFF")
> -  string(TOUPPER "${LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS}"
> -                 uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS)
> -  if( uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS STREQUAL "WITH_ASSERTS" )
> -    if( LLVM_ENABLE_ASSERTIONS )
> +check_symbol_exists(os_signpost_interval_begin "os/signpost.h" macos_signposts_available)
> +if(macos_signposts_available)
> +  check_cxx_source_compiles(
> +    "#include <os/signpost.h>
> +    int main() { os_signpost_interval_begin(nullptr, 0, \"\", \"\"); return 0; }"
> +    macos_signposts_usable)
> +  if(macos_signposts_usable)
> +    set(LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS "WITH_ASSERTS" CACHE STRING
> +        "Enable support for Xcode signposts. Can be WITH_ASSERTS, FORCE_ON, FORCE_OFF")
> +    string(TOUPPER "${LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS}"
> +                   uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS)
> +    if( uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS STREQUAL "WITH_ASSERTS" )
> +      if( LLVM_ENABLE_ASSERTIONS )
> +        set( LLVM_SUPPORT_XCODE_SIGNPOSTS 1 )
> +      endif()
> +    elseif( uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS STREQUAL "FORCE_ON" )
>        set( LLVM_SUPPORT_XCODE_SIGNPOSTS 1 )
> +    elseif( uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS STREQUAL "FORCE_OFF" )
> +      # We don't need to do anything special to turn off signposts.
> +    elseif( NOT DEFINED LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS )
> +      # Treat LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS like "FORCE_OFF" when it has not been
> +      # defined.
> +    else()
> +      message(FATAL_ERROR "Unknown value for LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS:"
> +                          " \"${LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS}\"!")
>      endif()
> -  elseif( uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS STREQUAL "FORCE_ON" )
> -    set( LLVM_SUPPORT_XCODE_SIGNPOSTS 1 )
> -  elseif( uppercase_LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS STREQUAL "FORCE_OFF" )
> -    # We don't need to do anything special to turn off signposts.
> -  elseif( NOT DEFINED LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS )
> -    # Treat LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS like "FORCE_OFF" when it has not been
> -    # defined.
> -  else()
> -    message(FATAL_ERROR "Unknown value for LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS:"
> -                        " \"${LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS}\"!")
>    endif()
>  endif()
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list