From 820c62e4474181fe2e36dae68e6652328361e822 Mon Sep 17 00:00:00 2001 From: Nick Kledzik Date: Thu, 4 Jun 2009 19:14:08 +0000 Subject: [PATCH] libLTO for darwin should add -static when assembling .s llvm-svn: 72881 --- llvm/tools/lto/LTOCodeGenerator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp index 17c83bb5cf68..0bd2abe24558 100644 --- a/llvm/tools/lto/LTOCodeGenerator.cpp +++ b/llvm/tools/lto/LTOCodeGenerator.cpp @@ -249,6 +249,7 @@ bool LTOCodeGenerator::assemble(const std::string& asmPath, std::string targetTriple = _linker.getModule()->getTargetTriple(); args.push_back(tool.c_str()); if ( targetTriple.find("darwin") != targetTriple.size() ) { + // darwin specific command line options if (strncmp(targetTriple.c_str(), "i386-apple-", 11) == 0) { args.push_back("-arch"); args.push_back("i386"); @@ -286,6 +287,9 @@ bool LTOCodeGenerator::assemble(const std::string& asmPath, args.push_back("-arch"); args.push_back("armv6"); } + // add -static to assembler command line when code model requires + if ( (_assemblerPath != NULL) && (_codeModel == LTO_CODEGEN_PIC_MODEL_STATIC) ) + args.push_back("-static"); } if ( needsCompilerOptions ) { args.push_back("-c");