summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-11-16 23:11:28 +0800
committerruki <[email protected]>2017-11-16 13:08:53 +0800
commit6ae954995c3796bb89ba8fd1ccc613244090aa02 (patch)
tree71f0e31ed0e7df2b9789a2a51596d9b85d07a0c6
parenta28ddd8d5eab9f60ada2c3d8013de0f1c79abec1 (diff)
restore fPIC
-rw-r--r--xmake/modules/core/tools/gcc.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 2c4a5a0a3..205921400 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -41,17 +41,11 @@ function init(self)
, "-DIBAction=void)__attribute__((ibaction)"}
-- init shflags
- _g.shflags = { "-shared" }
+ _g.shflags = { "-shared", "-fPIC" }
-- init cxflags for the kind: shared
_g.shared = {}
- _g.shared.cxflags = {}
-
- -- add -fPIC (need not it on mingw/windows)
- if self:has_flags("-fPIC") then
- table.insert(_g.shflags, "-fPIC")
- table.insert(_g.shared.cxflags, "-fPIC")
- end
+ _g.shared.cxflags = {"-fPIC"}
-- suppress warning for clang (gcc -> clang on macosx)
if self:has_flags("-Qunused-arguments") then