[all-commits] [llvm/llvm-project] 1602c6: [AIX][cmake] Adjust management of `-G` for linking

Hubert Tong via All-commits all-commits at lists.llvm.org
Fri Oct 23 11:32:55 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1602c6fd9294494aaa7461e258602d486166b303
      https://github.com/llvm/llvm-project/commit/1602c6fd9294494aaa7461e258602d486166b303
  Author: Hubert Tong <hubert.reinterpretcast at gmail.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

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

  Log Message:
  -----------
  [AIX][cmake] Adjust management of `-G` for linking

The change in 0ba98433971f changed the behaviour of the build when
using an XL build compiler because `-G` is not a pure linker option:
it also implies `-shared`. This was accounted for in the base CMake
configuration, so an analysis of the change from 0ba98433971f in
relation to a build using Clang (where `-shared` is introduced by CMake)
would not identify the issue. This patch resolves this particular issue
by adding `-shared` alongside `-Wl,-G`.

At the same time, the investigation reveals that several aspects of the
various build configurations are not operating in the manner originally
intended.

The other issue related to the `-G` linker option in the build is that
the removal of it (to avoid unnecessary use of run-time linking) is not
effective for the build using the Clang compiler. This patch addresses
this by adjusting the regular expressions used to remove the broadly-
applied `-G`.

Finally, the issue of specifying the export list with `-Wl,` instead of
a compiler option is flagged with a FIXME comment.

Reviewed By: daltenty, amyk

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




More information about the All-commits mailing list