Jdesk / memcached

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

DTrace integration fails with GCC 4.6.0 on Solaris x86 #200

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" 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

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

GoogleCodeExporter commented 9 years ago
Trond, can you verify and fix or close the Solaris issues?

Original comment by dsalli...@gmail.com on 13 Jul 2011 at 1:57

GoogleCodeExporter commented 9 years ago
Update:
Verified the issue with memcached 1.4.6-rc1 and gcc 4.6.1. Compilation with gcc 
4.5.3 works fine. Setting optimization to "O1" resolves the issue with gcc 
4.6.1, so it must be related to the optimization somehow.

@Trond: if you need the gcc 4.6.1 suite for Sol 10 x86 just give me a shout 
(and a place to upload a ~130MB tarball ;-) ). I could also provide the 
memcached-memcached.o file causing the problem, or even the complete build 
directory with all files until the compilation stops, plus the ones built with 
-O1 or gcc 4.5.3 to compare them. Whatever helps best.

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

GoogleCodeExporter commented 9 years ago
I'd appreciate a gcc 4.6.1 for solaris 10 x86.. It would be easier for me to 
build and play around with disassembly if I can change stuff there ;)

Original comment by trond.no...@gmail.com on 13 Jul 2011 at 10:00

GoogleCodeExporter commented 9 years ago
I've sent you an email with the download links, let me know if you did not 
receive it.

Original comment by martin.k...@gmail.com on 14 Jul 2011 at 1:37

GoogleCodeExporter commented 9 years ago
https://github.com/memcached/memcached/commit/6298b3978687530bc9d219b6ac707a1b68
1b2a46

Original comment by trond.no...@gmail.com on 18 Jul 2011 at 10:52

GoogleCodeExporter commented 9 years ago
Patch applied to 1.4.5 and 1.4.6-rc1, I can confirm the issue is solved (not 
that I did not believe it, just to let you know :-) )

Great work, thanks.

Original comment by martin.k...@gmail.com on 18 Jul 2011 at 12:56