diff options
author | Peter Simons <simons@cryp.to> | 2013-12-04 18:33:45 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2013-12-04 18:33:52 +0100 |
commit | c32bf83301bc4063df924ee442d8e35c1b96d912 (patch) | |
tree | 5a0821f9960cfa2508fc6b451fbaf8bfa6326367 /pkgs/build-support | |
parent | 88c7b4c7fee42c1ae5167fd1e7806d600e4451e4 (diff) | |
parent | 41f0e6ad9203a1859996e53323321a758c1fc7c4 (diff) |
Merge remote-tracking branch 'origin/master' into stdenv-updates.
Conflicts: pkgs/development/interpreters/perl/5.16/default.nix pkgs/tools/networking/curl/default.nix pkgs/top-level/all-packages.nix pkgs/top-level/release-python.nix pkgs/top-level/release-small.nix pkgs/top-level/release.nix
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/clang-wrapper/builder.sh | 3 | ||||
-rw-r--r-- | pkgs/build-support/clang-wrapper/clang-wrapper.sh | 11 | ||||
-rw-r--r-- | pkgs/build-support/clang-wrapper/default.nix | 4 | ||||
-rwxr-xr-x | pkgs/build-support/fetchgit/nix-prefetch-git | 10 | ||||
-rw-r--r-- | pkgs/build-support/fetchsvn/builder.sh | 4 |
5 files changed, 23 insertions, 9 deletions
diff --git a/pkgs/build-support/clang-wrapper/builder.sh b/pkgs/build-support/clang-wrapper/builder.sh index 9f1542e041135..3f90b9d32bd04 100644 --- a/pkgs/build-support/clang-wrapper/builder.sh +++ b/pkgs/build-support/clang-wrapper/builder.sh @@ -58,11 +58,14 @@ fi doSubstitute() { local src=$1 local dst=$2 + local uselibcxx= + if test -n "$libcxx" && echo $dst | fgrep ++; then uselibcxx=$libcxx; fi # Can't use substitute() here, because replace may not have been # built yet (in the bootstrap). sed \ -e "s^@out@^$out^g" \ -e "s^@shell@^$shell^g" \ + -e "s^@libcxx@^$uselibcxx^g" \ -e "s^@clang@^$clang^g" \ -e "s^@clangProg@^$clangProg^g" \ -e "s^@binutils@^$binutils^g" \ diff --git a/pkgs/build-support/clang-wrapper/clang-wrapper.sh b/pkgs/build-support/clang-wrapper/clang-wrapper.sh index 2052d2c2eb4cb..84067844cad87 100644 --- a/pkgs/build-support/clang-wrapper/clang-wrapper.sh +++ b/pkgs/build-support/clang-wrapper/clang-wrapper.sh @@ -52,7 +52,6 @@ if test "$nonFlagArgs" = "0"; then dontLink=1 fi - # Optionally filter out paths not refering to the store. params=("$@") if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then @@ -79,6 +78,10 @@ if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then params=("${rest[@]}") fi +if test -n "@libcxx@"; then + NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem@libcxx@/include/c++/v1 -stdlib=libc++" + NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++ -lc++abi" +fi # Add the flags for the C compiler proper. extraAfter=($NIX_CFLAGS_COMPILE) @@ -134,6 +137,12 @@ if test -n "$NIX_CLANG_WRAPPER_EXEC_HOOK"; then source "$NIX_CLANG_WRAPPER_EXEC_HOOK" fi +# We nuke LD_LIBRARY_PATH here, because clang dynamically links to LLVM. +# Unfortunately, when such clang is used to build LLVM again, it can get in +# trouble temporarily binding to the build-directory versions of the libraries +# (the buildsystem sets LD_LIBRARY_PATH). That is very undesirable and can +# cause mysterious failures. +LD_LIBRARY_PATH= # Call the real `clang'. Filter out warnings from stderr about unused # `-B' flags, since they confuse some programs. Deep bash magic to diff --git a/pkgs/build-support/clang-wrapper/default.nix b/pkgs/build-support/clang-wrapper/default.nix index 9f560d0d2fba5..1b2a02fa86a48 100644 --- a/pkgs/build-support/clang-wrapper/default.nix +++ b/pkgs/build-support/clang-wrapper/default.nix @@ -7,7 +7,7 @@ { name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? "" , clang ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "" -, zlib ? null +, zlib ? null, libcxx ? null }: assert nativeTools -> nativePrefix != ""; @@ -33,7 +33,7 @@ stdenv.mkDerivation { utils = ./utils.sh; addFlags = ./add-flags; - inherit nativeTools nativeLibc nativePrefix clang clangVersion; + inherit nativeTools nativeLibc nativePrefix clang clangVersion libcxx; gcc = clang.gcc; libc = if nativeLibc then null else libc; binutils = if nativeTools then null else binutils; diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 00cd7d3129b3f..0afae009dc572 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -142,10 +142,12 @@ init_submodules(){ git submodule status | while read l; do # checkout each submodule - local hash=$(echo $l | sed 's,^-\([0-9a-f]*\) \(.*\)$,\1,'); - local dir=$(echo $l | sed 's,^-\([0-9a-f]*\) \(.*\)$,\2,'); - local url=$(sed -n "\,$dir, { :loop; n; s,^.*url = ,,; T loop; p; q }" .git/config); - + local hash=$(echo $l | awk '{print substr($1,2)}'); + local dir=$(echo $l | awk '{print $2}'); + local name=$( + git config -f .gitmodules --get-regexp submodule\.[^.]*\.path | + sed -n "s,^\(.*\)\.path $dir\$,\\1,p") + local url=$(git config -f .gitmodules --get ${name}.url); clone "$dir" "$url" "$hash" ""; done; } diff --git a/pkgs/build-support/fetchsvn/builder.sh b/pkgs/build-support/fetchsvn/builder.sh index ea52ca19fa67d..68dce2cc585b2 100644 --- a/pkgs/build-support/fetchsvn/builder.sh +++ b/pkgs/build-support/fetchsvn/builder.sh @@ -21,8 +21,8 @@ fi; # Pipe the "p" character into Subversion to force it to accept the # server's certificate. This is perfectly safe: we don't care # whether the server is being spoofed --- only the cryptographic -# hash of the output matters. -echo 'p' | svn export ${ignoreExternals:+--ignore-externals} \ +# hash of the output matters. Pass in extra p's to handle redirects. +printf 'p\np\np\n' | svn export ${ignoreExternals:+--ignore-externals} \ -r "$rev" "$url" "$out" stopNest |