FS#15189 - [libnice] gcc optimizations -O2 (-fstrict-aliasing) breaks sha1.c
Attached to Project:
Community Packages
Opened by Jérémie Laval (Garuma) - Saturday, 20 June 2009, 15:31 GMT
Last edited by Ionut Biru (wonder) - Monday, 22 June 2009, 17:55 GMT
Opened by Jérémie Laval (Garuma) - Saturday, 20 June 2009, 15:31 GMT
Last edited by Ionut Biru (wonder) - Monday, 22 June 2009, 17:55 GMT
|
Details
Description:
Some cryptographic code like sha1.c in libnice breaks with -O2 with Arch gcc on x64. I suspect this is also the case with Ekiga which reports a lot of corrupted packet when used and can't connect anywhere. Since amsn sound conferencing is based on farsight2 which is also based on libnice for its transport layer, that amsn feature is also broken. Additional info: * libnice : all version. Testing was done starting from 0.7 * gcc: vanilla from arch : gcc (GCC) 4.4.0 20090526 (prerelease) Steps to reproduce: Compile a arch package of libnice (http://repos.archlinux.org/viewvc.cgi/community/lib/libnice/PKGBUILD?revision=1.8&root=community&pathrev=CURRENT) and go to src/libnice-0.0.8/stun/tests. 'make check' in it and run ./test-hmac, sha1 test should report different hash than the one expected while md5 works. If you 'make clean && make distclean' in the libnice directory and add a 'export CFLAGS=''' in the PKGBUILD before the ./configure call and redo the procedure above it now works correctly. It's highly unlikely that the sha1.c code is bad since it's quite old&robust and has been reported to work correctly elsewhere. |
This task depends upon
Simple add: to CFLAGS -fno-strict-aliasing (that is enabled in -O2 level)
Not only on x86_64.
- uint32_t workspace[16];
+ uint8_t workspace[64];
should run fine now ;)