[llvm-bugs] [Bug 35446] New: Please backport r319105 to 5.0.1: [cmake] Pass -Wl, -z, nodelete on Linux to prevent unloading
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Nov 28 07:20:14 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=35446
Bug ID: 35446
Summary: Please backport r319105 to 5.0.1: [cmake] Pass
-Wl,-z,nodelete on Linux to prevent unloading
Product: new-bugs
Version: 5.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: mgorny at gentoo.org
CC: llvm-bugs at lists.llvm.org
Blocks: 34492
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 <mgorny at gentoo.org>
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 https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html
Differential Revision: https://reviews.llvm.org/D40459
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319105
91177308-0d34-0410-b5e6-96231b3b80d8
Referenced Bugs:
https://bugs.llvm.org/show_bug.cgi?id=34492
[Bug 34492] [meta] 5.0.1 Release Blockers
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171128/f39395ae/attachment.html>
More information about the llvm-bugs
mailing list