Merge branch 'master' into staging

This commit is contained in:
Luca Bruno
2014-11-10 10:03:52 +01:00
96 changed files with 1773 additions and 516 deletions

View File

@@ -0,0 +1,28 @@
{ stdenv, fetchurl, bash, makeWrapper, coreutils, emacs, tcl, tk, boost, gmp, cacert }:
let
version = "2.0.0";
in
stdenv.mkDerivation {
name = "mozart-binary-${version}";
src = fetchurl {
url = "http://sourceforge.net/projects/mozart-oz/files/v${version}-alpha.0/mozart2-${version}-alpha.0+build.4105.5c06ced-x86_64-linux.tar.gz";
sha256 = "0rsfrjimjxqbwprpzzlmydl3z3aiwg5qkb052jixdxjyad7gyh5z";
};
libPath = stdenv.lib.makeLibraryPath
[stdenv.gcc.gcc emacs tk tcl boost gmp];
builder = ./builder.sh;
buildInputs = [ makeWrapper ];
meta = with stdenv.lib; {
homepage = "http://www.mozart-oz.org/";
description = "The Mozart Programming System combines ongoing research in programming language design and implementation, constraint logic programming, distributed computing, and human-computer interfaces. Mozart implements the Oz language and provides both expressive power and advanced functionality.";
license = licenses.mit;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,24 @@
source $stdenv/setup
echo "unpacking $src..."
tar xvfz $src
mkdir -p $out/bin
mkdir -p $out/share
mv mozart*linux/bin/* $out/bin
mv mozart*linux/share/* $out/share
patchShebangs $out
for f in $out/bin/*; do
b=$(basename $f)
if [ $b == "ozemulator" ] || [ $b == "ozwish" ]; then
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath $libPath \
$f
continue;
fi
wrapProgram $f \
--set OZHOME $out
done

View File

@@ -1,14 +0,0 @@
{stdenv, fetchurl, flex, bison, perl, gmp, zlib, tcl, tk, gdbm, m4, x11, emacs}:
stdenv.mkDerivation {
name = "mozart-1.4.0";
src = fetchurl {
url = http://www.mozart-oz.org/download/mozart-ftp/store/1.4.0-2008-07-02-tar/mozart-1.4.0.20080704-src.tar.gz;
sha256 = "5da73d80b5aa7fa42edca64159a1a076323f090e5c548f3747f94d0afc60b223";
};
buildInputs = [flex bison perl gmp zlib tcl tk gdbm m4 x11 emacs];
# micq gives a compile error for me
configureFlags = "--with-tcl=${tcl}/lib --with-tk=${tk}/lib --disable-contrib-micq";
}

View File

@@ -17,11 +17,11 @@ stdenv.mkDerivation rec {
x11lib = x11env + "/lib";
x11inc = x11env + "/include";
name = "ocaml-4.02.0";
name = "ocaml-4.02.1";
src = fetchurl {
url = "http://caml.inria.fr/pub/distrib/ocaml-4.02/${name}.tar.xz";
sha256 = "1ml5r8vzbwqhnq8jlps6jfgf0vym4nyrnr95mrbym6v5j2gabmw7";
sha256 = "1p7lqvh64xpykh99014mz21q8fs3qyjym2qazhhbq8scwldv1i38";
};
prefixKey = "-prefix ";

View File

@@ -0,0 +1,16 @@
diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile
index 2fcdd32..2d9ddb0 100644
--- a/src/test/run-make/relocation-model/Makefile
+++ b/src/test/run-make/relocation-model/Makefile
@@ -5,9 +5,11 @@ all:
$(call RUN,foo)
$(RUSTC) -C relocation-model=default foo.rs
+ paxctl -czexm $(TMPDIR)/foo
$(call RUN,foo)
$(RUSTC) -C relocation-model=static foo.rs
+ paxctl -czexm $(TMPDIR)/foo
$(call RUN,foo)
$(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs

View File

@@ -1,33 +1,23 @@
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 1cc60fc..2e94b99 100644
index 81f856c..c2078a5 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -383,18 +383,9 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
@@ -361,8 +361,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
pub fn get_cc_prog(sess: &Session) -> String {
match sess.opts.cg.linker {
- Some(ref linker) => return linker.to_string(),
- None => {}
- None => sess.target.target.options.linker.clone(),
+ Some(ref linker) => linker.to_string(),
+ None => "@ccPath@".to_string()
+ None => "@ccPath@".to_string(),
}
-
- // In the future, FreeBSD will use clang as default compiler.
- // It would be flexible to use cc (system's default C compiler)
- // instead of hard-coded gcc.
- // For Windows, there is no cc command, so we add a condition to make it use gcc.
- match sess.targ_cfg.os {
- abi::OsWindows => "gcc",
- _ => "cc",
- }.to_string()
}
pub fn remove(sess: &Session, path: &Path) {
diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
index 060dda5..fecf76b 100644
index db2f291..c7a13dc 100644
--- a/src/librustc_back/archive.rs
+++ b/src/librustc_back/archive.rs
@@ -53,7 +53,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
paths: &[&Path]) -> ProcessOutput {
let ar = match *maybe_ar_prog {
Some(ref ar) => ar.as_slice(),
@@ -35,3 +25,4 @@ index 060dda5..fecf76b 100644
+ None => "@arPath@"
};
let mut cmd = Command::new(ar);

View File

@@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchgit, which, file, perl, curl, python27, makeWrapper
, tzdata, git
, tzdata, git, valgrind
}:
assert stdenv.gcc.gcc != null;
@@ -18,19 +18,19 @@ assert stdenv.gcc.gcc != null;
*/
with ((import ./common.nix) {inherit stdenv; version = "0.12.0-pre-127-ga0ea210";});
with ((import ./common.nix) {inherit stdenv; version = "0.12.0-pre-961-g93c85eb";});
let snapshot = if stdenv.system == "i686-linux"
then "0644637db852db8a6c603ded0531ccaa60291bd3"
then "d827fbbd778b854923971873cf03bdb79c2e8575"
else if stdenv.system == "x86_64-linux"
then "656b8c23fbb97794e85973aca725a4b9cd07b29e"
then "1ddca522a8ba4a4f662dc17ca16b0f50f2c15f87"
else if stdenv.system == "i686-darwin"
then "e4d9709fcfe485fcca00f0aa1fe456e2f164ed96"
then "597cd42301e1569df8ad090574cd535d19283387"
else if stdenv.system == "x86_64-darwin"
then "6b1aa5a441965da87961be81950e8663eadba377"
then "4bfb2aff1c3e3c57653b32adc34b399c5aeb759b"
else abort "no-snapshot for platform ${stdenv.system}";
snapshotDate = "2014-10-10";
snapshotRev = "78a7676";
snapshotDate = "2014-11-04";
snapshotRev = "1b2ad78";
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2";
in stdenv.mkDerivation {
@@ -40,8 +40,8 @@ in stdenv.mkDerivation {
src = fetchgit {
url = https://github.com/rust-lang/rust;
rev = "a0ea210b394aa1b61d341593a3f9098fe5bf7806";
sha256 = "0flwzj6dywaq9s77ayinshqbz8na2a1jabkr9s7zj74s2ya5096i";
rev = "93c85eb8bdcc910a27caf6abd20207a626ae98e5";
sha256 = "0zj84xsyg8jpd6ixmdv7jsjrnsd4zwrac98qqmwgrd78h74g8kpq";
};
# We need rust to build rust. If we don't provide it, configure will try to download it.
@@ -65,7 +65,9 @@ in stdenv.mkDerivation {
configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ];
# The compiler requires cc, so we patch the source to tell it where to find it
patches = [ ./hardcode_paths.HEAD.patch ./local_stage0.HEAD.patch ];
patches = [ ./hardcode_paths.HEAD.patch ./local_stage0.HEAD.patch ]
++ stdenv.lib.optional stdenv.needsPax ./grsec.HEAD.patch;
postPatch = ''
substituteInPlace src/librustc/back/link.rs \
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc"
@@ -73,7 +75,7 @@ in stdenv.mkDerivation {
--subst-var-by "arPath" "${stdenv.gcc.binutils}/bin/ar"
'';
buildInputs = [ which file perl curl python27 makeWrapper git ];
buildInputs = [ which file perl curl python27 makeWrapper git valgrind ];
enableParallelBuilding = false; # disabled due to rust-lang/rust#16305