[all-commits] [llvm/llvm-project] 76b897: [compiler-rt] Fix linking a standalone libatomic f...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Thu Dec 7 03:25:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76b89759193ec17ff84e475eb4d093df6c4d95e0
      https://github.com/llvm/llvm-project/commit/76b89759193ec17ff84e475eb4d093df6c4d95e0
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-12-07 (Thu, 07 Dec 2023)

  Changed paths:
    M compiler-rt/lib/builtins/CMakeLists.txt

  Log Message:
  -----------
  [compiler-rt] Fix linking a standalone libatomic for MinGW (#74668)

Whenever linking with -nodefaultlibs for a MinGW target, we manually
need to specify a bunch of libraries - listed in ${MINGW_LIBRARIES}; the
same is already done for sanitizers and libunwind/libcxxabi/libcxx.

Practically speaking, linking with -nodefaultlibs but manually passing
the libraries in ${MINGW_LIBRARIES} restores most of the libraries that
are linked by default, except for the potential compiler builtins and
unwind library; i.e. it has essentially the same effect as linking with
"--unwindlib=none -rtlib=none", except that -rtlib doesn't accept such a
value.

When building only compiler-rt/lib/builtins, not all of compiler-rt,
${MINGW_LIBRARIES} is unset - set it manually here for that case. This
matches what is set in
compiler-rt/cmake/config-ix.cmake, except that the builtins (libgcc or
compiler-rt builtins) is omitted; the only use within lib/buitlins is
for the standalone libatomic, which explicitly already links against the
just-built builtins.




More information about the All-commits mailing list