Skip to content

Commit 8c4954b

Browse files
committed
put m32/m64 always to gcc/clang
1 parent 0d082a2 commit 8c4954b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/lib.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,16 @@ impl Build {
18081808
family.add_force_frame_pointer(cmd);
18091809
}
18101810

1811+
if !cmd.is_like_msvc() {
1812+
if target.contains("i686") || target.contains("i586") {
1813+
cmd.args.push("-m32".into());
1814+
} else if target == "x86_64-unknown-linux-gnux32" {
1815+
cmd.args.push("-mx32".into());
1816+
} else if target.contains("x86_64") || target.contains("powerpc64") {
1817+
cmd.args.push("-m64".into());
1818+
}
1819+
}
1820+
18111821
// Target flags
18121822
match cmd.family {
18131823
ToolFamily::Clang => {
@@ -1937,14 +1947,6 @@ impl Build {
19371947
}
19381948
}
19391949
ToolFamily::Gnu => {
1940-
if target.contains("i686") || target.contains("i586") {
1941-
cmd.args.push("-m32".into());
1942-
} else if target == "x86_64-unknown-linux-gnux32" {
1943-
cmd.args.push("-mx32".into());
1944-
} else if target.contains("x86_64") || target.contains("powerpc64") {
1945-
cmd.args.push("-m64".into());
1946-
}
1947-
19481950
if target.contains("darwin") {
19491951
if let Some(arch) = map_darwin_target_from_rust_to_compiler_architecture(target)
19501952
{

0 commit comments

Comments
 (0)