diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 8848ea3bb9aee..ae9fab71f663e 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -145,8 +145,10 @@ pub unsafe fn create_module<'ll>( let llvm_version = llvm_util::get_version(); if llvm_version < (16, 0, 0) { if sess.target.arch == "s390x" { + // See https://reviews.llvm.org/D131158 target_data_layout = target_data_layout.replace("-v128:64", ""); } else if sess.target.arch == "riscv64" { + // See https://reviews.llvm.org/D116735 target_data_layout = target_data_layout.replace("-n32:64-", "-n64-"); } }