diff options
| author | bors <bors@rust-lang.org> | 2023-08-07 21:37:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-07 21:37:42 +0000 |
| commit | 443c3161dd04f4c1b656a626f9079921bee9c326 (patch) | |
| tree | b3711b41ca4251bb1fd4d28bbd5c27ba3c8df691 /compiler/rustc_codegen_llvm/src | |
| parent | 03a119b0b0e310d22d94399b24ed030056050f13 (diff) | |
| parent | 78678336527cdbabaa41e5e92e6645ed712b4160 (diff) | |
| download | rust-443c3161dd04f4c1b656a626f9079921bee9c326.tar.gz rust-443c3161dd04f4c1b656a626f9079921bee9c326.zip | |
Auto merge of #114048 - nikic:llvm-17, r=cuviper
Update to LLVM 17 Expected LLVM 17.0.0 release date: Sep 5th Rust 1.73 release date: Oct 5th Compatibility changes in this PR: - Drop LLVM_RUSTLLVM check for target-cpu table, which no longer requires a patch with LLVM 17. - Update powerpc data layouts, which now include function alignment information. As usual, downgrade for older LLVM versions. - Adjust the stack-protector.rs test so that the stack smashing does not get optimized away. - Adjust path of crtbegin.c and crtend.c in compiler-rt. - Updated dist-riscv64-linux to use binutils 2.36 in order to recognize the zicsr feature, which is no longer part of the base ISA. - Fixed symlink for asm include directory on dist-various-2. We should use `/usr/include/x86_64-linux-gnu/asm` for the host, rather than `/usr/include/asm-generic`. Upstream patches: - [x] https://reviews.llvm.org/D156525 (backported) Perf run: https://perf.rust-lang.org/compare.html?start=f239bb6bea94d16d902c36d72b5cabdddefb3cab&end=8030d71a95a3ea79f5fc95232c32f9b78effb92d&stat=instructions:u Fixes #109671. Successful: dist-x86_64-linux, dist-aarch64-linux, dist-s390x-linux, dist-powerpc-linux, armhf-gnu, wasm32
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 2d23be6cd52..b4f7e20e05d 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -145,6 +145,17 @@ pub unsafe fn create_module<'ll>( target_data_layout = target_data_layout.replace("-n32:64-", "-n64-"); } } + if llvm_version < (17, 0, 0) { + if sess.target.arch.starts_with("powerpc") { + // LLVM 17 specifies function pointer alignment for ppc: + // https://reviews.llvm.org/D147016 + target_data_layout = target_data_layout + .replace("-Fn32", "") + .replace("-Fi32", "") + .replace("-Fn64", "") + .replace("-Fi64", ""); + } + } // Ensure the data-layout values hardcoded remain the defaults. if sess.target.is_builtin { |
