<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:06 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">2) Compile and link a program that uses LLVM, but have it pull in only the<br>static libs for the targets that the program wishes to use.<br><br>With this proposed patch, (2) won't work anymore.  You'll get a link error<br>since Target.cpp now requires all of the targets with which LLVM was<br>configured to also be linked by the client.<br></blockquote><br>Good point. What about putting these functions in a AllTargets.cpp?<br>That way a program that wants just some targets can call just the<br>initialization functions for those targets and not pull in<br>AllTargets.o.<br></div></blockquote><div dir="auto"><br></div><div dir="auto">Would you then also have a libLLVMAllTargets.a?</div><div dir="auto"><br></div><div dir="auto">I mean, it seems like it would work, but I just want to make sure I'm on the same page as you about why this is better than what LLVM does today.  For programs that already build against all of LLVM's targets, presumably they do it by static linkage - in which case what LLVM trunk does right now is fine:  llvm-config will tell you to link all of the .a's, and the header file will have that static inline function that initializes all of the targets.  It works for those use cases, and it also allows cherrypicking: a client can ignore part of the --libs list from llvm-config and then initialize targets directly.</div><div dir="auto"><br></div><div dir="auto">So, having AllTargets.cpp would mainly be beneficial for those who build LLVM as a single shared library, rather than as static libraries.  Is that what we're going for here?</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>Cheers,<br>Rafael</div></blockquote></div><br></body></html>