Skip to content

Commit ba7003e

Browse files
committed
put m32/m64 always to gcc/clang
1 parent 53fb72c commit ba7003e

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
@@ -1563,6 +1563,16 @@ impl Build {
15631563
family.add_force_frame_pointer(cmd);
15641564
}
15651565

1566+
if !cmd.is_like_msvc() {
1567+
if target.contains("i686") || target.contains("i586") {
1568+
cmd.args.push("-m32".into());
1569+
} else if target == "x86_64-unknown-linux-gnux32" {
1570+
cmd.args.push("-mx32".into());
1571+
} else if target.contains("x86_64") || target.contains("powerpc64") {
1572+
cmd.args.push("-m64".into());
1573+
}
1574+
}
1575+
15661576
// Target flags
15671577
match cmd.family {
15681578
ToolFamily::Clang => {
@@ -1668,14 +1678,6 @@ impl Build {
16681678
}
16691679
}
16701680
ToolFamily::Gnu => {
1671-
if target.contains("i686") || target.contains("i586") {
1672-
cmd.args.push("-m32".into());
1673-
} else if target == "x86_64-unknown-linux-gnux32" {
1674-
cmd.args.push("-mx32".into());
1675-
} else if target.contains("x86_64") || target.contains("powerpc64") {
1676-
cmd.args.push("-m64".into());
1677-
}
1678-
16791681
if target.contains("darwin") {
16801682
if let Some(arch) = map_darwin_target_from_rust_to_compiler_architecture(target)
16811683
{

0 commit comments

Comments
 (0)