<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); ">
<div>
<div>
<div style="font-family: Arial, sans-serif; font-size: 13px; ">Thanks! Yes, we are trying to avoid that situation as much as possible.</div>
<div style="font-family: Arial, sans-serif; font-size: 13px; "><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 13px; ">Is there any compiler/linker/static analyzer option that would point out those problems (in 13 million lines, large part of that being legacy code)? Currently I don't know any better way than runtime
 logging and asserting.</div>
<div style="font-family: Arial, sans-serif; font-size: 13px; ">Also, what shall we do we external source libraries (like Teigha from Open Design Alliance), where we don't really have any control?</div>
<div style="font-family: Arial, sans-serif; font-size: 13px; "><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 13px; ">Just being curious, </div>
<div style="font-family: Arial, sans-serif; font-size: 13px; "><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 13px; ">Akos</div>
<div>
<div>
<p><font class="Apple-style-span" face="Arial,sans-serif" size="4"><b><br>
</b></font></p>
</div>
</div>
</div>
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-size: 13px; font-family: Arial, sans-serif; ">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>><br>
<span style="font-weight:bold">Date: </span>Fri, 30 Sep 2011 10:22:02 -0700<br>
<span style="font-weight:bold">To: </span>Ákos Somorjai <<a href="mailto:asomorjai@graphisoft.com">asomorjai@graphisoft.com</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>" <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [LLVMdev] RTTI handling<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>
<div>On Sep 30, 2011, at 9:15 AM, Somorjai, Akos wrote:</div>
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 13px; font-family: Arial, sans-serif; ">
<div>
<div>
<div>I was wondering how llvm and clang handles the RTTI shared libraries issue mentioned here:
<a href="http://gcc.gnu.org/faq.html#dso">http://gcc.gnu.org/faq.html#dso</a></div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
This is really a Clang question and so belongs on cfe-dev.</div>
<div><br>
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 13px; font-family: Arial, sans-serif; ">
<div>
<div>
<div>Is it using name or address comparison?</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
Clang strives for interoperability with GCC, which means we use address comparison on targets where GCC does.  Therefore yes, we have the same issues with symbol visibility and vague linkage.</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 13px; font-family: Arial, sans-serif; ">
<div>
<div>
<div>We have an architecture with several frameworks and plug-ins; some of the latter are being loaded and unloaded runtime.</div>
<div>In the past that issue caused crashes in our app, so at the moment we are overriding __dynamic_cast to detect this problem, but that's kind of messy. I'm hoping for a better solution with llvm…</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
</div>
The best solution, bar none, is to avoid the need for vague linkage on your RTTI objects.  If they correspond to polymorphic class types, which presumably they do if your problems are with dynamic_cast, then you need to use key functions more effectively.
<div><br>
</div>
<div>John.</div>
</div>
</div>
</span>
</body>
</html>