Recommend compiling with PIC consistently.
While shared objects with non-PIC code work on some architectures (notably x86), unless code is always PIC on that arch (not true for x86) doing so requires runtime relocations, which prevents the object actually being shared, and means such segments can't be marked as read-only.
This commit is contained in:
parent
bdb45cacea
commit
de7ed84f77
7 changed files with 29 additions and 27 deletions
|
|
@ -493,8 +493,8 @@ Solaris, you often need to add an extra library <tt>-lCrun</tt> like this:
|
|||
|
||||
<div class="code"><pre>
|
||||
$ swig -c++ -perl example.i
|
||||
$ CC -c example.cxx
|
||||
$ CC -c example_wrap.cxx -I/usr/lib/perl/5.14/i386-linux/CORE
|
||||
$ CC -Kpic -c example.cxx
|
||||
$ CC -Kpic -c example_wrap.cxx -I/usr/lib/perl/5.14/i386-linux/CORE
|
||||
$ CC -shared example.o example_wrap.o -o example.so <b>-lCrun</b>
|
||||
</pre></div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue