<div dir="ltr">Keeping the shared library build working's probably a fine idea, though working around GCC bugs (depending on how ubiquitous they are) might be less so.<br><br>I'd be fine with this patch going in for this case, though. For a one line change there's no need to send a phab review, someone (probably me, I guess) can just apply/commit this directly.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 8, 2017 at 1:37 AM Roger Ferrer Ibanez via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
while trying to build llvm with shared libraries using GCC (tested both in<br>
Ubuntu 14.04 and Ubuntu 16.04) as in<br>
<br>
  cmake -G Ninja -DBUILD_SHARED_LIBS=ON<br>
<br>
I run into the following link error<br>
<br>
   lib/Transforms/IPO/CMakeFiles/LLVMipo.dir/PartialInlining.cpp.o: In function `llvm::ForwardDominanceFrontierBase<llvm::BasicBlock>::ForwardDominanceFrontierBase()':<br>
   <path>/llvm/include/llvm/Analysis/DominanceFrontier.h:122: undefined reference to `llvm::DominanceFrontierBase<llvm::BasicBlock, false>::DominanceFrontierBase()'<br>
<br>
This change<br>
<br>
   diff --git a/include/llvm/Analysis/DominanceFrontier.h b/include/llvm/Analysis/DominanceFrontier.h<br>
   index a304dff..e743d2d 100644<br>
   --- a/include/llvm/Analysis/DominanceFrontier.h<br>
   +++ b/include/llvm/Analysis/DominanceFrontier.h<br>
   @@ -52,7 +52,7 @@ protected:<br>
      static constexpr bool IsPostDominators = IsPostDom;<br>
<br>
    public:<br>
   -  DominanceFrontierBase() = default;<br>
   +  DominanceFrontierBase() { }<br>
<br>
      /// getRoots - Return the root blocks of the current CFG.  This may include<br>
      /// multiple blocks if we are computing post dominators.  For forward<br>
<br>
seems to fix the problem and I think is related to this GCC defect<br>
<br>
   <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57728" rel="noreferrer" target="_blank">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57728</a><br>
<br>
I'm unsure about the level of interest in the community when it comes to builds<br>
using shared libraries.  I personally use them because for debug builds, at<br>
link time, they are less demanding in memory. However that alone might not be<br>
enough to justify this change as there are valid workarounds (like not using<br>
shared libraries, building clang with clang, using lld, etc).<br>
<br>
Thoughts? If this is reasonable I will create a Phabricator.<br>
<br>
Kind regards,<br>
Roger<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>