diff options
author | Sam Elliott <selliott@lowrisc.org> | 2019-10-14 14:00:13 +0000 |
---|---|---|
committer | Sam Elliott <selliott@lowrisc.org> | 2019-10-14 14:00:13 +0000 |
commit | 86c4707c4b8e0cd8045548d1a7fd35e37d7ccf71 (patch) | |
tree | 0831dc33ec1eed8cdf659f077f2e88abb7c44952 /test/Driver | |
parent | 5dceabfe017f72812966261ba8326c83d709729e (diff) | |
download | clang-86c4707c4b8e0cd8045548d1a7fd35e37d7ccf71.tar.gz |
[RISCV] enable LTO support, pass some options to linker.
Summary:
1. enable LTO need to pass target feature and abi to LTO code generation
RISCV backend need the target feature to decide which extension used in
code generation.
2. move getTargetFeatures to CommonArgs.h and add ForLTOPlugin flag
3. add general tools::getTargetABI in CommonArgs.h because different target uses different
way to get the target ABI.
Patch by Kuan Hsu Chen (khchen)
Reviewers: lenary, lewis-revill, asb, MaskRay
Reviewed By: lenary
Subscribers: hiraditya, dschuff, aheejin, fedor.sergeev, mehdi_amini, inglorion, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67409
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver')
-rw-r--r-- | test/Driver/gold-lto.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Driver/gold-lto.c b/test/Driver/gold-lto.c index d16961eeda..c761461f34 100644 --- a/test/Driver/gold-lto.c +++ b/test/Driver/gold-lto.c @@ -26,3 +26,21 @@ // RUN: %clang -target i686-linux-android -### %t.o -flto 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-X86-ANDROID // CHECK-X86-ANDROID: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" +// +// RUN: %clang -target riscv64-unknown-elf -### %t.o -flto 2>&1 \ +// RUN: -march=rv64imf -mabi=lp64f \ +// RUN: | FileCheck %s --check-prefix=CHECK-RISCV-BAREMETAL +// CHECK-RISCV-BAREMETAL: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" +// CHECK-RISCV-BAREMETAL: "-plugin-opt=-mattr=+m" +// CHECK-RISCV-BAREMETAL: "-plugin-opt=-mattr=+f" +// CHECK-RISCV-BAREMETAL: "-plugin-opt=-mattr=+relax" +// CHECK-RISCV-BAREMETAL: "-plugin-opt=-target-abi=lp64f" +// +// RUN: %clang -target riscv64-unknown-linux-gnu -### %t.o -flto 2>&1 \ +// RUN: -march=rv64imf -mabi=lp64f \ +// RUN: | FileCheck %s --check-prefix=CHECK-RISCV-LINUX +// CHECK-RISCV-LINUX: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}" +// CHECK-RISCV-LINUX: "-plugin-opt=-mattr=+m" +// CHECK-RISCV-LINUX: "-plugin-opt=-mattr=+f" +// CHECK-RISCV-LINUX: "-plugin-opt=-mattr=+relax" +// CHECK-RISCV-LINUX: "-plugin-opt=-target-abi=lp64f" |