Skip to content

Commit

Permalink
Auto merge of #36764 - jonathandturner:rollup, r=jonathandturner
Browse files Browse the repository at this point in the history
Rollup of 14 pull requests

- Successful merges: #36563, #36574, #36586, #36662, #36663, #36669, #36676, #36721, #36723, #36727, #36729, #36742, #36754, #36756
- Failed merges:
  • Loading branch information
bors authored Sep 27, 2016
2 parents d0623cf + e832762 commit ec7679b
Show file tree
Hide file tree
Showing 68 changed files with 1,710 additions and 1,061 deletions.
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ case $CFG_OSTYPE in
CFG_CPUTYPE=$(isainfo -n)
;;

Haiku)
CFG_OSTYPE=unknown-haiku
;;

MINGW*)
# msys' `uname` does not print gcc configuration, but prints msys
# configuration. so we cannot believe `uname -m`:
Expand Down Expand Up @@ -532,6 +536,10 @@ case $CFG_CPUTYPE in
CFG_CPUTYPE=x86_64
;;

BePC)
CFG_CPUTYPE=i686
;;

*)
err "unknown CPU type: $CFG_CPUTYPE"
esac
Expand Down
27 changes: 27 additions & 0 deletions mk/cfg/i686-unknown-haiku.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# i686-unknown-haiku configuration
CROSS_PREFIX_i686-unknown-haiku=i586-pc-haiku-
CC_i686-unknown-haiku=$(CC)
CXX_i686-unknown-haiku=$(CXX)
CPP_i686-unknown-haiku=$(CPP)
AR_i686-unknown-haiku=$(AR)
CFG_LIB_NAME_i686-unknown-haiku=lib$(1).so
CFG_STATIC_LIB_NAME_i686-unknown-haiku=lib$(1).a
CFG_LIB_GLOB_i686-unknown-haiku=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i686-unknown-haiku=lib$(1)-*.dylib.dSYM
CFG_CFLAGS_i686-unknown-haiku := -m32 $(CFLAGS)
CFG_GCCISH_CFLAGS_i686-unknown-haiku := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
CFG_GCCISH_CXXFLAGS_i686-unknown-haiku := -fno-rtti $(CXXFLAGS)
CFG_GCCISH_LINK_FLAGS_i686-unknown-haiku := -shared -fPIC -ldl -pthread -lrt -g -m32
CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-haiku := -Wl,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-haiku := -Wl,-no-whole-archive
CFG_DEF_SUFFIX_i686-unknown-haiku := .linux.def
CFG_LLC_FLAGS_i686-unknown-haiku :=
CFG_INSTALL_NAME_i686-unknown-haiku =
CFG_EXE_SUFFIX_i686-unknown-haiku =
CFG_WINDOWSY_i686-unknown-haiku :=
CFG_UNIXY_i686-unknown-haiku := 1
CFG_PATH_MUNGE_i686-unknown-haiku := true
CFG_LDPATH_i686-unknown-haiku :=
CFG_RUN_i686-unknown-haiku=$(2)
CFG_RUN_TARG_i686-unknown-haiku=$(call CFG_RUN_i686-unknown-haiku,,$(2))
CFG_GNU_TRIPLE_i686-unknown-haiku := i686-unknown-haiku
27 changes: 27 additions & 0 deletions mk/cfg/x86_64-unknown-haiku.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# x86_64-unknown-haiku configuration
CROSS_PREFIX_x86_64-unknown-haiku=x86_64-unknown-haiku-
CC_x86_64-unknown-haiku=$(CC)
CXX_x86_64-unknown-haiku=$(CXX)
CPP_x86_64-unknown-haiku=$(CPP)
AR_x86_64-unknown-haiku=$(AR)
CFG_LIB_NAME_x86_64-unknown-haiku=lib$(1).so
CFG_STATIC_LIB_NAME_x86_64-unknown-haiku=lib$(1).a
CFG_LIB_GLOB_x86_64-unknown-haiku=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_x86_64-unknown-haiku=lib$(1)-*.dylib.dSYM
CFG_CFLAGS_x86_64-unknown-haiku := -m64 $(CFLAGS)
CFG_GCCISH_CFLAGS_x86_64-unknown-haiku := -Wall -Werror -g -fPIC -m64 $(CFLAGS)
CFG_GCCISH_CXXFLAGS_x86_64-unknown-haiku := -fno-rtti $(CXXFLAGS)
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-haiku := -shared -fPIC -ldl -pthread -lrt -g -m64
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-haiku := -Wl,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-haiku := -Wl,-no-whole-archive
CFG_DEF_SUFFIX_x86_64-unknown-haiku := .linux.def
CFG_LLC_FLAGS_x86_64-unknown-haiku :=
CFG_INSTALL_NAME_x86_64-unknown-haiku =
CFG_EXE_SUFFIX_x86_64-unknown-haiku =
CFG_WINDOWSY_x86_64-unknown-haiku :=
CFG_UNIXY_x86_64-unknown-haiku := 1
CFG_PATH_MUNGE_x86_64-unknown-haiku := true
CFG_LDPATH_x86_64-unknown-haiku :=
CFG_RUN_x86_64-unknown-haiku=$(2)
CFG_RUN_TARG_x86_64-unknown-haiku=$(call CFG_RUN_x86_64-unknown-haiku,,$(2))
CFG_GNU_TRIPLE_x86_64-unknown-haiku := x86_64-unknown-haiku
4 changes: 4 additions & 0 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,14 @@ ifeq ($$(OSTYPE_$(3)),apple-darwin)
else
ifeq ($$(CFG_WINDOWSY_$(3)),1)
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := PATH
else
ifeq ($$(OSTYPE_$(3)),unknown-haiku)
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LIBRARY_PATH
else
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LD_LIBRARY_PATH
endif
endif
endif

LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3) := \
$$(CURDIR)/$$(HLIB$(1)_H_$(3)):$$(CFG_LLVM_INST_DIR_$(3))/lib
Expand Down
9 changes: 8 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,14 @@ impl Build {
// Almost all of these are simple one-liners that shell out to the
// corresponding functionality in the extra modules, where more
// documentation can be found.
for target in step::all(self) {
let steps = step::all(self);

self.verbose("bootstrap build plan:");
for step in &steps {
self.verbose(&format!("{:?}", step));
}

for target in steps {
let doc_out = self.out.join(&target.target).join("doc");
match target.src {
Llvm { _dummy } => {
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ targets!(define_source);
/// into a topologically sorted list which when executed left-to-right will
/// correctly sequence the entire build.
pub fn all(build: &Build) -> Vec<Step> {
build.verbose("inferred build steps:");

let mut ret = Vec::new();
let mut all = HashSet::new();
for target in top_level(build) {
Expand All @@ -184,6 +186,7 @@ pub fn all(build: &Build) -> Vec<Step> {
set: &mut HashSet<Step<'a>>) {
if set.insert(target.clone()) {
for dep in target.deps(build) {
build.verbose(&format!("{:?}\n -> {:?}", target, dep));
fill(build, &dep, ret, set);
}
ret.push(target.clone());
Expand Down
11 changes: 6 additions & 5 deletions src/doc/book/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,13 @@ $ cd hello_world
## Writing and Running a Rust Program

Next, make a new source file and call it *main.rs*. Rust files always end
in a *.rs* extension. If you’re using more than one word in your filename, use
an underscore to separate them; for example, you'd use *hello_world.rs* rather
than *helloworld.rs*.
We need to create a source file for our Rust program. Rust files always end
in a *.rs* extension. If you are using more than one word in your filename,
use an underscore to separate them; for example, you would use
*my_program.rs* rather than *myprogram.rs*.

Now open the *main.rs* file you just created, and type the following code:
Now, make a new file and call it *main.rs*. Open the file and type
the following code:

```rust
fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/etc/local_stage0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LIB_PREFIX=lib

OS=`uname -s`
case $OS in
("Linux"|"FreeBSD"|"DragonFly"|"Bitrig"|"OpenBSD"|"SunOS")
("Linux"|"FreeBSD"|"DragonFly"|"Bitrig"|"OpenBSD"|"SunOS"|"Haiku")
BIN_SUF=
LIB_SUF=.so
;;
Expand Down
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 38 files
+1 −1 Cargo.toml
+1 −1 ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/x86_64-unknown-freebsd/Dockerfile
+1 −1 ci/docker/x86_64-unknown-openbsd/Dockerfile
+1 −4 ci/run-qemu.sh
+16 −4 ci/run.sh
+4 −4 libc-test/Cargo.lock
+3 −1 libc-test/build.rs
+63 −29 src/unix/bsd/apple/mod.rs
+50 −0 src/unix/bsd/freebsdlike/dragonfly/mod.rs
+53 −0 src/unix/bsd/freebsdlike/freebsd/mod.rs
+21 −6 src/unix/bsd/freebsdlike/mod.rs
+2 −29 src/unix/bsd/mod.rs
+5 −7 src/unix/bsd/netbsdlike/mod.rs
+40 −12 src/unix/bsd/netbsdlike/netbsd.rs
+75 −0 src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs
+71 −34 src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+28 −0 src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
+0 −437 src/unix/bsd/openbsdlike/bitrig.rs
+4 −0 src/unix/mod.rs
+61 −0 src/unix/notbsd/android/mod.rs
+26 −0 src/unix/notbsd/linux/mips.rs
+14 −0 src/unix/notbsd/linux/mips64.rs
+34 −1 src/unix/notbsd/linux/mod.rs
+17 −0 src/unix/notbsd/linux/musl/b32/arm.rs
+17 −0 src/unix/notbsd/linux/musl/b32/asmjs.rs
+26 −0 src/unix/notbsd/linux/musl/b32/mips.rs
+17 −0 src/unix/notbsd/linux/musl/b32/x86.rs
+14 −0 src/unix/notbsd/linux/musl/b64/mod.rs
+17 −0 src/unix/notbsd/linux/other/b32/arm.rs
+17 −0 src/unix/notbsd/linux/other/b32/powerpc.rs
+17 −0 src/unix/notbsd/linux/other/b32/x86.rs
+3 −4 src/unix/notbsd/linux/other/b64/aarch64.rs
+14 −0 src/unix/notbsd/linux/other/b64/mod.rs
+63 −0 src/unix/notbsd/linux/other/mod.rs
+3 −0 src/unix/notbsd/mod.rs
+2 −0 src/unix/solaris/mod.rs
+41 −0 src/windows.rs
9 changes: 7 additions & 2 deletions src/librustc/middle/intrinsicck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,16 @@ impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> {
}
};

span_err!(self.infcx.tcx.sess, span, E0512,
struct_span_err!(self.infcx.tcx.sess, span, E0512,
"transmute called with differently sized types: \
{} ({}) to {} ({})",
from, skeleton_string(from, sk_from),
to, skeleton_string(to, sk_to));
to, skeleton_string(to, sk_to))
.span_label(span,
&format!("transmuting between {} and {}",
skeleton_string(from, sk_from),
skeleton_string(to, sk_to)))
.emit();
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ macro_rules! options {
pub const parse_opt_bool: Option<&'static str> =
Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`");
pub const parse_string: Option<&'static str> = Some("a string");
pub const parse_string_push: Option<&'static str> = Some("a string");
pub const parse_opt_string: Option<&'static str> = Some("a string");
pub const parse_list: Option<&'static str> = Some("a space-separated list of strings");
pub const parse_opt_list: Option<&'static str> = Some("a space-separated list of strings");
Expand Down Expand Up @@ -667,6 +668,13 @@ macro_rules! options {
}
}

fn parse_string_push(slot: &mut Vec<String>, v: Option<&str>) -> bool {
match v {
Some(s) => { slot.push(s.to_string()); true },
None => false,
}
}

fn parse_list(slot: &mut Vec<String>, v: Option<&str>)
-> bool {
match v {
Expand Down Expand Up @@ -742,6 +750,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
"tool to assemble archives with"),
linker: Option<String> = (None, parse_opt_string, [UNTRACKED],
"system linker to link outputs with"),
link_arg: Vec<String> = (vec![], parse_string_push, [UNTRACKED],
"a single extra argument to pass to the linker (can be used several times)"),
link_args: Option<Vec<String>> = (None, parse_opt_list, [UNTRACKED],
"extra arguments to pass to the linker (space separated)"),
link_dead_code: bool = (false, parse_bool, [UNTRACKED],
Expand Down
23 changes: 23 additions & 0 deletions src/librustc_back/target/haiku_base.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2014-2015 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 target::TargetOptions;
use std::default::Default;

pub fn opts() -> TargetOptions {
TargetOptions {
linker: "cc".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: true,
linker_is_gnu: true,
.. Default::default()
}
}
30 changes: 30 additions & 0 deletions src/librustc_back/target/i686_unknown_haiku.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2014 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 target::{Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::haiku_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m32".to_string());

Ok(Target {
llvm_target: "i686-unknown-haiku".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
arch: "x86".to_string(),
target_os: "haiku".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: base,
})
}
4 changes: 4 additions & 0 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mod apple_ios_base;
mod bitrig_base;
mod dragonfly_base;
mod freebsd_base;
mod haiku_base;
mod linux_base;
mod linux_musl_base;
mod openbsd_base;
Expand Down Expand Up @@ -165,6 +166,9 @@ supported_targets! {
("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),

("i686_unknown_haiku", i686_unknown_haiku),
("x86_64_unknown_haiku", x86_64_unknown_haiku),

("x86_64-apple-darwin", x86_64_apple_darwin),
("i686-apple-darwin", i686_apple_darwin),

Expand Down
30 changes: 30 additions & 0 deletions src/librustc_back/target/x86_64_unknown_haiku.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2014 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 target::{Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::haiku_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m64".to_string());

Ok(Target {
llvm_target: "x86_64-unknown-haiku".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
arch: "x86_64".to_string(),
target_os: "haiku".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: base,
})
}
21 changes: 21 additions & 0 deletions src/librustc_data_structures/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,27 @@ mod imp {
pub const F_SETLKW: libc::c_int = 9;
}

#[cfg(target_os = "haiku")]
mod os {
use libc;

pub struct flock {
pub l_type: libc::c_short,
pub l_whence: libc::c_short,
pub l_start: libc::off_t,
pub l_len: libc::off_t,
pub l_pid: libc::pid_t,

// not actually here, but brings in line with freebsd
pub l_sysid: libc::c_int,
}

pub const F_UNLCK: libc::c_short = 0x0200;
pub const F_WRLCK: libc::c_short = 0x0400;
pub const F_SETLK: libc::c_int = 0x0080;
pub const F_SETLKW: libc::c_int = 0x0100;
}

#[cfg(any(target_os = "macos", target_os = "ios"))]
mod os {
use libc;
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ fn link_args(cmd: &mut Linker,
let empty_vec = Vec::new();
let empty_str = String::new();
let args = sess.opts.cg.link_args.as_ref().unwrap_or(&empty_vec);
let mut args = args.iter().chain(used_link_args.iter());
let more_args = &sess.opts.cg.link_arg;
let mut args = args.iter().chain(more_args.iter()).chain(used_link_args.iter());
let relocation_model = sess.opts.cg.relocation_model.as_ref()
.unwrap_or(&empty_str);
if (t.options.relocation_model == "pic" || *relocation_model == "pic")
Expand Down Expand Up @@ -844,6 +845,7 @@ fn link_args(cmd: &mut Linker,
if let Some(ref args) = sess.opts.cg.link_args {
cmd.args(args);
}
cmd.args(&sess.opts.cg.link_arg);
cmd.args(&used_link_args);
}

Expand Down
8 changes: 5 additions & 3 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,9 +1525,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
match self.locals.borrow().get(&nid) {
Some(&t) => t,
None => {
span_err!(self.tcx.sess, span, E0513,
"no type for local variable {}",
nid);
struct_span_err!(self.tcx.sess, span, E0513,
"no type for local variable {}",
self.tcx.map.node_to_string(nid))
.span_label(span, &"no type for variable")
.emit();
self.tcx.types.err
}
}
Expand Down
Loading

0 comments on commit ec7679b

Please sign in to comment.