opus icon indicating copy to clipboard operation
opus copied to clipboard

undefined reference to `__stack_chk_guard'

Open KangLin opened this issue 5 years ago • 4 comments

Operating system: windows 10 Compiler: C:/Qt/Qt5.12.4/Tools/mingw730_32/bin/i686-w64-mingw32-gcc.exe Compiler versoin: 7.3.0 opus version: 1.3.1

cmake .. -DCMAKE_INSTALL_PREFIX=/d/Source/RabbitIm/ThirdLibrary/build_script/../windows_mingw730_x86_qt5.12.4_Release -DCMAKE_BUILD_TYPE=Release -G"MSYS Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=/d/Source/RabbitIm/ThirdLibrary/build_script/../windows_mingw730_x86_qt5.12.4_Release/../build_script/cmake/platforms/toolchain-mingw.cmake

toolchain-mingw.cmake

The error information: D:/Source/RabbitIm/ThirdLibrary/src/libopus/celt/float_cast.h:130:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp] #warning "Replacing these functions with a standard C cast." ^~~~~~~ [100%] Linking C shared library libopus.dll CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x34): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x3a2): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x111b): undefined reference to __stack_chk_fail' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x125c): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x1274): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x12b3): undefined reference to __stack_chk_fail'

KangLin avatar Jun 21 '19 23:06 KangLin

[KangLin]

[100%] Linking C shared library libopus.dll CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x34): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x3a2): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x111b): undefined reference to __stack_chk_fail' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x125c): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x1274): undefined reference to __stack_chk_guard' CMakeFiles/opus.dir/objects.a(opus_decoder.c.obj):opus_decoder.c:(.text+0x12b3): undefined reference to __stack_chk_fail'

According to <URL:https://stackoverflow.com/questions/27290086/gcc-canaries-undefined-reference-to-stack-chk-guard > these are related to the stack protector option for gcc. I guess either you need to turn off that option, or define the two requested global symbols.

-- Happy hacking Petter Reinholdtsen

petterreinholdtsen avatar Jun 22 '19 05:06 petterreinholdtsen

Yes, disable it is ok.

KangLin avatar Jun 22 '19 09:06 KangLin

Yes, disable it is ok. What commands did you run to disable it?

aruhela avatar Sep 11 '20 18:09 aruhela

https://github.com/xiph/opus/commit/b83dd52868326a401c8578041e3dbea439d53f11 should have fixed this.

xnorpx avatar Sep 11 '20 21:09 xnorpx