Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Memcached compilation fails with GCC 4.6.0 #199

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Standard build process
CFLAGS contain "-fno-strict-aliasing" to work around known issue.

./configure --prefix=${INSTPATH} --enable-64bit {plus DTrace on Solaris}
gmake all

What is the expected output? What do you see instead?

With GCC 4.5.2 and the same parameters and versions the build worked fine. 
Since GCC 4.6.0 treats some warnings as errors, the compilation fails:
/opt/SP/gcc/current/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -DNDEBUG 
-I/opt/SP/build/memcached/libevent-2.0.10-stable/include 
-I/opt/SP/apps/memcached-1.4.5-intel-x64/include -I/opt/SP/gcc/current/include 
-I/usr/sfw/include  -m64 -m64 -O1 -march=core2 -mfpmath=sse -msse3 -mno-ssse3 
-fno-strict-aliasing -I/opt/SP/apps/memcached-1.4.5-intel-x64/include 
-I/opt/SP/gcc/current/include -I/usr/sfw/include -pthread -Wall -Werror 
-pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT 
memcached-items.o -MD -MP -MF .deps/memcached-items.Tpo -c -o memcached-items.o 
`test -f 'items.c' || echo './'`items.c
items.c: In function 'do_item_stats_sizes':
items.c:453:21: error: variable 'klen' set but not used 
[-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

gmake[2]: *** [memcached-items.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
mv -f .deps/memcached-memcached.Tpo .deps/memcached-memcached.Po
gmake[2]: Leaving directory `/opt/SP/build/memcached/memcached-1.4.5'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/SP/build/memcached/memcached-1.4.5'
gmake: *** [all] Error 2

[ Side note: The "-O1" is a workaround for a special bug with GCC 4.6.0, which 
breaks the DTrace integration of memchached when using any optimization greater 
O1, but this is a different issue... ]

What version of the product are you using? On what operating system?
memcached 1.4.5
libevent 2.0.10-stable
gcc 4.6.0
Solaris 10 U8+9 x86, Solaris 10 U8 SPARC, CentOS 5.5 x86

Please provide any additional information below.
Compilation fails on all platforms I use. Workaround is adding
"-Wno-error=unused-but-set-variable"
to CFLAGS.
I attached a file with all warnings found on the SPARC box (should be the 
superset) when compiling using the no-error flag. At least the 
unused-but-set-variable things need to be fixed to make memcached compile with 
GCC 4.6.0.

If I can be of any help like testing patches just give me a shout.

BR Martin

Original issue reported on code.google.com by martin.k...@gmail.com on 14 Apr 2011 at 4:14

Attachments:

GoogleCodeExporter commented 9 years ago
Should be fixed in 1.4.6-rc1. Can you please reopen with more information if it 
does not work? We don't actually have a gcc 4.6.* handy right now to double 
check, but the offending code has been removed.

Original comment by dorma...@rydia.net on 12 Jul 2011 at 11:31

GoogleCodeExporter commented 9 years ago
I can confirm that this is fixed in 1.4.6-rc1.
Just compiled it with gcc 4.6.1 and it works fine without using 
"-Wno-error=unused-but-set-variable".

Original comment by martin.k...@gmail.com on 13 Jul 2011 at 3:35