ccc: Use toolchain hook for default relocation model value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65116 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py
index c1146a0..3c80861 100644
--- a/tools/ccc/ccclib/Tools.py
+++ b/tools/ccc/ccclib/Tools.py
@@ -252,17 +252,11 @@
             picEnabled = (arglist.getLastArg(arglist.parser.f_PICOption) or
                           arglist.getLastArg(arglist.parser.f_picOption) or
                           arglist.getLastArg(arglist.parser.f_PIEOption) or
-                          arglist.getLastArg(arglist.parser.f_pieOption) or
-                          (not arglist.getLastArg(arglist.parser.m_kernelOption) and
-                          not arglist.getLastArg(arglist.parser.staticOption) and
-                          not arglist.getLastArg(arglist.parser.m_dynamicNoPicOption)))
-
-            # FIXME: This needs to tie into a platform hook.
-            if (self.toolChain.archName == 'x86_64' or 
-                picEnabled):
-                cmd_args.append('--relocation-model=pic')
-            elif not arglist.getLastArg(arglist.parser.m_dynamicNoPicOption):
-                cmd_args.append('--relocation-model=static')
+                          arglist.getLastArg(arglist.parser.f_pieOption))
+            picDisabled = (arglist.getLastArg(arglist.parser.m_kernelOption) or
+                           arglist.getLastArg(arglist.parser.staticOption))
+            model = self.toolChain.getRelocationModel(picEnabled, picDisabled)
+            cmd_args.append('--relocation-model=%s' % model)
 
             if arglist.getLastArg(arglist.parser.f_timeReportOption):
                 cmd_args.append('--time-passes')