Skip to content

Commit b91a035

Browse files
committed
put m32/m64 always to gcc/clang
1 parent 57853c4 commit b91a035

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
@@ -1663,6 +1663,16 @@ impl Build {
16631663
family.add_force_frame_pointer(cmd);
16641664
}
16651665

1666+
if !cmd.is_like_msvc() {
1667+
if target.contains("i686") || target.contains("i586") {
1668+
cmd.args.push("-m32".into());
1669+
} else if target == "x86_64-unknown-linux-gnux32" {
1670+
cmd.args.push("-mx32".into());
1671+
} else if target.contains("x86_64") || target.contains("powerpc64") {
1672+
cmd.args.push("-m64".into());
1673+
}
1674+
}
1675+
16661676
// Target flags
16671677
match cmd.family {
16681678
ToolFamily::Clang => {
@@ -1792,14 +1802,6 @@ impl Build {
17921802
}
17931803
}
17941804
ToolFamily::Gnu => {
1795-
if target.contains("i686") || target.contains("i586") {
1796-
cmd.args.push("-m32".into());
1797-
} else if target == "x86_64-unknown-linux-gnux32" {
1798-
cmd.args.push("-mx32".into());
1799-
} else if target.contains("x86_64") || target.contains("powerpc64") {
1800-
cmd.args.push("-m64".into());
1801-
}
1802-
18031805
if target.contains("darwin") {
18041806
if let Some(arch) = map_darwin_target_from_rust_to_compiler_architecture(target)
18051807
{

0 commit comments

Comments
 (0)