about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/messages.ftl
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2024-01-17 14:26:26 +0000
committerDavid Wood <david.wood@huawei.com>2024-01-18 10:46:03 +0000
commit46652dd254bc9c413d14cec637c7f21ac6601e05 (patch)
tree9426aea9adef75c13f89cdbcb1857df6cb8b365f /compiler/rustc_codegen_llvm/messages.ftl
parentc485ee71477a29041895c47cc441b364670f3772 (diff)
downloadrust-46652dd254bc9c413d14cec637c7f21ac6601e05.tar.gz
rust-46652dd254bc9c413d14cec637c7f21ac6601e05.zip
llvm: simplify data layout check
Don't skip the inconsistent data layout check for custom LLVMs.

With #118708, all targets will have a simple test that would trigger this
check if LLVM's data layouts do change - so data layouts would be
corrected during the LLVM upgrade. Therefore, with builtin targets, this
check won't trigger with our LLVM because each target will have been
confirmed to work. With non-builtin targets, this check is probably
useful to have because you can change the data layout in your target and
if its wrong then that could lead to bugs.

When using a custom LLVM, the same justification makes sense for
non-builtin targets as with our LLVM, the user can update their target to
match their LLVM and that's probably a good thing to do. However, with
a custom LLVM, the user cannot change the builtin target data layouts if
they don't match - though given that the compiler's data layout is used
for layout computation and a bunch of other things - you could get some
bugs because of the mismatch and probably want to know about that.

`CFG_LLVM_ROOT` was also always set during local development with
`download-ci-llvm` so this bug would never trigger locally.

Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'compiler/rustc_codegen_llvm/messages.ftl')
-rw-r--r--compiler/rustc_codegen_llvm/messages.ftl3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/messages.ftl b/compiler/rustc_codegen_llvm/messages.ftl
index 7a86ddc7556..d5bc04f594d 100644
--- a/compiler/rustc_codegen_llvm/messages.ftl
+++ b/compiler/rustc_codegen_llvm/messages.ftl
@@ -39,6 +39,9 @@ codegen_llvm_lto_dylib = lto cannot be used for `dylib` crate type without `-Zdy
 
 codegen_llvm_lto_proc_macro = lto cannot be used for `proc-macro` crate type without `-Zdylib-lto`
 
+codegen_llvm_mismatch_data_layout =
+    data-layout for target `{$rustc_target}`, `{$rustc_layout}`, differs from LLVM target's `{$llvm_target}` default layout, `{$llvm_layout}`
+
 codegen_llvm_missing_features =
     add the missing features in a `target_feature` attribute