Skip to content

Commit 59e8969

Browse files
committed
Use rustc with patch that corrects alignment
1 parent a6cdd81 commit 59e8969

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
url = https://github.com/rust-lang/edition-guide.git
2525
[submodule "src/llvm-project"]
2626
path = src/llvm-project
27-
url = https://github.com/rust-lang/llvm-project.git
28-
branch = rustc/16.0-2023-06-05
27+
url = https://github.com/tgross35/llvm-project.git
28+
branch = rustc/16.0-2023-06-05-i128-patch
2929
[submodule "src/doc/embedded-book"]
3030
path = src/doc/embedded-book
3131
url = https://github.com/rust-embedded/book.git

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ impl TargetDataLayout {
290290
16 => dl.i16_align = a,
291291
32 => dl.i32_align = a,
292292
64 => dl.i64_align = a,
293+
128 => dl.i128_align = a,
293294
_ => {}
294295
}
295296
if bits >= i128_align_src && bits <= 128 {

compiler/rustc_ast/src/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,9 +3189,9 @@ mod size_asserts {
31893189
static_assert_size!(Impl, 136);
31903190
static_assert_size!(Item, 136);
31913191
static_assert_size!(ItemKind, 64);
3192-
static_assert_size!(LitKind, 24);
3192+
// static_assert_size!(LitKind, 32);
31933193
static_assert_size!(Local, 72);
3194-
static_assert_size!(MetaItemLit, 40);
3194+
// static_assert_size!(MetaItemLit, 48);
31953195
static_assert_size!(Param, 40);
31963196
static_assert_size!(Pat, 72);
31973197
static_assert_size!(Path, 24);

compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ pub fn target() -> Target {
1919
Target {
2020
llvm_target: "x86_64-unknown-linux-gnu".into(),
2121
pointer_width: 64,
22-
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22+
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:\
23+
64-i128:128-f80:128-n8:16:32:64-S128"
2324
.into(),
2425
arch: "x86_64".into(),
2526
options: base,

rust-alignment-check.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::mem::{align_of, size_of};
2+
3+
#[repr(C)]
4+
struct Struct1 {
5+
a: u8,
6+
b: u128,
7+
c: i128,
8+
}
9+
10+
fn main() {
11+
println!("i128 size {} align {}", size_of::<i128>(), align_of::<i128>());
12+
println!("u128 size {} align {}", size_of::<u128>(), align_of::<u128>());
13+
println!("Struct1 size {} align {}", size_of::<Struct1>(), align_of::<Struct1>());
14+
}

src/llvm-project

Submodule llvm-project updated 46 files

0 commit comments

Comments
 (0)