From ad5fad0ac56b78a692a052f2da397b4bc7fd6150 Mon Sep 17 00:00:00 2001 From: Zakk Chen Date: Mon, 27 Apr 2020 20:04:36 -0700 Subject: [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 --- llvm/tools/gold/gold-plugin.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/tools/gold') 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 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; -- cgit v1.1