--- /dev/null
+--- rocksdb-rocksdb-4.13.5/Makefile.orig 2016-12-26 19:15:47.176657758 +0100
++++ rocksdb-rocksdb-4.13.5/Makefile 2016-12-26 19:30:42.149980874 +0100
+@@ -137,7 +137,7 @@
+
+ AM_LINK = $(AM_V_CCLD)$(CXX) $^ $(EXEC_LDFLAGS) -o $@ $(LDFLAGS) $(COVERAGEFLAGS)
+ # detect what platform we're building on
+-dummy := $(shell (export ROCKSDB_ROOT="$(CURDIR)"; "$(CURDIR)/build_tools/build_detect_platform" "$(CURDIR)/make_config.mk"))
++dummy := $(shell (export ROCKSDB_ROOT="$(CURDIR)" CFLAGS="$(CFLAGS)"; "$(CURDIR)/build_tools/build_detect_platform" "$(CURDIR)/make_config.mk"))
+ # this file is generated by the previous line to set build flags and sources
+ include make_config.mk
+ CLEAN_FILES += make_config.mk