[libcxx-commits] [PATCH] D117537: [cmake] Deduplicate `{llvm, compiler_rt}_check_linker_flag` for runtime libs and llvm

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 21 00:21:49 PST 2022


phosek added a comment.

In D117537#3259970 <https://reviews.llvm.org/D117537#3259970>, @Ericson2314 wrote:

> Perhaps the difference betwen `CMAKE_EXE_LINKER_FLAGS` and `CMAKE_REQUIRED_FLAGS` is important? Also, if it is not possible to link until these libraries are built (e.g. in a cross setting) maybe I am not sure what happens.
>
> If it was neessary these flags aren't just checked re linking, maybe we need to make a similar compat wrapper around https://cmake.org/cmake/help/latest/module/CheckCompilerFlag.html and use that instead?

`CMAKE_EXE_LINKER_FLAGS` is only passed to `try_compile` (which is what `check_${lang}_compiler_flag` uses internally when `CMP0056` policy is set to `NEW` which we don't do in LLVM.

We either need to set this policy, or change `llvm_check_linker_flag` to use `CMAKE_REQUIRED_FLAGS` instead `CMAKE_EXE_LINKER_FLAGS`.

Can we revert this change until we figure the best path forward?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117537



More information about the libcxx-commits mailing list