[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#578831: link failure with LTO: “invalid DSO for symbol `pthread_cancel@@GLIBC_2.0' definition”



On Sat, Aug 07, 2010 at 10:08:27PM +0200, Steinar H. Gunderson wrote:
> On Sat, Aug 07, 2010 at 09:46:31PM +0200, Matthias Klose wrote:
> > fixed in binutils 2.20.1-13 (and in binutils from experimental).
> 
> I'm afraid it's not:
> 
> fugl:~/dev/tehintro> ld -v
> GNU ld (GNU Binutils for Debian) 2.20.51-system.20100710
> fugl:~/dev/tehintro> make
> Generating dependencies
> Warning: waveform_asm.cpp not found
> g++-4.5 -o intro script/engine.o script/progressbar.o mumps/mumps_glx.o engine/fbo_rtt.o mumps/XF86VMode.o script.o -flto -pthread -Wall -Os -fno-exceptions -felide-constructors -fstrict-aliasing -fno-rtti -fno-keep-static-consts -fsingle-precision-constant -ffast-math -fno-threadsafe-statics -pthread -flto -fomit-frame-pointer  -fconserve-space -ffunction-sections -fdata-sections -march=pentium3 -mtune=generic -msse -mfpmath=sse -ftree-vectorize -I/usr/include/freetype2 -I. -DUSE_BSB_DATA -DUSE_LPC=1 -DASM_WAVEFORMS -fwhole-program -fno-exceptions -Wl,--gc-sections -lGL -lGLU  -L/usr/X11R6/lib -lXext -lX11 -lfreetype -lz -Wl,--start-group engine/engine.a texgen/texgen.a meshgen/meshgen.a common/common.a effects/effects.a script/script.a sanestation/libsanestation.a -Wl,--end-group
> script/script.a(curve.o): In function `_ZN6script5Curve13make_tangentsEv':
> curve.cpp:(.text._ZN6script5Curve13make_tangentsEv+0x3f2): undefined reference to `_ZN6script6engine13get_num_paramENS_5Curve8knottypeE'
> script/script.a(curve.o): In function `_ZN6script5Curve9get_valueEfPf':
> curve.cpp:(.text._ZN6script5Curve9get_valueEfPf+0x226): undefined reference to `_ZN6script6engine7targetsE'
> curve.cpp:(.text._ZN6script5Curve9get_valueEfPf+0x236): undefined reference to `_ZN6script6engine8texturesE'
> curve.cpp:(.text._ZN6script5Curve9get_valueEfPf+0x262): undefined reference to `_ZN6script6engine6meshesE'
> curve.cpp:(.text._ZN6script5Curve9get_valueEfPf+0x28b): undefined reference to `_ZN6script6engine9materialsE'
> curve.cpp:(.text._ZN6script5Curve9get_valueEfPf+0x2a1): undefined reference to `_ZN6script6engine13get_num_paramENS_5Curve8knottypeE'
> collect2: ld returned 1 exit status
> make: *** [intro] Error 1
> 
> IOW, exactly zero change for me. :-/

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.

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.


Thanks,
Kirill



Reply to: