summaryrefslogtreecommitdiff
path: root/tools/gold/gold-plugin.cpp
diff options
context:
space:
mode:
authorTom Roeder <tmroeder@google.com>2014-06-26 20:43:27 +0000
committerTom Roeder <tmroeder@google.com>2014-06-26 20:43:27 +0000
commit9ad9c967556cdb7adb7c61dad694aa67c94e84bc (patch)
tree3d1be8986ca2befb25faebfca50d64b552189827 /tools/gold/gold-plugin.cpp
parentc2d93c404820178d55f440d4aa46e75d4b5c7b64 (diff)
downloadllvm-9ad9c967556cdb7adb7c61dad694aa67c94e84bc.tar.gz
llvm-9ad9c967556cdb7adb7c61dad694aa67c94e84bc.tar.bz2
llvm-9ad9c967556cdb7adb7c61dad694aa67c94e84bc.tar.xz
Fix the new LTOCodeGenerator setup in gold to parse options before using MAttrs.
This fixes a regression that made clang -flto -Wl,--plugin-opt=-mattr=+aes not pass the "+aes" option to the LTOCodeGenerator attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gold/gold-plugin.cpp')
-rw-r--r--tools/gold/gold-plugin.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
index 3c2da94af5..c3ae5a6c30 100644
--- a/tools/gold/gold-plugin.cpp
+++ b/tools/gold/gold-plugin.cpp
@@ -234,15 +234,6 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
InitializeAllAsmParsers();
InitializeAllAsmPrinters();
CodeGen = new LTOCodeGenerator();
- if (MAttrs.size()) {
- std::string Attrs;
- for (unsigned I = 0; I < MAttrs.size(); ++I) {
- if (I > 0)
- Attrs.append(",");
- Attrs.append(MAttrs[I]);
- }
- CodeGen->setAttr(Attrs.c_str());
- }
// Pass through extra options to the code generator.
if (!options::extra.empty()) {
@@ -253,6 +244,16 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
}
CodeGen->parseCodeGenDebugOptions();
+ if (MAttrs.size()) {
+ std::string Attrs;
+ for (unsigned I = 0; I < MAttrs.size(); ++I) {
+ if (I > 0)
+ Attrs.append(",");
+ Attrs.append(MAttrs[I]);
+ }
+ CodeGen->setAttr(Attrs.c_str());
+ }
+
TargetOpts = InitTargetOptionsFromCodeGenFlags();
CodeGen->setTargetOptions(TargetOpts);