From a16fde8070da7ecd78c2a7a3680f5f17828b2af9 Mon Sep 17 00:00:00 2001 From: Hongcai Deng Date: Sun, 29 Jan 2017 14:20:18 +0800 Subject: [PATCH] fix: compile error when build .so using .a ``` src/libfastcommon.a(hash.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC ``` env: Ubuntu 14.04, gcc 4.8 --- src/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.in b/src/Makefile.in index 2fbf27c..de22c73 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -52,7 +52,7 @@ libfastcommon.a: $(FAST_STATIC_OBJS) .c: $(COMPILE) -o $@ $< $(FAST_STATIC_OBJS) $(LIB_PATH) $(INC_PATH) .c.o: - $(COMPILE) -c -o $@ $< $(INC_PATH) + $(COMPILE) -c -fPIC -o $@ $< $(INC_PATH) .c.lo: $(COMPILE) -c -fPIC -o $@ $< $(INC_PATH) install: