<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Sep 30, 2013, at 12:51 PM, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite">Would you then also have a libLLVMAllTargets.a?<br></blockquote><br>I don't think it would be necessary. Given how .a files work the .o<br>defining LLVMInitializeAllTargetInfos would not be fetched if that<br>function is not called.<br></div></blockquote><div dir="auto"><br></div><div dir="auto">Good point!</div><div dir="auto"><br></div><div dir="auto">Yeah, I think that what the patch needs is AllTargets.cpp.</div><div dir="auto"><br></div><div dir="auto">-Filip</div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><blockquote type="cite">I mean, it seems like it would work, but I just want to make sure I'm on the<br>same page as you about why this is better than what LLVM does today.  For<br>programs that already build against all of LLVM's targets, presumably they<br>do it by static linkage - in which case what LLVM trunk does right now is<br>fine:  llvm-config will tell you to link all of the .a's, and the header<br>file will have that static inline function that initializes all of the<br>targets.  It works for those use cases, and it also allows cherrypicking: a<br>client can ignore part of the --libs list from llvm-config and then<br>initialize targets directly.<br><br>So, having AllTargets.cpp would mainly be beneficial for those who build<br>LLVM as a single shared library, rather than as static libraries.  Is that<br>what we're going for here?<br></blockquote><br>Yes. The problem is that right now a program using llvm as a shared<br>lib gets undefined references to<br><br>LLVMInitializeR600Target<br>LLVMInitializeSparcTarget<br>LLVMInitializeMSP430Target<br>...<br><br>A program compiled against an older version would have an undefined<br>reference to LLVMInitializeMBlazeTarget and would not load with a<br>current llvm built as a shared library.<br><br>Cheers,<br>Rafael</div></blockquote></div><br></body></html>