<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Please backport r319105 to 5.0.1: [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading"
   href="https://bugs.llvm.org/show_bug.cgi?id=35446">35446</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Please backport r319105 to 5.0.1: [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mgorny@gentoo.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>34492
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This has no effect on most of LLVM installs (static & dylib) but it's very
important for BUILD_SHARED_LIBS=ON installs as it unbreaks mesa plugins.


commit 937b23b5fffa59deb1dc342cc5602d387d84a762
Author: Michal Gorny <<a href="mailto:mgorny@gentoo.org">mgorny@gentoo.org</a>>
Date:   Mon Nov 27 23:23:09 2017

    [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading

    Prevent unloading shared libraries on Linux when dlclose() is called.
    This is necessary since command-line option parsing API relies on
    registering the global option instances in the option parser instance
    which can be loaded in a different shared library.

    Given that we can't reliably remove those options when a library is
    unloaded, the parser ends up containing dangling references. Since glibc
    has relatively complex library unloading rules, some of the LLVM
    libraries can be unloaded while others (including the Support library)
    stay loaded causing quite a mayhem. To reliably prevent that, just
    forbid unloading all libraries -- it's a very bad idea anyway.

    While the issue arguably happens only with BUILD_SHARED_LIBS, it may
    affect any library reusing llvm::cl interface.

    Based on patch provided Ross Hayward on <a href="https://bugs.gentoo.org/617154">https://bugs.gentoo.org/617154</a>.
    Previously hit by Fedora back in Feb 2016:
    <a href="https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html">https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html</a>

    Differential Revision: <a href="https://reviews.llvm.org/D40459">https://reviews.llvm.org/D40459</a>

    git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@319105">https://llvm.org/svn/llvm-project/llvm/trunk@319105</a>
91177308-0d34-0410-b5e6-96231b3b80d8</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [meta] 5.0.1 Release Blockers"
   href="https://bugs.llvm.org/show_bug.cgi?id=34492">Bug 34492</a>] [meta] 5.0.1 Release Blockers
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>