<div>Hi, llvm-commits</div><div><br></div><div>Here: <a href="http://codereview.appspot.com/6458066/">http://codereview.appspot.com/6458066/</a> is the short experimental FYI-patch that allows LLVM sources to be "compiled into" static compiler-rt libraries in CMake build system.</div>
<div>(I'm not sure that is smart enough to capture all dependencies, though).</div><div>With something that simple we can:</div><div>1) directly use LLVM code from compiler-rt libraries.</div><div>2) workaround the unavailable compilation of llvm libraries for several targets: each static compiler-rt lib will contain its own private copy of LLVM libs, compiled for necessary target and with necessary compile flags.</div>
<div><br></div><div>And there are multiple drawbacks:</div><div>1) License issues (LLVM code has binary redistribution clause, right? So everything built with "clang -faddress-sanitizer" would attribute LLVM license, gr-r-r).</div>
<div>2) Static ASan runtime is now 10x larger (2,5M vs 250K), while most of its functionality (various stuff from LLVMSupport) is not needed.</div><div>3) Symbol name clashes - suppose one want to build something with ASan and link against "normal" version of LLVMSupport. (can compiling the code with -fvisibility=hidden, as we currently do, help with this?)</div>
<div><br></div><div>Does this direction look promising to you? Maybe, we should turn to using DSO instead? Citing Benjamin's suggestion from old thread:</div><div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">"You want to create a new .so which links the .a files from LLVM and doesn't export LLVM's symbols. This is another advantage of using .so over .a, think of what will happen when you want to link LLVM trunk with asan which is using a different version of LLVM. LLVM's symbols are not versioned. With a DSO you can just hide all symbols except a couple of entry points for your purposes and none of the symbols will collide."</span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">Or can we try the following path:</span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">1) fetch all the sources from LLVM libraries we're interested in (e.g, for symbolization we need sources from DebugInfo and Support) as in the provided patch.</span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">2) write an interface file that would contain all entry points and describe usage patterns of these libs.</span></div>
<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif">3) compile these sources and interface with flags we want and for targets we want, make a DSO, hide all non-interface symbols.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif">4) store this DSO next to static asan runtime, and link it on demand?</span></div>
<div><br></div><div>-- </div><div>Alexey Samsonov, MSK</div><br>