diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2024-01-21 05:45:45 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2024-01-21 05:45:45 +0000 |
| commit | 3c055f73feade43ca73d47fce55d0add9cebd07f (patch) | |
| tree | 52dc53152f535fad994d8975e519e3c1942fc931 /compiler/rustc_codegen_llvm/src | |
| parent | 384b2ab37529ba0ad07ea8271baf0f212bab2e5a (diff) | |
| parent | 6d7e80c5bc3cc3b176834322afc50dc8dd100599 (diff) | |
| download | rust-3c055f73feade43ca73d47fce55d0add9cebd07f.tar.gz rust-3c055f73feade43ca73d47fce55d0add9cebd07f.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 1d1b6e6148d..f3b2caf9b80 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -145,6 +145,14 @@ pub unsafe fn create_module<'ll>( .replace("-Fi64", ""); } } + if llvm_version < (18, 0, 0) { + if sess.target.arch == "x86" || sess.target.arch == "x86_64" { + // LLVM 18 adjusts i128 to be 128-bit aligned on x86 variants. + // Earlier LLVMs leave this as default alignment, so remove it. + // See https://reviews.llvm.org/D86310 + target_data_layout = target_data_layout.replace("-i128:128", ""); + } + } // Ensure the data-layout values hardcoded remain the defaults. if sess.target.is_builtin { |
