Skip to content

Commit ab9b2fe

Browse files
committed
[Driver] Define BareMetal::HasNativeLLVMSupport to return true
D33259 switched the default linker to ld.lld which supports LLVM LTO. We can support LTO compile/link in one command and drop the `unable to pass LLVM bit-code files to linker` error. Fix #52807
1 parent cd26529 commit ab9b2fe

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

clang/lib/Driver/ToolChains/BareMetal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class LLVM_LIBRARY_VISIBILITY BareMetal : public ToolChain {
3737
bool useIntegratedAs() const override { return true; }
3838
bool isBareMetal() const override { return true; }
3939
bool isCrossCompiling() const override { return true; }
40+
bool HasNativeLLVMSupport() const override { return true; }
4041
bool isPICDefault() const override { return false; }
4142
bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
4243
return false;

clang/test/Driver/native-llvm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33

44
// RUN: %clang -### -flto -target x86_64-unknown-unknown %s 2>&1 | FileCheck %s
55
// CHECK: error: {{.*}} unable to pass LLVM bit-code files to linker
6+
7+
// RUN: %clang -### -flto --target=arm-none-eabi %s 2>&1 | FileCheck /dev/null --implicit-check-not=error:

0 commit comments

Comments
 (0)