don't use -static-libstdc++, causing problems like "glibc detected *** python: free(): invalid pointer"
cfr. https://github.com/numba/llvmlite/issues/93;
don't hardcode -lLLVMOProfileJIT, not required anymore
cfr. https://github.com/numba/llvmlite/issues/121
author: Kenneth Hoste (HPC-UGent)
--- llvmlite-0.9.0/ffi/Makefile.linux.orig	2016-01-26 15:11:43.000000000 +0100
+++ llvmlite-0.9.0/ffi/Makefile.linux	2016-03-30 12:41:34.102307156 +0200
@@ -4,9 +4,7 @@
 # -flto and --exclude-libs allow us to remove those parts of LLVM we don't use
 CXXFLAGS = $(LLVM_CXXFLAGS) -flto
 LDFLAGS = $(LLVM_LDFLAGS) -flto -Wl,--exclude-libs=ALL
-# Need to add LLVMOProfileJIT by hand
-# see https://llvm.org/bugs/show_bug.cgi?id=25091
-LIBS = $(LLVM_LIBS) -lLLVMOProfileJIT
+LIBS = $(LLVM_LIBS)
 SRC = assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp \
 	  executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp \
 	  linker.cpp
@@ -15,9 +13,7 @@
 all: $(OUTPUT)
 
 $(OUTPUT): $(SRC)
-	# static-libstdc++ avoids runtime dependencies on a
-	# particular libstdc++ version.
-	$(CXX) -static-libstdc++ -shared $(CXXFLAGS) $(SRC) -o $(OUTPUT) $(LDFLAGS) $(LIBS)
+	$(CXX) -shared $(CXXFLAGS) $(SRC) -o $(OUTPUT) $(LDFLAGS) $(LIBS)
 
 clean:
 	rm -rf test
