Two XS modules linked to one .a library.
[email protected] (Bill Moseley) Tue, 30 Sep 2014 05:39:17 -0700
| Newsgroups | perl.xs |
|---|---|
| Message-ID | <CAKhN_m7_Hicqk=58a7o+DehNiQLOEMPdfQ-ET+Jz9CJBBTMcJA@mail.gmail.com> |
--001a11c1f4a2c353c9050447ad8e Content-Type: text/plain; charset=UTF-8 I have a simple, if not basic, question. We have a static archive (*.a) library provided to us that we have written an XS interface for. So, the resulting .so that XS builds contains that library (or whatever the linker decided to include, I suppose). New functionality was added to that static library and we created a *separate* XS module for just that functionality. It also pulls in much (all?) of that .a library when building the Perl XS .so module. Is there potential for symbols to "clash" in this situation? Or is that not a problem as long as the .a library was compiled with -fPIC? We are using both the XS Perl modules in the same process and seems to work fine. So, not sure if that is just luck or if there's no problem doing this. If we can get the library rebuilt as a .so would that make much of a difference? I'm running on CentOS and non-threaded Perl, if that makes a difference. Thanks, -- Bill Moseley [email protected] --001a11c1f4a2c353c9050447ad8e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>I have a simple, if not basic, question.</div><div><b= r></div><div>We have a static archive (*.a) library provided to us that we = have written an XS interface for. =C2=A0 So, the resulting .so that XS buil= ds contains that library (or whatever the linker decided to include, I supp= ose).</div><div><br></div><div>New functionality was added to that static l= ibrary and we created a <i>separate</i> XS module for just that functionali= ty. =C2=A0 It also pulls in much (all?) of that .a library when building th= e Perl XS .so module.</div><div><br></div><div>Is there potential for symbo= ls to "clash" in this situation? =C2=A0 Or is that not a problem = as long as the .a library was compiled with -fPIC?</div><div><br></div><div= >We are using both the XS Perl modules in the same process and seems to wor= k fine. =C2=A0 So, not sure if that is just luck or if there's no probl= em doing this.</div><div><br></div><div>If we can get the library rebuilt a= s a .so would that make much of a difference?<br></div><div><br></div><div>= <br></div><div>I'm running on CentOS and non-threaded Perl, if that mak= es a difference.<br></div><div><br></div><div>Thanks,</div><br clear=3D"all= "><div><br></div>-- <br>Bill Moseley<br><a href=3D"mailto:[email protected]"= target=3D"_blank">[email protected]</a> </div> --001a11c1f4a2c353c9050447ad8e--