undefined reference to `__stack_chk_fail' on i686 build of 2.6.7

Started by hobbes1069, January 27, 2014, 08:12:20 PM

Previous topic - Next topic

hobbes1069

I only seem to get this error on the i686 build, not x86_64.... Any ideas?


Linking CXX shared library libADM_vf_colorYuv.so
cd /builddir/build/BUILD/avidemux_2.6.7/build_plugins_common/ADM_videoFilters6/colorYUV && /usr/bin/cmake -E cmake_link_script CMakeFiles/ADM_vf_colorYuv.dir/link.txt --verbose=1
/usr/lib/ccache/c++  -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fmessage-length=0 -fmessage-length=0 -O2 -g -DNDEBUG  -Wl,--as-needed -shared -Wl,-soname,libADM_vf_colorYuv.so -o libADM_vf_colorYuv.so CMakeFiles/ADM_vf_colorYuv.dir/ADM_vidColorYuv.cpp.o CMakeFiles/ADM_vf_colorYuv.dir/avsColor.cpp.o  -L/builddir/build/BUILD/avidemux_2.6.7/fakeRoot/usr/lib -Wl,--as-needed -Wl,-z,defs -lstdc++ -lm -lADM_core6 -lADM_coreUI6 -lADM_coreVideoFilter6 -lADM_coreImage6 -lADM_coreUtils6 -lm -lADM_core6 -lADM_coreUI6 -lADM_coreVideoFilter6 -lADM_coreImage6 -lADM_coreUtils6 -Wl,-rpath,/builddir/build/BUILD/avidemux_2.6.7/fakeRoot/usr/lib:
/usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local':
(.text+0x10): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status


Thanks,
Richard


hobbes1069

Ok, thanks for that! But now I have hit the problem in another area:

Linking CXX shared library libADM_vf_decimate.so
cd /builddir/build/BUILD/avidemux_2.6.7/build_plugins_common/ADM_videoFilters6/decimate && /usr/bin/cmake -E cmake_link_script CMakeFiles/ADM_vf_decimate.dir/link.txt --verbose=1
/usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local':
(.text+0x10): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
make[2]: *** [ADM_videoFilters6/colorYUV/libADM_vf_colorYuv.so] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/avidemux_2.6.7/build_plugins_common'
/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/avidemux_2.6.7/build_plugins_common/CMakeFiles
make[1]: *** [ADM_videoFilters6/colorYUV/CMakeFiles/ADM_vf_colorYuv.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....


Since this one uses macros to take care of the target, I'm not sure where to fix this one....

Thanks,
Richard

mean

Quick & dirty : add TARGET_LINK_LIBRARY(xxxx c) in the culprit CMakeLists.txt

hobbes1069

Looks like a lot of the targets need it so I gave up and added:

LDFLAGS='-lc -Wl,--as-needed'

to the linker flags. That way what needs it gets it and what doesn't, doesn't. Still don't know why this only affects i686 builds.

Thanks,
Richard