<div dir="ltr"><div><div>Maybe: gcc -Wl,--start-group foo.o bar.o -Wl,--end-group<br></div><br></div>quote from man ld:<br>It is best to use it only when there are unavoidable circular references between two or more archives.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 1, 2018 at 6:18 PM, Kaushal M <span dir="ltr"><<a href="mailto:kshlmster@gmail.com" target="_blank">kshlmster@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Mar 1, 2018 at 6:14 PM, Kaushal M <<a href="mailto:kshlmster@gmail.com">kshlmster@gmail.com</a>> wrote:<br>
> On Thu, Mar 1, 2018 at 12:52 PM, Kaushal M <<a href="mailto:kshlmster@gmail.com">kshlmster@gmail.com</a>> wrote:<br>
>> On Wed, Feb 28, 2018 at 9:50 PM, Kaleb S. KEITHLEY <<a href="mailto:kkeithle@redhat.com">kkeithle@redhat.com</a>> wrote:<br>
>>> On 02/28/2018 10:49 AM, Kaushal M wrote:<br>
>>>> We have a GlusterD2-4.0.0rc1 release.<br>
>>>><br>
>>>> Aravinda, Prashanth and the rest of the GD2 developers have been<br>
>>>> working hard on getting more stuff merged into GD2 before the 4.0<br>
>>>> release.<br>
>>>><br>
>>>> At the same time I have been working on getting GD2 packaged for Fedora.<br>
>>>> I've been able to get all the required dependencies updated and have<br>
>>>> submitted to the package maintainer for merging.<br>
>>>> I'm now waiting on the maintainer to accept those updates. Once the<br>
>>>> updates have been accepted, the GD2 spec can get accepted [2].<br>
>>>> I expect this to take at least another week on the whole.<br>
>>>><br>
>>>> In the meantime, I've been building all the updated dependencies and<br>
>>>> glusterd2-v4.0.0rc1, on the GD2 copr [3].<br>
>>>><br>
>>>> I tried to test out the GD2 package with the GlusterFS v4.0.0rc1<br>
>>>> release from [4]. And this is where I hit the blocker.<br>
>>>><br>
>>>> GD2 does not start with the packaged glusterfs-v4.0.0rc1 bits. I've<br>
>>>> opened an issue on the GD2 issue tracker for it [5].<br>
>>>> In short, GD2 fails to read options from xlators, as dlopen fails with<br>
>>>> a missing symbol error.<br>
>>>><br>
>>>> ```<br>
>>>> FATA[2018-02-28 15:02:53.345686] Failed to load xlator options<br>
>>>> error="dlopen(/usr/lib64/<wbr>glusterfs/4.0.0rc1/xlator/<wbr>protocol/server.so)<br>
>>>> failed; dlerror =<br>
>>>> /usr/lib64/glusterfs/4.0.0rc1/<wbr>xlator/protocol/server.so: undefined<br>
>>>> symbol: glusterfs_mgmt_pmap_signout" source="[main.go:79:main.main]<wbr>"<br>
>>><br>
>>><br>
>>> see <a href="https://review.gluster.org/#/c/19225/" rel="noreferrer" target="_blank">https://review.gluster.org/#/<wbr>c/19225/</a><br>
>>><br>
>>><br>
>>> glusterfs_mgmt_pmap_signout() is in glusterfsd. When glusterfsd dlopens<br>
>>> server.so the run-time linker can resolve the symbol — for now.<br>
>>><br>
>>> Tighter run-time linker semantics coming in, e.g. Fedora 28, means this<br>
>>> will stop working in the near future even when RTLD_LAZY is passed as a<br>
>>> flag. (As I understand the proposed changes.)<br>
>>><br>
>>> It should still work, e.g., on Fedora 27 and el7 though.<br>
>>><br>
>>> glusterfs_mgmt_pmap_signout() (and glusterfs_autoscale_threads()) really<br>
>>> need to be moved to libglusterfs. ASAP. Doing that will resolve this issue.<br>
>><br>
>> Thanks for the pointer Kaleb!<br>
>><br>
>> But, I'm testing on Fedora 27, where this shouldn't theoretically happen.<br>
>> So then, why am I hitting this. Is it something to do with the way the<br>
>> packages are built?<br>
>> Or is there some runtime ld configuration that has been set up.<br>
>><br>
>> In any case, we should push and get the offending functions moved into<br>
>> libglusterfs.<br>
>> That should solve the problem for us.<br>
><br>
> I took a shot at this, and it's not as easy simple as it appeared.<br>
> I ended up in a recursive linking situation with libglusterfs,<br>
> libgfxdr and libgfrpc.<br>
> Looks like the solution is to create a libglusterfsd.<br>
<br>
</div></div>I see two ways to do this.<br>
1. Make a library out of the whole glusterfsd.<br>
Rename `main` to `init`<br>
And then create a simple executable which loads this library and calls `init`.<br>
<br>
Or,<br>
2. Create a very small library with just the pmap_signout and<br>
autoscale functions. And use that instead.<br>
<br>
If anyone else has a better idea about how to do this please let me know.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
>><br>
>>><br>
>>> --<br>
>>><br>
>>> Kaleb<br>
______________________________<wbr>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://lists.gluster.org/<wbr>mailman/listinfo/gluster-devel</a></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Milind<br><br></div></div></div></div>
</div>