From 94ec8cb99769a5a04b614d871ee28b8f457b81d2 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 28 May 2019 04:12:02 +0300 Subject: [PATCH] wscript: add -fPIC for static libraries globally --- public/wscript | 4 ++-- wscript | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/wscript b/public/wscript index dfe233fb..2f1a3aa6 100644 --- a/public/wscript +++ b/public/wscript @@ -12,8 +12,8 @@ def options(opt): return def configure(conf): - # public is part of shared libraries - conf.env.CFLAGS += conf.env.CFLAGS_cshlib + # stub + return def build(bld): source = bld.path.ant_glob(['*.c']) diff --git a/wscript b/wscript index 62f84b5f..cb86ef97 100644 --- a/wscript +++ b/wscript @@ -96,6 +96,11 @@ def configure(conf): conf.load('msvc msdev msvs') conf.load('xcompile compiler_c compiler_cxx gitversion clang_compilation_database') + # Every static library must have fPIC + if conf.env.DEST_OS != 'win32' and '-fPIC' in conf.env.CFLAGS_cshlib: + conf.env.append_unique('CFLAGS_cstlib', '-fPIC') + conf.env.append_unique('CXXFLAGS_cxxstlib', '-fPIC') + # modify options dictionary early if conf.env.DEST_OS2 == 'android': conf.options.ALLOW64 = True # skip pointer length check