From 708d8f38e9892a9510f22acaf893dc1ef27e71ae Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 29 May 2016 22:02:49 -0400 Subject: [PATCH] Don't use -fPIC on static builds. --- build/GNUbasegcc.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/GNUbasegcc.mk b/build/GNUbasegcc.mk index b6741d1d..9e3e8636 100644 --- a/build/GNUbasegcc.mk +++ b/build/GNUbasegcc.mk @@ -1,11 +1,8 @@ # 16 october 2015 -# TODO the loader looks for the soname, not the base name, which is frustrating - # Global flags. CFLAGS += \ - -fPIC \ -Wall -Wextra -pedantic \ -Wno-unused-parameter \ -Wno-switch \ @@ -14,14 +11,17 @@ CFLAGS += \ # C++11 is needed due to stupid rules involving commas at the end of enum lists that C++03 stupidly didn't follow # This means sorry, no GCC 2 for Haiku builds :( CXXFLAGS += \ - -fPIC \ -Wall -Wextra -pedantic \ -Wno-unused-parameter \ -Wno-switch \ --std=c++11 -LDFLAGS += \ - -fPIC +# -fPIC shouldn't be used with static builds (see https://github.com/andlabs/libui/issues/72#issuecomment-222395547) +ifeq (,$(STATIC)) +CFLAGS += -fPIC +CXXFLAGS += -fPIC +LDFLAGS += -fPIC +endif ifneq ($(RELEASE),1) CFLAGS += -g