diff --git a/modules/compiler/cookie/{{cookiecutter.target_name}}/source/module.cpp b/modules/compiler/cookie/{{cookiecutter.target_name}}/source/module.cpp index 5e14a0b76..7156bdf72 100644 --- a/modules/compiler/cookie/{{cookiecutter.target_name}}/source/module.cpp +++ b/modules/compiler/cookie/{{cookiecutter.target_name}}/source/module.cpp @@ -227,7 +227,8 @@ static llvm::TargetMachine *createTargetMachine(const {{cookiecutter.target_name return llvm_target->createTargetMachine( target.llvm_triple, target.llvm_cpu, target.llvm_features, options, - llvm::Reloc::Model::Static, llvm::CodeModel::Small, + {{cookiecutter.link_shared}} ? llvm::Reloc::Model::PIC_ : llvm::Reloc::Model::Static, + llvm::CodeModel::Small, multi_llvm::CodeGenOptLevel::Aggressive); }