From 1f17bc18543989b24cb7b4ad743a70f335fe62fd Mon Sep 17 00:00:00 2001 From: idning Date: Fri, 14 Nov 2014 18:44:08 +0800 Subject: [PATCH] add GCC option -fno-strict-aliasing see: https://github.com/twitter/twemproxy/issues/276 --- README.md | 10 ++++++++-- src/Makefile.am | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c87fe205..8757c87c 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,21 @@ To build nutcracker from [distribution tarball](http://code.google.com/p/twempro $ make $ sudo make install -To build nutcracker from source with _debug logs enabled_ and _assertions disabled_: +To build nutcracker from source with _debug logs enabled_ and _assertions enabled_: $ git clone git@github.com:twitter/twemproxy.git $ cd twemproxy $ autoreconf -fvi - $ ./configure --enable-debug=log + $ ./configure --enable-debug=full $ make $ src/nutcracker -h +Few checklists: + ++ use newer version of gcc (older version of gcc has problems) ++ use CFLAGS="-O1" ./configure && make ++ use CFLAGS="-O3 -fno-strict-aliasing" ./configure && make + ## Features + Fast. diff --git a/src/Makefile.am b/src/Makefile.am index f461fb21..56e0f1ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,7 +9,9 @@ AM_CPPFLAGS += -I $(top_srcdir)/src/proto AM_CPPFLAGS += -I $(top_srcdir)/src/event AM_CPPFLAGS += -I $(top_srcdir)/contrib/yaml-0.1.4/include -AM_CFLAGS = +AM_CFLAGS = +# about -fno-strict-aliasing: https://github.com/twitter/twemproxy/issues/276 +AM_CFLAGS += -fno-strict-aliasing AM_CFLAGS += -Wall -Wshadow AM_CFLAGS += -Wpointer-arith AM_CFLAGS += -Winline