gcc 4.0 and x86_64 compilation issue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gcc 4.0 and x86_64 compilation issue

Ricky Georgy
Hi,

For some times, I am having these kind of messages during compilation:

/usr/bin/ld: nsRDFResource.o: relocation R_X86_64_PC32 against `nsQueryInterface::operator()(nsID const&, void**) const' can not be used when making a shared object; recompile with -fPIC

What is strange is that nsRDFResource.o is compiled with -fPIC

I could track this down to this line (removing it removes the problem):

    nsCOMPtr<nsIRDFDelegateFactory> delegateFactory =
        do_CreateInstance(contractID.get(), &rv);

If the right hand side is nsnull, the problem is still there. Which makes
me think it comes from the nsCOMPtr affectation.


Any suggestions ?


Ricky
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: gcc 4.0 and x86_64 compilation issue

Benjamin Smedberg
Ricky Georgy wrote:

> Hi,
>
> For some times, I am having these kind of messages during compilation:
>
> /usr/bin/ld: nsRDFResource.o: relocation R_X86_64_PC32 against `nsQueryInterface::operator()(nsID const&, void**) const' can not be used when making a shared object; recompile with -fPIC
>
> What is strange is that nsRDFResource.o is compiled with -fPIC
>
> I could track this down to this line (removing it removes the problem):
>
>     nsCOMPtr<nsIRDFDelegateFactory> delegateFactory =
>         do_CreateInstance(contractID.get(), &rv);
>
> If the right hand side is nsnull, the problem is still there. Which makes
> me think it comes from the nsCOMPtr affectation.

It's a GCC bug, see

http://benjamin.smedbergs.us/blog/2006-03-28/gcc-and-visibility-one-step-forward-hit-a-brick-wall/

for workarounds.

--BDS
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: gcc 4.0 and x86_64 compilation issue

Ricky Georgy
On Wed, 19 Apr 2006 20:02:49 -0400, Benjamin Smedberg wrote :

> Ricky Georgy wrote:
>> Hi,
>>
>> For some times, I am having these kind of messages during compilation:
>>
>> /usr/bin/ld: nsRDFResource.o: relocation R_X86_64_PC32 against `nsQueryInterface::operator()(nsID const&, void**) const' can not be used when making a shared object; recompile with -fPIC
>>
>> What is strange is that nsRDFResource.o is compiled with -fPIC
>>
>> I could track this down to this line (removing it removes the problem):
>>
>>     nsCOMPtr<nsIRDFDelegateFactory> delegateFactory =
>>         do_CreateInstance(contractID.get(), &rv);
>>
>> If the right hand side is nsnull, the problem is still there. Which makes
>> me think it comes from the nsCOMPtr affectation.
>
> It's a GCC bug, see
>
> http://benjamin.smedbergs.us/blog/2006-03-28/gcc-and-visibility-one-step-forward-hit-a-brick-wall/
>
> for workarounds.

Working fine now. Many thanks for the tip.


Ricky
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds