Avidemux Forum

Avidemux => Unix-Like (Linux/Bsd/...) => Topic started by: hobbes1069 on January 27, 2014, 08:12:20 PM

Title: undefined reference to `__stack_chk_fail' on i686 build of 2.6.7
Post by: hobbes1069 on January 27, 2014, 08:12:20 PM
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
Title: Re: undefined reference to `__stack_chk_fail' on i686 build of 2.6.7
Post by: mean on January 27, 2014, 08:31:18 PM
http://avidemux.org/smuf/index.php/topic,13386.0.html
Title: Re: undefined reference to `__stack_chk_fail' on i686 build of 2.6.7
Post by: hobbes1069 on January 28, 2014, 01:57:24 PM
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
Title: Re: undefined reference to `__stack_chk_fail' on i686 build of 2.6.7
Post by: mean on January 28, 2014, 02:02:49 PM
Quick & dirty : add TARGET_LINK_LIBRARY(xxxx c) in the culprit CMakeLists.txt
Title: Re: undefined reference to `__stack_chk_fail' on i686 build of 2.6.7
Post by: hobbes1069 on March 03, 2014, 11:43:31 PM
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