--- librhash/Makefile.orig	2016-11-06 15:49:40 UTC
+++ librhash/Makefile
@@ -2,9 +2,9 @@
 CC      ?= gcc
 AR      ?= ar
 #NOTE: NDEBUG turns off asserts
-OPTFLAGS   = -O2 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections
+OPTFLAGS   = -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections
 OPTLDFLAGS =
-CFLAGS     = $(OPTFLAGS)
+CFLAGS     += $(OPTFLAGS)
 LDFLAGS    = $(OPTLDFLAGS)
 ADDCFLAGS  =
 LIBCFLAGS  =
@@ -187,7 +187,7 @@ test-dll: $(DLLNAME) test_hashes.o
 
 # shared and static libraries
 $(SONAME): $(SOURCES)
-	sed -n '1s/.*/{ global:/p; s/^RHASH_API.* \([a-z0-9_]\+\)(.*/  \1;/p; $$s/.*/local: *; };/p' $(SO_HEADERS) > exports.sym
+	sed -nE '1s/.*/{ global:/p; s/^RHASH_API.* ([a-z0-9_]+)\(.*/  \1;/p; $$s/.*/local: *; };/p' $(SO_HEADERS) > exports.sym
 	$(CC) -fpic $(ALLCFLAGS) -shared $(SOURCES) -Wl,--version-script,exports.sym,-soname,$(SONAME) $(LIBLDFLAGS) -o $@
 	ln -s $(SONAME) $(SOLINK)
 # use 'nm -Cg --defined-only $@' to view exported symbols
