From 0746a4c95a439cba0be5fb3e5fd1e75fdb6dd05c Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 6 Jul 2009 12:18:09 -0500 Subject: [PATCH] Fixed strict aliasing. Turn it off only for the callbacks code. When we turn it off, also turn off the optimization --- configure.ac | 2 ++ libmemcached/Makefile.am | 11 +++++++---- tests/Makefile.am | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 0df44b0a..b2fb9880 100644 --- a/configure.ac +++ b/configure.ac @@ -329,6 +329,7 @@ template <> void C::foo(); [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"], [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"]) + NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing" NO_REDUNDANT_DECLS="-Wno-redundant-decls" fi if test "$SUNCC" = "yes" @@ -364,6 +365,7 @@ fi AC_SUBST(NO_CONVERSION) AC_SUBST(NO_REDUNDANT_DECLS) +AC_SUBST(NO_STRICT_ALIASING) AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}" AM_CFLAGS="${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE} ${CFLAGS}" diff --git a/libmemcached/Makefile.am b/libmemcached/Makefile.am index b7659eb2..d9427040 100644 --- a/libmemcached/Makefile.am +++ b/libmemcached/Makefile.am @@ -23,13 +23,17 @@ pkginclude_HEADERS= memcached.h \ memcached_storage.h \ memcached_string.h \ memcached_types.h \ - memcached_watchpoint.h + memcached_watchpoint.h \ + visibility.h if BUILD_LIBMEMCACHEDUTIL pkginclude_HEADERS+= memcached_util.h memcached_pool.h endif lib_LTLIBRARIES = libmemcached.la +noinst_LTLIBRARIES = libmemcachedcallbacks.la +libmemcachedcallbacks_la_CFLAGS = ${AM_CFLAGS} ${NO_STRICT_ALIASING} +libmemcachedcallbacks_la_SOURCES = memcached_callback.c libmemcached_la_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} -DBUILDING_LIBMEMCACHED libmemcached_la_SOURCES = crc.c \ @@ -37,7 +41,6 @@ libmemcached_la_SOURCES = crc.c \ memcached_auto.c \ memcached_analyze.c \ memcached_behavior.c \ - memcached_callback.c \ memcached_connect.c \ memcached_delete.c \ memcached_do.c \ @@ -75,8 +78,8 @@ if BUILD_BYTEORDER libmemcached_la_SOURCES += byteorder.c endif -libmemcached_la_DEPENDENCIES = @DTRACE_OBJ@ -libmemcached_la_LIBADD = @DTRACE_OBJ@ $(LIBM) +libmemcached_la_DEPENDENCIES = @DTRACE_OBJ@ libmemcachedcallbacks.la +libmemcached_la_LIBADD = @DTRACE_OBJ@ $(LIBM) libmemcachedcallbacks.la libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) $(LD_VERSION_SCRIPT) $(LIBM) dtrace_probes.h: libmemcached_probes.d diff --git a/tests/Makefile.am b/tests/Makefile.am index 70437c2e..2916350e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,7 +21,7 @@ LIBS = noinst_HEADERS = test.h server.h ketama_test_cases.h noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers -testapp_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} +testapp_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} ${NO_STRICT_ALIASING} testapp_SOURCES = test.c function.c server.c ../clients/generator.c ../clients/execute.c testapp_LDADD = $(LDADDS) -- 2.30.2