summaryrefslogtreecommitdiff
path: root/task_cc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'task_cc.cc')
-rw-r--r--task_cc.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/task_cc.cc b/task_cc.cc
index 74654aa..4340f7b 100644
--- a/task_cc.cc
+++ b/task_cc.cc
@@ -178,6 +178,13 @@ int TaskCC::runInner()
std::vector<std::string> args;
args.push_back("-MMD");
+
+ if(std::filesystem::path(config.target).extension() == ".so")
+ {
+ // Add -fPIC arg to all contained object files
+ args.push_back("-fPIC");
+ }
+
args.push_back("-c");
args.push_back(std::string(sourceFile));
args.push_back("-o");