Auto merge of - malbarbo:x32, r=alexcrichton

Add x86_64-unknown-linux-gnux32 target

This adds X32 ABI support for Linux on X86_64. Let's package and dist it so we can star testing libc, libstd, etc.

Fixes https://github.com/rust-lang/rfcs/issues/1339
This commit is contained in:
bors 2017-10-15 06:12:13 +00:00
commit 6c0d50f9fa
13 changed files with 65 additions and 26 deletions
src
Cargo.lock
bootstrap
ci/docker/cross2
liballoc_jemalloc
libprofiler_builtins
librustc_back/target
librustc_llvm
librustc_trans
librustdoc
libstd
rustc/compiler_builtins_shim
tools/build-manifest/src

36
src/Cargo.lock generated
View File

@ -42,7 +42,7 @@ dependencies = [
"alloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
"libc 0.0.0",
]
@ -99,7 +99,7 @@ name = "backtrace-sys"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -136,7 +136,7 @@ name = "bootstrap"
version = "0.0.0"
dependencies = [
"build_helper 0.1.0",
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -246,7 +246,7 @@ version = "0.1.0"
[[package]]
name = "cc"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -275,7 +275,7 @@ name = "cmake"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -290,7 +290,7 @@ dependencies = [
name = "compiler_builtins"
version = "0.0.0"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]
@ -407,7 +407,7 @@ name = "curl-sys"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -833,7 +833,7 @@ name = "libgit2-sys"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
"curl-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
@ -860,7 +860,7 @@ name = "libz-sys"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -880,7 +880,7 @@ name = "lzma-sys"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -968,7 +968,7 @@ name = "miniz-sys"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1104,7 +1104,7 @@ name = "openssl-sys"
version = "0.9.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1208,7 +1208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "profiler_builtins"
version = "0.0.0"
dependencies = [
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core 0.0.0",
]
@ -1623,7 +1623,7 @@ version = "0.0.0"
dependencies = [
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"build_helper 0.1.0",
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_cratesio_shim 0.0.0",
]
@ -1755,7 +1755,7 @@ name = "rustc_trans"
version = "0.0.0"
dependencies = [
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"jobserver 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1824,7 +1824,7 @@ name = "rustdoc"
version = "0.0.0"
dependencies = [
"build_helper 0.1.0",
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"html-diff 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1994,7 +1994,7 @@ dependencies = [
"alloc_jemalloc 0.0.0",
"alloc_system 0.0.0",
"build_helper 0.1.0",
"cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"collections 0.0.0",
"compiler_builtins 0.0.0",
"core 0.0.0",
@ -2485,7 +2485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5cde24d1b2e2216a726368b2363a273739c91f4e3eb4e0dd12d672d396ad989"
"checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32"
"checksum cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7db2f146208d7e0fbee761b09cd65a7f51ccc38705d4e7262dad4d73b12a76b1"
"checksum cc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c674f0870e3dbd4105184ea035acb1c32c8ae69939c9e228d2b11bbfe29efad"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3451e409013178663435d6f15fdb212f14ee4424a3d74f979d081d0a66b6f1f2"
"checksum cmake 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "357c07e7a1fc95732793c1edb5901e1a1f305cfcf63a90eb12dbd22bdb6b789d"

View File

@ -34,7 +34,7 @@ cmake = "0.1.23"
filetime = "0.1"
num_cpus = "1.0"
getopts = "0.2"
cc = "1.0"
cc = "1.0.1"
libc = "0.2"
serde = "1.0.8"
serde_derive = "1.0.8"

View File

@ -5,6 +5,7 @@ RUN sh /scripts/cross-apt-packages.sh
RUN apt-get build-dep -y clang llvm && apt-get install -y --no-install-recommends \
build-essential \
gcc-multilib \
libedit-dev \
libgmp-dev \
libisl-dev \
@ -47,6 +48,7 @@ ENV TARGETS=x86_64-unknown-fuchsia
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
ENV TARGETS=$TARGETS,x86_64-sun-solaris
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

View File

@ -19,7 +19,7 @@ libc = { path = "../rustc/libc_shim" }
[build-dependencies]
build_helper = { path = "../build_helper" }
cc = "1.0"
cc = "1.0.1"
[features]
debug = []

View File

@ -15,4 +15,4 @@ doc = false
core = { path = "../libcore" }
[build-dependencies]
cc = "1.0"
cc = "1.0.1"

View File

@ -135,6 +135,7 @@ macro_rules! supported_targets {
supported_targets! {
("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32),
("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
("mips-unknown-linux-gnu", mips_unknown_linux_gnu),

View File

@ -0,0 +1,35 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use LinkerFlavor;
use target::{Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::linux_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string());
base.stack_probes = true;
base.has_elf_tls = false;
Ok(Target {
llvm_target: "x86_64-unknown-linux-gnux32".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128".to_string(),
arch: "x86_64".to_string(),
target_os: "linux".to_string(),
target_env: "gnu".to_string(),
target_vendor: "unknown".to_string(),
linker_flavor: LinkerFlavor::Gcc,
options: base,
})
}

View File

@ -18,4 +18,4 @@ rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
[build-dependencies]
build_helper = { path = "../build_helper" }
cc = "1.0"
cc = "1.0.1"

View File

@ -32,4 +32,4 @@ syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
[target."cfg(windows)".dependencies]
cc = "1.0"
cc = "1.0.1"

View File

@ -18,4 +18,4 @@ html-diff = "0.0.4"
[build-dependencies]
build_helper = { path = "../build_helper" }
cc = "1.0"
cc = "1.0.1"

View File

@ -36,7 +36,7 @@ rustc_tsan = { path = "../librustc_tsan" }
[build-dependencies]
build_helper = { path = "../build_helper" }
cc = "1.0"
cc = "1.0.1"
[features]
backtrace = []

View File

@ -30,7 +30,7 @@ doctest = false
core = { path = "../../libcore" }
[build-dependencies]
cc = "1.0"
cc = "1.0.1"
[features]
c = []

View File

@ -95,6 +95,7 @@ static TARGETS: &'static [&'static str] = &[
"x86_64-unknown-freebsd",
"x86_64-unknown-fuchsia",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-gnux32",
"x86_64-unknown-linux-musl",
"x86_64-unknown-netbsd",
"x86_64-unknown-redox",