diff --git a/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp b/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp index 7e4cb435fc877..b36962f9d4255 100644 --- a/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp +++ b/interpreter/cling/lib/Interpreter/IncrementalExecutor.cpp @@ -89,7 +89,13 @@ std::unique_ptr std::string FeaturesStr; TargetOptions Options = TargetOptions(); +// We have to use large code model for PowerPC64 because TOC and text sections +// can be more than 2GB apart. +#if defined(__powerpc64__) || defined(__PPC64__) + CodeModel::Model CMModel = CodeModel::Large; +#else CodeModel::Model CMModel = CodeModel::JITDefault; +#endif CodeGenOpt::Level OptLevel = CodeGenOpt::Default; switch (CGOpt.OptimizationLevel) { case 0: OptLevel = CodeGenOpt::None; break;