Boost C++ Libraries: Ticket #1186: Lack of 64-bit address model support using Sun Studio C++ https://svn.boost.org/trac10/ticket/1186 <p> It is not possible to build 64-bit version of Boost libraries using Sun Studio C++. </p> <ol><li>'tools/build/v2/tools/sun.jam' should conatin something like:<br /> <pre class="wiki">flags sun OPTIONS &lt;architecture&gt;/&lt;address-model&gt;32 : -m32 ; flags sun OPTIONS &lt;architecture&gt;/&lt;address-model&gt;64 : -m64 ; </pre></li></ol><ol start="2"><li>To build shared libraries Sun Studio C++ requires -Kpic or -KPIC command line option for compilation and linking. This option mandatory for 64-bit shared libraries and strongly recommended for 32-bit ones. What option to choose (-Kpic or -KPIC) depends on the size of the Global Offset Table (GOT). For Boost libraries -Kpic is enough. </li></ol><p> Here is corresponded Sun Studio documentation article: <a class="ext-link" href="http://docs.sun.com/app/docs/doc/819-5267/6n7c46duv?a=view"><span class="icon">​</span>http://docs.sun.com/app/docs/doc/819-5267/6n7c46duv?a=view</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1186 Trac 1.4.3 René Rivera Sat, 18 Aug 2007 14:41:32 GMT component changed; owner set https://svn.boost.org/trac10/ticket/1186#comment:1 https://svn.boost.org/trac10/ticket/1186#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Vladimir Prus</span> </li> <li><strong>component</strong> <span class="trac-field-old">Building Boost</span> → <span class="trac-field-new">build</span> </li> </ul> Ticket Vladimir Prus Thu, 23 Aug 2007 19:57:24 GMT <link>https://svn.boost.org/trac10/ticket/1186#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/38872" title="Support the address-model feature for the sun toolset. Addresses #1186. ">[38872]</a>) Support the address-model feature for the sun toolset. Addresses <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1186" title="#1186: Bugs: Lack of 64-bit address model support using Sun Studio C++ (closed: fixed)">#1186</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Thu, 23 Aug 2007 19:59:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:3</guid> <description> <p> Re point 1, I've added this code: </p> <pre class="wiki">flags sun OPTIONS &lt;address-model&gt;32 : -m32 ; flags sun OPTIONS &lt;address-model&gt;64 : -m64 ; </pre><p> Note there's no 'architecture', because with the original code, -m32 will be only used if no architecture is specified. So, if user wanted to be explicit and say 'architecture=sparc' on the command like, then -m32 and -m64 will disappear. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Thu, 23 Aug 2007 20:15:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:4</guid> <description> <p> I am not sure about -Kpic vs. -KPIC. Boost.Build is for general use, and we have no idea how large GOT table will be required by libraries it builds. Will -KPIC be OK? </p> </description> <category>Ticket</category> </item> <item> <author>stephen.clamage@…</author> <pubDate>Fri, 24 Aug 2007 20:02:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:5</guid> <description> <p> Starting with Sun Studio 12, the options for 32-bit and 64-bit compiling are -m32 and -m64, as with gcc. 32-bit mode is the default on Solaris, and on 32-bit Linux. On 64-bit Linux, 64-bit mode is the default. </p> <p> Earlier versions of Sun Studio did not recognize the -m32 and -m64 options. On those versions, use -xarch=generic64 for 64-bit compilation instead. </p> </description> <category>Ticket</category> </item> <item> <author>stephen.clamage@…</author> <pubDate>Fri, 24 Aug 2007 20:08:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:6</guid> <description> <p> Here's the story on -Kpic and -KPIC: </p> <p> On x86/x64, there is no difference between -KPIC and -Kpic.<br /> On sparc, -Kpic is slightly more efficient, but the difference is not always enough to notice. </p> <p> You compile for position-independent code (-Kpic or -KPIC) usually only when building a shared library. </p> <p> The difference on sparc is in the instructions used to access the symbol via the offset in the Global Offset Table (GOT) in the shared library. The -Kpic option causes the compiler to generate a single instruction with 13 bits for the offset value. The -KPIC option uses two instructions to get a 32-bit offset. </p> <p> You compile a file with -Kpic when you know it will be used in a shared library with a modest number of global symbols (references or definitions). </p> <p> When building your own shared library, you can try building with -Kpic. If it links, you are done. A shared library built with -Kpic can be linked to a program with a large number of global symbols, because uses of the symbol offsets in the shared library are confined to the library itself. </p> <p> If you build a "loose" .o file or an archive (.a) to be used by other people in their own shared libraries, it is safest to use -KPIC. That allows the files to be linked into a big shared library. </p> <p> You can mix -Kpic and -KPIC code in the same shared library, as long as the -Kpic code doesn't need an offset taking more than 13 bits. In other words, a client who used -Kpic can still use your -KPIC binaries in the client library. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Sat, 25 Aug 2007 04:34:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:7</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/38919" title="Use -KPIC for shared libs. Addresses #1186.">[38919]</a>) Use -KPIC for shared libs. Addresses <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1186" title="#1186: Bugs: Lack of 64-bit address model support using Sun Studio C++ (closed: fixed)">#1186</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Sat, 25 Aug 2007 04:42:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:8</guid> <description> <p> Stephen, thanks for the explanation. IIUC, using address-model=32 or address-model=64 won't work on compilers earlier than Sun Studio 12, since those don't support -m32 or -m64. On those earlier compilers, one should not use address-model, but instead add -xarch=generic64? If so, then I believe the current code in sun.jam, namely: </p> <pre class="wiki">flags sun OPTIONS &lt;address-model&gt;32 : -m32 ; flags sun OPTIONS &lt;address-model&gt;64 : -m64 ; flags sun OPTIONS &lt;link&gt;shared : -KPIC ; </pre><p> is correct, and this issue can be closed. </p> <p> Simon, Stephen, any objections to closing? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Simon Atanasyan</dc:creator> <pubDate>Mon, 27 Aug 2007 06:41:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1186#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:9</guid> <description> <p> Yes, -m32 and -m64 have been supported since Sun Studio 12. For the earlier versions use -xarch=generic64. </p> <p> I think the fix is correct and issue can be closed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 27 Aug 2007 07:13:47 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1186#comment:10 https://svn.boost.org/trac10/ticket/1186#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket Alvaro Sat, 18 Apr 2009 04:56:20 GMT <link>https://svn.boost.org/trac10/ticket/1186#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1186#comment:11</guid> <description> <p> You will be divorced within a year. <a class="ext-link" href="http://www.compraviagraitalia.com/it/item/viagra.html"><span class="icon">​</span>viagra generico e originale</a> <a class="ext-link" href="http://headachetreatment.net/"><span class="icon">​</span>head ache</a> <a class="ext-link" href="http://compraviagraitalia.com/it/item/generic_cialis.html"><span class="icon">​</span>cialis generico</a> <a class="ext-link" href="http://relievepain.org/"><span class="icon">​</span>tramadol online order</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>