Skip to content

Commit 92cbac4

Browse files
dmakarovLucasSte
authored andcommitted
[SOL] switch to new SBF LLVM backend
1 parent cefe3a4 commit 92cbac4

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ extern "C" void LLVMRustTimeTraceProfilerFinish(const char *FileName) {
175175
#define SUBTARGET_BPF
176176
#endif
177177

178+
#ifdef LLVM_COMPONENT_SBF
179+
#define SUBTARGET_SBF SUBTARGET(SBF)
180+
#else
181+
#define SUBTARGET_SBF
182+
#endif
183+
178184
#define GEN_SUBTARGETS \
179185
SUBTARGET_X86 \
180186
SUBTARGET_ARM \
@@ -192,6 +198,7 @@ extern "C" void LLVMRustTimeTraceProfilerFinish(const char *FileName) {
192198
SUBTARGET_RISCV \
193199
SUBTARGET_LOONGARCH \
194200
SUBTARGET_BPF \
201+
SUBTARGET_SBF \
195202

196203
#define SUBTARGET(x) \
197204
namespace llvm { \

compiler/rustc_llvm/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ pub fn initialize_available_targets() {
250250
);
251251
init_target!(
252252
llvm_component = "sbf",
253-
LLVMInitializeBPFTargetInfo,
254-
LLVMInitializeBPFTarget,
255-
LLVMInitializeBPFTargetMC,
256-
LLVMInitializeBPFAsmPrinter,
257-
LLVMInitializeBPFAsmParser
253+
LLVMInitializeSBFTargetInfo,
254+
LLVMInitializeSBFTarget,
255+
LLVMInitializeSBFTargetMC,
256+
LLVMInitializeSBFAsmPrinter,
257+
LLVMInitializeSBFAsmParser
258258
);
259259
}

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ targets = "AArch64;X86"
6666
# not built by default and the experimental Rust compilation targets that depend
6767
# on them will not work unless the user opts in to building them. By default the
6868
# `WebAssembly`, `RISCV`, and `BPF` targets are enabled when compiling LLVM from scratch.
69-
experimental-targets = "BPF"
69+
experimental-targets = "BPF;SBF"
7070

7171
# Cap the number of parallel linker invocations when compiling LLVM.
7272
# This can be useful when building LLVM with debug info, which significantly

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl Step for Llvm {
311311
Some(s) => s,
312312
None => {
313313
"AArch64;AMDGPU;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;\
314-
Sparc;SystemZ;WebAssembly;X86"
314+
SBF;Sparc;SystemZ;WebAssembly;X86"
315315
}
316316
};
317317

src/ci/docker/host-x86_64/bpfel-unknown-unknown/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
2121

2222
RUN PATH="${HOME}/.cargo/bin:${PATH}" \
2323
cargo install --git https://github.com/solana-labs/cargo-run-sbf-tests.git \
24-
--rev 8b76e26ee3cddca60297847361b67603e4299209 \
24+
--rev 9d45e79cf11b2fdf0e3572d916fe058823c7c438 \
2525
--bin cargo-run-sbf-tests --root /usr/local
2626

2727
COPY scripts/sccache.sh /scripts/

0 commit comments

Comments
 (0)