[all-commits] [llvm/llvm-project] 415b1e: [CMake] Enable -z defs on Solaris

rorth via All-commits all-commits at lists.llvm.org
Wed Jul 27 03:34:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 415b1e872cb33b3354f2b7a11ec52d236cea46a1
      https://github.com/llvm/llvm-project/commit/415b1e872cb33b3354f2b7a11ec52d236cea46a1
  Author: Rainer Orth <ro at CeBiTec.Uni-Bielefeld.DE>
  Date:   2022-07-27 (Wed, 27 Jul 2022)

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

  Log Message:
  -----------
  [CMake] Enable -z defs on Solaris

I wondered why I hadn't seen the link failures in D130571
<https://reviews.llvm.org/D130571> on Solaris/sparcv9 and found that
Solaris, unlike Linux, doesn't use `-Wl,-z,defs` when linking shared
objects.  The three affected shared objects indeed have undefined
references to several 64-bit atomics.

This patch will expose such issues in the future by defaulting to
`-Wl,-z,defs` on Solaris, as recommended in `ld(1)`.

Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.

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




More information about the All-commits mailing list