Skip to content

Commit 0defa20

Browse files
committedOct 1, 2017
Auto merge of #44906 - dkl:main-signature, r=nagisa
Fix native main() signature on 64bit Hello, in LLVM-IR produced by rustc on x86_64-linux-gnu, the native main() function had incorrect types for the function result and argc parameter: i64, while it should be i32 (really c_int). See also #20064, #29633. So I've attempted a fix here. I tested it by checking the LLVM IR produced with --target x86_64-unknown-linux-gnu and i686-unknown-linux-gnu. Also I tried running the tests (`./x.py test`), however I'm getting two failures with and without the patch, which I'm guessing is unrelated.
2 parents 1c09315 + a4e8373 commit 0defa20

File tree

79 files changed

+153
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+153
-6
lines changed
 

‎src/librustc_back/target/aarch64_apple_ios.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub fn target() -> TargetResult {
1818
llvm_target: "arm64-apple-ios".to_string(),
1919
target_endian: "little".to_string(),
2020
target_pointer_width: "64".to_string(),
21+
target_c_int_width: "32".to_string(),
2122
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".to_string(),
2223
arch: "aarch64".to_string(),
2324
target_os: "ios".to_string(),

‎src/librustc_back/target/aarch64_linux_android.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub fn target() -> TargetResult {
2424
llvm_target: "aarch64-linux-android".to_string(),
2525
target_endian: "little".to_string(),
2626
target_pointer_width: "64".to_string(),
27+
target_c_int_width: "32".to_string(),
2728
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
2829
arch: "aarch64".to_string(),
2930
target_os: "android".to_string(),

0 commit comments

Comments
 (0)