Bug#578831: link failure with LTO: ???invalid DSO for symbol `pthread_cancel@@GLIBC_2.0' definition???
On Sun, Aug 08, 2010 at 11:55:28AM +0200, Steinar H. Gunderson wrote:
> On Sun, Aug 08, 2010 at 01:47:09PM +0400, Kirill Smelkov wrote:
> > The fix Matthias reffered to, is that you no longer need to pass -pthread
> > explicitly if your program does not use pthreads. Please try it out --
> > it should not complain about pthread_cancel.
>
> Well, my program uses pthreads, so it's not a relevant fix. In any case, good
> that it's fixed.
I see, thanks. I asked because your original sympthom (about
pthread_cancel) was very similiar to mine.
Just a note - if your program uses pthread you should pass -pthread
explicitly, even if some other library you link to uses pthread, because
with -Wl,-no-add-needed (which is the default in Fedora, and may be some
time in Debian too) you'll get link errors.
http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
> > As to -flto -- I can't say, but could you please provide self-contained
> > testcase, preferably minimized, so we could try it out by ourselves too.
>
> I can give you a test case, but I'm afraid I cannot make it public. (Also,
> it's pretty hard to disentangle, I'm afraid.) Let me know if it would be
> helpful to you.
No thanks, I can't afford NDA for myself.
Though I may suggest to try latest upstream binutils and gcc-4.5 to see
whether it works there, and if not, try harder to still disentangle the
testcase.
Thanks,
Kirill
Reply to: