[all-commits] [llvm/llvm-project] a382a7: [clang] Fix libclang linking on Solaris

rorth via All-commits all-commits at lists.llvm.org
Sat Aug 7 12:15:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a382a746275b4a1eb1867331efa2319c614305d8
      https://github.com/llvm/llvm-project/commit/a382a746275b4a1eb1867331efa2319c614305d8
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2021-08-07 (Sat, 07 Aug 2021)

  Changed paths:
    M clang/tools/libclang/CMakeLists.txt
    M clang/tools/libclang/libclang.map

  Log Message:
  -----------
  [clang] Fix libclang linking on Solaris

Linking `libclang.so` is currently broken on Solaris:

  ld: fatal: option --version-script requires option -z gnu-version-script-compat to be specified

While Solaris `ld` supports a considerable subset of `--version-script`,
there are some elements of the syntax that aren't.

The fix is equivalent to D78510 <https://reviews.llvm.org/D78510>.

Additionally, use of C-style comments is a GNU extension
that can easily be avoided by using `#` as comment character, which is
supported by GNU `ld`, `gold`, and `lld`.

Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`,
`x86_64-pc-linux-gnu`.

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




More information about the All-commits mailing list