Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 200 by [email protected]: DTrace integration fails with GCC 4.6.0 on Solaris x86
http://code.google.com/p/memcached/issues/detail?id=200

What steps will reproduce the problem?
1. Standard build process
CFLAGS contain "-fno-strict-aliasing" and "-Wno-error=unused-but-set-variable" to work around known issues. Optimization flags for target platforms are set to "-m64 -O3 -march=core2 -mfpmath=sse -msse3 -mno-ssse3".

./configure --prefix=${INSTPATH} --enable-64bit --enable-dtrace
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. With GCC 4.6.0 the compilatio of the DTrace script fails:

/usr/sbin/dtrace -G -o memcached_dtrace.o -s ./memcached_dtrace.d memcached-memcached.o memcached-hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats.o memcached-util.o memcached-solaris_priv.o dtrace: failed to link script ./memcached_dtrace.d: an error was encountered while processing memcached-memcached.o

Using memcached_debug-memcached.o instead the dtrace call works. Compiling with -O1 everything works fine as well. Any optimization setting above O1 fails. Removing all architecture related optimizations flags (march, sse etc) does not make any difference. Compilation on SPARC works with -O3.


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


Please provide any additional information below.

Workaround is to lower the optimization to O1.

I think this is rather an issue with the GCC 4.6.0 optimizer, and I'm going to inform the GCC team. Just filed it here to help anyone who experiences the same problem.
Tried to verify the issue with 1.6.0_beta1 but the complation fails:

libtool: compile: /opt/SP/gcc/current/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I./include -I./libevent -I/opt/SP/build/memcached/libevent-2.0.10-stable/include -I/opt/SP/apps/memcached-1.6.0_beta1-intel-x64/include -I/opt/SP/gcc/current/include -I/usr/sfw/include -I./engines/default_engine -I./include -I./libevent -I/opt/SP/build/memcached/libevent-2.0.10-stable/include -I/opt/SP/apps/memcached-1.6.0_beta1-intel-x64/include -I/opt/SP/gcc/current/include -I/usr/sfw/include -m64 -fvisibility=hidden -pthread -m64 -O3 -march=core2 -mfpmath=sse -msse3 -mno-ssse3 -fno-strict-aliasing -Wno-error=unused-but-set-variable -I/opt/SP/apps/memcached-1.6.0_beta1-intel-x64/include -I/opt/SP/gcc/current/include -I/usr/sfw/include -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT default_engine_la-slabs.lo -MD -MP -MF .deps/default_engine_la-slabs.Tpo -c engines/default_engine/slabs.c -fPIC -DPIC -o .libs/default_engine_la-slabs.o
mv -f .deps/default_engine_la-slabs.Tpo .deps/default_engine_la-slabs.Plo
/usr/sbin/dtrace -G -o .libs/default_engine_dtrace.o -s ./memcached_dtrace.d .libs/default_engine_la-assoc.o .libs/default_engine_la-default_engine.o .libs/default_engine_la-items.o .libs/default_engine_la-slabs.o
sed -e s,assoc,default_engine_dtrace,g assoc.lo > default_engine_dtrace.lo
sed: can't read assoc.lo: No such file or directory


BR Martin

Reply via email to