aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/gold
diff options
context:
space:
mode:
authorZakk Chen <zakk.chen@sifive.com>2020-04-27 20:04:36 -0700
committerZakk Chen <zakk.chen@sifive.com>2020-05-04 18:31:09 -0700
commitad5fad0ac56b78a692a052f2da397b4bc7fd6150 (patch)
tree443120a8bc6d8f5913652bc25720454021571c26 /llvm/tools/gold
parent36183811fb5455ea18cf7d9cd03748076f20573b (diff)
downloadllvm-ad5fad0ac56b78a692a052f2da397b4bc7fd6150.zip
llvm-ad5fad0ac56b78a692a052f2da397b4bc7fd6150.tar.gz
llvm-ad5fad0ac56b78a692a052f2da397b4bc7fd6150.tar.bz2
[LTO] Suppress emission of empty combined module by default
Summary: That unless the user requested an output object (--lto-obj-path), the an unused empty combined module is not emitted. This changed is helpful for some target (ex. RISCV-V) which encoded the ABI info in IR module flags (target-abi). Empty unused module has no ABI info so the linker would get the linking error during merging incompatible ABIs. Reviewers: tejohnson, espindola, MaskRay Subscribers: emaste, inglorion, arichardson, hiraditya, simoncook, MaskRay, steven_wu, dexonsmith, PkmX, dang, lenary, s.egerton, luismarques, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78988
Diffstat (limited to 'llvm/tools/gold')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index 0b249d2..50b0173 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -871,6 +871,7 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite,
Conf.OptLevel = options::OptLevel;
Conf.PTO.LoopVectorization = options::OptLevel > 1;
Conf.PTO.SLPVectorization = options::OptLevel > 1;
+ Conf.AlwaysEmitRegularLTOObj = !options::obj_path.empty();
if (options::thinlto_index_only) {
std::string OldPrefix, NewPrefix;