<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
On 12/2/2011 9:09 AM, Alan Garny wrote:
<blockquote cite="mid:00c601ccb104$6d4a6780$47df3680$@dpag.ox.ac.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">However, there
is one new (minor) issue which is that when building my
application I get a warning from the linker about
auto-importing having been activated without
–enable-auto-import being specified on the command line.
Indeed, for some reason, the vtable for llvm::CallInst has
to be resolved…?! This is clearly not critical since I can
get rid of the warning by adding –enable-auto-import on the
command line, but I wish I didn’t have to do that (it’s not
clean in my view).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
</blockquote>
Mostly harmless... for shared libs on Windows you'd normally have to
either: <br>
use __declspec(dllexport) on exported functions, and
__declspec(dllimport)<br>
on the prototypes for code that uses them; or:<br>
list symbols to be exported in a .def file when building the dll,
and<br>
link with that .def file when building code that uses it.<br>
<br>
GCC on mingw came up with the "auto-import" option to avoid those<br>
nuisances by, automatically exporting everything, if otherwise
there'd<br>
be no exports and you're building a shared-lib. When it does this<br>
without being told to, it emits that warning message, so you know<br>
it happened.<br>
<br>
I think that that warning went away in later versions -- this seems<br>
to be the most-appropriate behavior and apparently doesn't<br>
cause problems, so for GCC, auto-import and no special markings<br>
on your code is what you should usually do.<br>
<br>
But I'm not an expert -- just trying to follow along. There are<br>
potential issues with relocations and thunks and
position-independent<br>
code and intermittent failures when DLL relocations "collide"...<br>
but I really don't want to have to worry about that. <br>
<br>
<br>
Kevin<br>
<br>
(a couple interesting links ab't enable-auto-import):<br>
<br>
[1] <a
href="http://sourceware.org/binutils/docs-2.16/ld/WIN32.html">http://sourceware.org/binutils/docs-2.16/ld/WIN32.html</a><br>
[2] <a href="http://www.delorie.com/gnu/docs/binutils/ld_4.html">http://www.delorie.com/gnu/docs/binutils/ld_4.html</a><br>
<br>
<br>
<blockquote cite="mid:00c601ccb104$6d4a6780$47df3680$@dpag.ox.ac.uk"
type="cite">
</blockquote>
</body>
</html>