[PATCH] D87418: [LLD] Allow configuring default ld.lld backend

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 14:03:11 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/CMakeLists.txt:196
 
+set(LLD_DEFAULT_LD_LLD_BACKEND "ELF"
+    CACHE STRING "Default backend for ld.lld, can be either ELF (default) or MINGW")
----------------
pcc wrote:
> MaskRay wrote:
> > How about a boolean variable `LLD_DEFAULT_LD_LLD_IS_MINGW`?
> > 
> > Then you can write `#if LLD_DEFAULT_LD_LLD_IS_MINGW`, a Bazel based build system which does not need to this variable (my users) does not need any change.
> > Additionally, the gn build will not break.
> The other build systems aren't really supported though, so we should probably do whatever makes sense for the cmake build and let the other build systems deal with it.
If mingw is an anomaly, I think a boolean variable makes more sense than a string variable with multiple values. The convenience for other build systems is a  byproduct.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87418



More information about the llvm-commits mailing list