mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
[clang] [MinGW] Pass LTO options to the linker
This matches what is done on other platforms too. This fixes one part of https://github.com/mstorsjo/llvm-mingw/issues/349. Differential Revision: https://reviews.llvm.org/D158411
This commit is contained in:
parent
7cabb54f38
commit
a23bf1786b
@ -238,6 +238,12 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
|
||||
AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
|
||||
|
||||
if (D.isUsingLTO()) {
|
||||
assert(!Inputs.empty() && "Must have at least one input.");
|
||||
addLTOOptions(TC, Args, CmdArgs, Output, Inputs[0],
|
||||
D.getLTOMode() == LTOK_Thin);
|
||||
}
|
||||
|
||||
if (C.getDriver().IsFlangMode()) {
|
||||
addFortranRuntimeLibraryPath(TC, Args, CmdArgs);
|
||||
addFortranRuntimeLibs(TC, CmdArgs);
|
||||
|
@ -1,4 +1,6 @@
|
||||
// The default linker doesn't support LLVM bitcode
|
||||
// RUN: not %clang --target=i686-pc-windows-gnu %s -flto -fuse-ld=bfd
|
||||
// When using lld, this is allowed though.
|
||||
// RUN: %clang --target=i686-pc-windows-gnu -### %s -flto -fuse-ld=lld -B%S/Inputs/lld
|
||||
// RUN: %clang --target=i686-pc-windows-gnu -### %s -flto -fuse-ld=lld -B%S/Inputs/lld -femulated-tls 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: "-plugin-opt=-emulated-tls"
|
||||
|
Loading…
Reference in New Issue
Block a user