[all-commits] [llvm/llvm-project] f28e48: [cmake] Don't try creating an executable when dete...

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed Jun 8 11:37:13 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f28e48f3ef5aad3552a21f858aa501b4139a6f69
      https://github.com/llvm/llvm-project/commit/f28e48f3ef5aad3552a21f858aa501b4139a6f69
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-06-08 (Wed, 08 Jun 2022)

  Changed paths:
    M llvm/cmake/modules/AddLLVM.cmake

  Log Message:
  -----------
  [cmake] Don't try creating an executable when detecting the linker

On most platforms, the linker detection command that we run ends up being
something like `clang++ -Wl,-v` or `clang++ -Wl,--version`. This usually
fails with a missing reference to `_main` because we don't have any input
file. However, when compiling for a target that is implicitly freestanding,
the invocation actually succeeds and a dummy `a.out` file is created in
the current working directory. This is extremely annoying because it
creates a `a.out` file at the root of the monorepo when running CMake
configuration from the root.

Differential Revision: https://reviews.llvm.org/D125827




More information about the All-commits mailing list