[PATCH] D31098: [compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library tests

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 14:24:53 PDT 2017


On Mon, Mar 20, 2017 at 2:06 PM, Chris Bieneman via Phabricator <
reviews at reviews.llvm.org> wrote:

> beanz added a comment.
>
> @davidxl, do you recall how the failure that caused you to make the policy
> change exhibited itself? It seems to me like we were working around the
> behavior of the old policy setting by passing the linker options through
> manually. I wonder if the reason for the error was CMake masking those
> liker flags under the new policy.
>
> Thoughts?
>

Unfortunately I don't remember the details -- only the information in the
comments.

I think this is a good time to get to the bottom of it.

David


>
>
>
> ================
> Comment at: CMakeLists.txt:17
>  cmake_minimum_required(VERSION 3.4.3)
> -# FIXME:
> -# The OLD behavior (pre 3.2) for this policy is to not set the value of
> the
> -# CMAKE_EXE_LINKER_FLAGS variable in the generated test project. The NEW
> behavior
> -# for this policy is to set the value of the CMAKE_EXE_LINKER_FLAGS
> variable
> -# in the test project to the same as it is in the calling project. The new
> -# behavior cause the compiler_rt test to fail during try_compile: see
> -# projects/compiler-rt/cmake/Modules/CompilerRTUtils.cmake:121 such that
> -# CAN_TARGET_${arch} is not set properly. This results in
> COMPILER_RT_SUPPORTED_ARCH
> -# not being updated properly leading to poblems.
> -cmake_policy(SET CMP0056 OLD)
> +cmake_policy(SET CMP0056 NEW)
>
> ----------------
> You shouldn't need to set this to NEW, it should default to NEW based on
> the `cmake_minimum_version` being set above.
>
>
> ================
> Comment at: cmake/Modules/CompilerRTUtils.cmake:129
> +  set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
> +  set(CMAKE_EXE_LINKER_FLAGS "")
>    set(TARGET_${arch}_CFLAGS ${ARGN})
> ----------------
> Pretty sure this will actually change behavior. Look down below, we were
> reading this value and passing it through to the `try_compile` call.
>
>
> https://reviews.llvm.org/D31098
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170320/8247fa65/attachment.html>


More information about the llvm-commits mailing list