From 634a1d0bf6732f6b98b3449a23ff11582fdbf52c Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Thu, 11 Jan 2018 01:55:26 +0100 Subject: [PATCH] Installation: -fPIC should not be used unconditionally According to Gentoo packaging guide, -fPIC should only be used on shared libraries, and not added unconditionally to every linker call. Signed-off-by: Kai Krakow --- lib/Makefile | 4 ++-- makeflags | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 5aaf468..54df19d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -30,7 +30,7 @@ depends.mk: *.cc -include depends.mk %.o: %.cc ../include/crucible/%.h - $(CXX) $(CXXFLAGS) -o $@ -c $< + $(CXX) $(CXXFLAGS) -fPIC -o $@ -c $< libcrucible.so: $(OBJS) Makefile - $(CXX) $(LDFLAGS) -o $@ $(OBJS) -shared -Wl,-soname,$@ -luuid + $(CXX) $(LDFLAGS) -fPIC -o $@ $(OBJS) -shared -Wl,-soname,$@ -luuid diff --git a/makeflags b/makeflags index f5983cb..de4a66f 100644 --- a/makeflags +++ b/makeflags @@ -1,4 +1,4 @@ -CCFLAGS = -Wall -Wextra -Werror -O3 -march=native -I../include -ggdb -fpic -D_FILE_OFFSET_BITS=64 +CCFLAGS = -Wall -Wextra -Werror -O3 -march=native -I../include -ggdb -D_FILE_OFFSET_BITS=64 # CCFLAGS = -Wall -Wextra -Werror -O0 -I../include -ggdb -fpic -D_FILE_OFFSET_BITS=64 CFLAGS = $(CCFLAGS) -std=c99 CXXFLAGS = $(CCFLAGS) -std=c++11 -Wold-style-cast