From 98197e55c10176c3ef9100f7d852abbd2347225f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 10 Aug 2010 18:55:09 +0000 Subject: Make it possible to set the flags passed to the assembler. Nick, please review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110705 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/gold/gold-plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/gold') diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 207c0d8b46..d649ccb048 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -66,6 +66,7 @@ namespace options { static generate_bc generate_bc_file = BC_NO; static std::string bc_path; static std::string as_path; + static std::vector as_args; static std::vector pass_through; static std::string extra_library_path; static std::string triple; @@ -91,6 +92,9 @@ namespace options { } else { as_path = opt.substr(strlen("as=")); } + } else if (opt.startswith("as-arg=")) { + llvm::StringRef item = opt.substr(strlen("as-arg=")); + as_args.push_back(item.str()); } else if (opt.startswith("extra-library-path=")) { extra_library_path = opt.substr(strlen("extra_library_path=")); } else if (opt.startswith("pass-through=")) { @@ -401,6 +405,14 @@ static ld_plugin_status all_symbols_read_hook(void) { sys::Path p = sys::Program::FindProgramByName(options::as_path); lto_codegen_set_assembler_path(cg, p.c_str()); } + if (!options::as_args.empty()) { + std::vector as_args_p; + for (std::vector::iterator I = options::as_args.begin(), + E = options::as_args.end(); I != E; ++I) { + as_args_p.push_back(I->c_str()); + } + lto_codegen_set_assembler_args(cg, &as_args_p[0], as_args_p.size()); + } // Pass through extra options to the code generator. if (!options::extra.empty()) { for (std::vector::iterator it = options::extra.begin(); -- cgit v1.2.3