about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-01-20 05:23:17 -0500
committerShea Levy <shea@shealevy.com>2014-01-20 05:42:38 -0500
commit55e6303d6a0b943e72e6348867780f0886487871 (patch)
treec441051f3b50d14b7b69160314b551a1b9587562 /pkgs/build-support
parent86808f2c468703f96179ef788c8a750b47619696 (diff)
downloadnixlib-55e6303d6a0b943e72e6348867780f0886487871.tar
nixlib-55e6303d6a0b943e72e6348867780f0886487871.tar.gz
nixlib-55e6303d6a0b943e72e6348867780f0886487871.tar.bz2
nixlib-55e6303d6a0b943e72e6348867780f0886487871.tar.lz
nixlib-55e6303d6a0b943e72e6348867780f0886487871.tar.xz
nixlib-55e6303d6a0b943e72e6348867780f0886487871.tar.zst
nixlib-55e6303d6a0b943e72e6348867780f0886487871.zip
Add full llvm build, update libc++ and dragonegg
Some packages in the llvm suite (e.g. compiler-rt) cannot be built
separate from the build of llvm, and while some others (e.g. clang) can
the combined build is much better tested (we've had to work around
annoying issues before). So this puts llvm, clang, clang-tools-extra,
compiler-rt, lld, lldb, and polly all into one big build (llvmFull).
This build includes a static llvm, as dynamic is similarly less tested
and has known failures.

This also updates libc++ and dragonegg. libc++ now builds against
libc++abi as a separate package rather than building it during the
libc++ build.

The clang purity patch is gone. Instead, we simply set --sysroot to
/var/empty for pure builds, as all impure paths are either looked up in
the gcc prefix (which we hard-code at compile time) or in the sysroot.
This also means that if NIX_ENFORCE_PURITY is 0 then clang will look in
the normal Linux paths by default, which is the proper behavior IMO.

polly required an updated isl. When stdenv-updates is merged, perhaps we
can update the isl used by gcc and avoid having two versions.

Since llvm on its own is now separate from the llvm used by clang, I've
removed myself as maintainer from llvm and will leave maintenance of
that to those who are interested in llvm separate from clang.

Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/clang-wrapper/builder.sh3
-rw-r--r--pkgs/build-support/clang-wrapper/clang-wrapper.sh10
-rw-r--r--pkgs/build-support/clang-wrapper/default.nix3
-rw-r--r--pkgs/build-support/clang-wrapper/ld-wrapper.sh3
4 files changed, 11 insertions, 8 deletions
diff --git a/pkgs/build-support/clang-wrapper/builder.sh b/pkgs/build-support/clang-wrapper/builder.sh
index 3f90b9d32bd0..0cdb2b96135e 100644
--- a/pkgs/build-support/clang-wrapper/builder.sh
+++ b/pkgs/build-support/clang-wrapper/builder.sh
@@ -59,13 +59,16 @@ doSubstitute() {
     local src=$1
     local dst=$2
     local uselibcxx=
+    local uselibcxxabi=
     if test -n "$libcxx" && echo $dst | fgrep ++; then uselibcxx=$libcxx; fi
+    if test -n "$libcxxabi" && echo $dst | fgrep ++; then uselibcxxabi=$libcxxabi; 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^@libcxxabi@^$uselibcxxabi^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 84067844cad8..b39aa2d721e8 100644
--- a/pkgs/build-support/clang-wrapper/clang-wrapper.sh
+++ b/pkgs/build-support/clang-wrapper/clang-wrapper.sh
@@ -76,11 +76,12 @@ if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
         n=$((n + 1))
     done
     params=("${rest[@]}")
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE --sysroot=/var/empty"
 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"
+    NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++ -L@libcxxabi@/lib -lc++abi"
 fi
 
 # Add the flags for the C compiler proper.
@@ -137,13 +138,6 @@ 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
 # apply grep to stderr (by swapping stdin/stderr twice).
diff --git a/pkgs/build-support/clang-wrapper/default.nix b/pkgs/build-support/clang-wrapper/default.nix
index 1b2a02fa86a4..05b8194697e1 100644
--- a/pkgs/build-support/clang-wrapper/default.nix
+++ b/pkgs/build-support/clang-wrapper/default.nix
@@ -34,6 +34,9 @@ stdenv.mkDerivation {
   addFlags = ./add-flags;
   
   inherit nativeTools nativeLibc nativePrefix clang clangVersion libcxx;
+
+  libcxxabi = libcxx.abi or null;
+
   gcc = clang.gcc;
   libc = if nativeLibc then null else libc;
   binutils = if nativeTools then null else binutils;
diff --git a/pkgs/build-support/clang-wrapper/ld-wrapper.sh b/pkgs/build-support/clang-wrapper/ld-wrapper.sh
index 48378778ba9e..ae45c62d460a 100644
--- a/pkgs/build-support/clang-wrapper/ld-wrapper.sh
+++ b/pkgs/build-support/clang-wrapper/ld-wrapper.sh
@@ -32,6 +32,9 @@ if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \
             # We cannot skip this; barf.
             echo "impure path \`$p' used in link" >&2
             exit 1
+        elif test "${p:0:9}" = "--sysroot"; then
+            # Our ld is not built with sysroot support (Can we fix that?)
+            :
         else
             rest=("${rest[@]}" "$p")
         fi