[PATCH] D63042: [LLD][COFF] Fix missing MergeChunk::Instances cleanup in COFF::link()

Erik McClure via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 01:36:30 PDT 2019


blackhole12 added a comment.

That is not an acceptable solution. This compiler is an embedded, statically linked library that can be used by other programs. It is **not** a standalone compiler. If the library is statically linked, there is literally no way to start a new process without forcing every single user of my library to support their own program being called with a special option for the sole purpose of invoking a linker. Since one of the intended uses, for example, is a game engine script library, which would compile a webassembly script for a map, this compilation process cannot require the game to support calling it's own executable, or link the script engine as a DLL for the sole purpose of having the script engine then load it's own DLL in a new process. These are not reasonable restrictions to have on what is supposed to be a self-contained compiler.

The correct fix is to ensure that the global caches are cleared properly. Even better, perhaps the global variables should all be gathered in the same place instead of being sprinkled around in random locations. There are many, //many// reasonable ways that the LLD codebase could be cleaned up to support being called as a library, and I don't think it's an unreasonable expectation. If LLD is not interested in this, I will simply continue fixing these bugs as I find them.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63042/new/

https://reviews.llvm.org/D63042





More information about the llvm-commits mailing list