[all-commits] [llvm/llvm-project] 7f24fd: [OpenMP] Only include CMAKE_DL_LIBS on unix platforms

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Aug 2 01:00:33 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f24fd26a8abaef2fa4561aa399adde81d9c563a
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M openmp/runtime/src/CMakeLists.txt

  Log Message:
  [OpenMP] Only include CMAKE_DL_LIBS on unix platforms

CMAKE_DL_LIBS is documented as "Name of library containing dlopen
and dlclose".

On Windows platforms, there's no system provided dlopen/dlclose, but
it can be argued that if you really intend to call dlopen/dlclose,
you're going to be using a third party compat library like
https://github.com/dlfcn-win32/dlfcn-win32, and CMAKE_DL_LIBS should
expand to its name.

This has been argued upstream in CMake in
https://gitlab.kitware.com/cmake/cmake/-/issues/17600 and
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1642, that
CMAKE_DL_LIBS should expand to "dl" on mingw platforms.

The merge request wasn't merged though, as it caused some amount of
breakage, but in practice, Fedora still carries a custom CMake patch
with the same effect.

Thus, this patch fixes cross compiling OpenMP for mingw targets
on Fedora with their custom-patched CMake.

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

  Commit: b7c5683fac3de2f3349d57b9e133ac53204b1148
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M lldb/source/Core/Disassembler.cpp

  Log Message:
  [lldb] Silence a GCC warning about missing returns after a fully covered switch. NFC.

  Commit: 46b5ab15cdd568256085d2fd28fb3c8e9cafab53
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M flang/tools/f18/CMakeLists.txt

  Log Message:
  [flang] Don't try to run the newly built flang-new when cross compiling

If CMAKE_CROSSCOMPILING, then the newly built flang-new executable was
cross compiled and thus can't be executed on the build system, and thus
can't be used for generating module files.

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

  Commit: 112499f35f4169f798d7f6436cf60e822b9c1da0
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M flang/CMakeLists.txt
    M mlir/CMakeLists.txt

  Log Message:
  [mlir] Fix calling the native mlir-tblgen tool when cross compiling flang

When the mlir-tblgen tool is set up, the `MLIR_TABLEGEN_EXE` variable
is set, which either points to the mlir-tblgen tool built in the current
cmake build, or points to one built in a nested cmake build (if cross
conpiling, or if building with e.g. `LLVM_OPTIMIZED_TABLEGEN`.

The `MLIR_TABLEGEN_EXE` variable is only set within the scope of the
mlir/CMakeLists.txt file, so it's unavailable in sibling level projects
such as flang.

Set the `MLIR_TABLEGEN_EXE` and the `MLIR_TABLEGEN_TARGET` variables
as global, so that flang can use them properly without guessing.

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

Compare: https://github.com/llvm/llvm-project/compare/afb785f51161...112499f35f41

More information about the All-commits mailing list