[Mesa-dev] Statically linking libstdc++ and libgcc

Jose Fonseca jfonseca at vmware.com
Tue Apr 28 07:49:31 PDT 2015


On 28/04/15 12:22, Emil Velikov wrote:
> On 28 April 2015 at 11:16, Jose Fonseca <jfonseca at vmware.com> wrote:
>> Hi,
>>
>>
>> I don't know if in the end of this thread there was an agreement that Valve
>> should only use bundled libstdc++ if it's newer than the system's libstdc++,
>> or just no agreement at all.
>>
>>
> It seems to me that there is no agreement atm :-(
>
>> But just for future reference (or in case any distro decides to apply the
>> patches themselves), I'd like to point out there a couple of technical
>> issues with the proposed patch.
>>
>> I actually modified apitrace's LD_PRELOAD wrappers precisely as Vivek
>> proposed (so apitrace can safely trace any application, without fear of
>> symbol collision, no matter what), but ran against two problems:
>>
>>
>> - For a long time static libstdcxx wasn't built with -fPIC ( see
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__gcc.gnu.org_bugzilla_show-5Fbug.cgi-3Fid-3D28811&d=AwIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=Okz0-DpEUB5ncMYMjMjc59cE6euZOdfhCHx8NraKzQo&s=jE3xtJAeYngM4cK2Belo2vS4-0MAziIXXEbvY_1go9c&e=  ) so I actually had to
>> add a configure-time check to see whether it works or not:
>>
>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apitrace_apitrace_commit_09531388e2aea19018ef03487d37a12547eb9325&d=AwIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=Okz0-DpEUB5ncMYMjMjc59cE6euZOdfhCHx8NraKzQo&s=HcmNQY-aIcw6rVHsn7Gz3g5sBNjepxRboc-MbusLe8A&e=
>>
>>
> Good catch. I would assume that as we mandate GCC 4.2 we should be
> save, although the configure check won't hurt either.

IIUC, from that bug report it looks like -fPIC on x86_64 was busted all 
the way till GCC 4.7.1.

Jose



More information about the mesa-dev mailing list