[PATCH] D50416: [cmake] Prevent LLVMgold.so from being unloaded on Linux

Evangelos Foutras via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 06:11:34 PDT 2018


foutrelis added a comment.

In https://reviews.llvm.org/D50416#1192106, @mgorny wrote:

> I don't really know BFD plugin API, so I don't know if this could have any implications (I suppose upstream's answer may be helpful there). However, I don't think it likely to cause any real trouble.


Certainly, we can wait for a reply from binutils first. If the dlclose() stays, "-z nodelete" seems like a good way to ensure LLVMgold.so won't be loaded twice.

The patch here also means that BugpointPasses.so gets the NODELETE flag. I'm not familiar with that part of LLVM and haven't tested it with this change.

> Just to confirm, have you tested it thoroughly?

Not an exhaustive test but:

I hit the binutils issue <https://sourceware.org/bugzilla/show_bug.cgi?id=23460> when building Chromium after binutils 2.31.1 landed in Arch Linux.

After patching binutils to not leave open files, the Chromium build would fail immediately when `ar` was run with:

  CommandLine Error: Option 'asm-instrumentation' registered more than once!

After adding the NODELETE flag to LLVMgold.so (through this patch), the Chromium build completed successfully (using clang w/ ThinLTO and also LLD for linking).


Repository:
  rL LLVM

https://reviews.llvm.org/D50416





More information about the llvm-commits mailing list