From a6cfdd2b98c166b21a041ebdd43d7428c32a239e Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Wed, 11 Oct 2017 16:15:42 -0300 Subject: [PATCH 1/6] Add x86_64-unknown-linux-gnux32 target --- src/librustc_back/target/mod.rs | 1 + .../target/x86_64_unknown_linux_gnux32.rs | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/librustc_back/target/x86_64_unknown_linux_gnux32.rs diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 039e0153656..ee7a77ea6d8 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -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), diff --git a/src/librustc_back/target/x86_64_unknown_linux_gnux32.rs b/src/librustc_back/target/x86_64_unknown_linux_gnux32.rs new file mode 100644 index 00000000000..70382032836 --- /dev/null +++ b/src/librustc_back/target/x86_64_unknown_linux_gnux32.rs @@ -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 or the MIT license +// , 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, + }) +} From 03419c846af0dea71e38064223d5e51550350a61 Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Wed, 11 Oct 2017 21:29:46 -0300 Subject: [PATCH 2/6] Bump cc to 1.01 to include x86_64-unknown-linux-gnux32 support --- src/Cargo.lock | 36 ++++++++++----------- src/bootstrap/Cargo.toml | 2 +- src/liballoc_jemalloc/Cargo.toml | 2 +- src/libprofiler_builtins/Cargo.toml | 2 +- src/librustc_llvm/Cargo.toml | 2 +- src/librustc_trans/Cargo.toml | 2 +- src/librustdoc/Cargo.toml | 2 +- src/libstd/Cargo.toml | 2 +- src/rustc/compiler_builtins_shim/Cargo.toml | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 77e33855f23..30fc7ee8d8c 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -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.6 (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" diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 3f1d03b1872..bbbbf0e1915 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -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" diff --git a/src/liballoc_jemalloc/Cargo.toml b/src/liballoc_jemalloc/Cargo.toml index 4042c4d2d4e..6d7d83dd993 100644 --- a/src/liballoc_jemalloc/Cargo.toml +++ b/src/liballoc_jemalloc/Cargo.toml @@ -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 = [] diff --git a/src/libprofiler_builtins/Cargo.toml b/src/libprofiler_builtins/Cargo.toml index eb31f5730d1..04f456917b9 100644 --- a/src/libprofiler_builtins/Cargo.toml +++ b/src/libprofiler_builtins/Cargo.toml @@ -15,4 +15,4 @@ doc = false core = { path = "../libcore" } [build-dependencies] -cc = "1.0" +cc = "1.0.1" diff --git a/src/librustc_llvm/Cargo.toml b/src/librustc_llvm/Cargo.toml index de5add56b76..a9566c4bcac 100644 --- a/src/librustc_llvm/Cargo.toml +++ b/src/librustc_llvm/Cargo.toml @@ -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" diff --git a/src/librustc_trans/Cargo.toml b/src/librustc_trans/Cargo.toml index 482350d04b5..5b7879ea58e 100644 --- a/src/librustc_trans/Cargo.toml +++ b/src/librustc_trans/Cargo.toml @@ -32,4 +32,4 @@ syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } [target."cfg(windows)".dependencies] -cc = "1.0" +cc = "1.0.1" diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index b295b414a03..e168222058f 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -18,4 +18,4 @@ html-diff = "0.0.4" [build-dependencies] build_helper = { path = "../build_helper" } -cc = "1.0" +cc = "1.0.1" diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index fb276448ffa..c95287390b4 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -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 = [] diff --git a/src/rustc/compiler_builtins_shim/Cargo.toml b/src/rustc/compiler_builtins_shim/Cargo.toml index 886e239246d..608e5f5f36d 100644 --- a/src/rustc/compiler_builtins_shim/Cargo.toml +++ b/src/rustc/compiler_builtins_shim/Cargo.toml @@ -30,7 +30,7 @@ doctest = false core = { path = "../../libcore" } [build-dependencies] -cc = "1.0" +cc = "1.0.1" [features] c = [] From 0f427036c737666d16e1188f731199bd96750555 Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Wed, 11 Oct 2017 21:36:37 -0300 Subject: [PATCH 3/6] Add builder for x86_64-unknown-linux-gnux32 in cross2 --- src/ci/docker/cross2/Dockerfile | 1 + src/tools/build-manifest/src/main.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ci/docker/cross2/Dockerfile b/src/ci/docker/cross2/Dockerfile index f5fc06767ce..76690fd2e15 100644 --- a/src/ci/docker/cross2/Dockerfile +++ b/src/ci/docker/cross2/Dockerfile @@ -47,6 +47,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 diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index daeac35a017..8c1b130b116 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -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", From 986a7c2df9fd4c94713a43a44e1c59410cac41b9 Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Wed, 11 Oct 2017 21:39:42 -0300 Subject: [PATCH 4/6] Test x86_64-unknown-linux-gnux32 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 139f06ec570..bc88a8b2b9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,7 +116,7 @@ matrix: - env: IMAGE=cross DEPLOY=1 if: branch = auto - env: IMAGE=cross2 DEPLOY=1 - if: branch = auto + # if: branch = auto - env: IMAGE=dist-aarch64-linux DEPLOY=1 if: branch = auto - env: IMAGE=dist-android DEPLOY=1 From 1a2ce7d51a1dd48a4adcfc698595ea4586399d6d Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Wed, 11 Oct 2017 23:17:50 -0300 Subject: [PATCH 5/6] Add gcc-multilib to cross2 --- src/ci/docker/cross2/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ci/docker/cross2/Dockerfile b/src/ci/docker/cross2/Dockerfile index 76690fd2e15..58932c51aec 100644 --- a/src/ci/docker/cross2/Dockerfile +++ b/src/ci/docker/cross2/Dockerfile @@ -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 \ From 7199feea9d480d44e1f5dac9342cc9951f20e6ad Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Thu, 12 Oct 2017 06:59:14 -0300 Subject: [PATCH 6/6] Revert "Test x86_64-unknown-linux-gnux32" --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bc88a8b2b9c..139f06ec570 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,7 +116,7 @@ matrix: - env: IMAGE=cross DEPLOY=1 if: branch = auto - env: IMAGE=cross2 DEPLOY=1 - # if: branch = auto + if: branch = auto - env: IMAGE=dist-aarch64-linux DEPLOY=1 if: branch = auto - env: IMAGE=dist-android DEPLOY=1