Merge remote-tracking branch 'upstream/master' into hardened-stdenv

This commit is contained in:
Robin Gloster
2016-04-18 13:00:40 +00:00
1369 changed files with 35810 additions and 10571 deletions

View File

@@ -12,8 +12,10 @@ postConfigure() {
export NIX_DONT_SET_RPATH=1
unset CFLAGS
}
# Apparently --bindir is not respected.
makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
}
postInstall() {
if test -n "$installLocales"; then
@@ -25,7 +27,7 @@ postInstall() {
if test -n "$linuxHeaders"; then
# Include the Linux kernel headers in Glibc, except the `scsi'
# subdirectory, which Glibc provides itself.
(cd $out/include && \
(cd $dev/include && \
ln -sv $(ls -d $linuxHeaders/include/* | grep -v 'scsi$') .)
fi
@@ -41,6 +43,16 @@ postInstall() {
for i in $out/lib/*.a; do
strip -S "$i"
done
# Put libraries for static linking in a separate output. Note
# that libc_nonshared.a and libpthread_nonshared.a are required
# for dynamically-linked applications.
mkdir -p $static/lib
mv $out/lib/*.a $static/lib
mv $static/lib/lib*_nonshared.a $out/lib
# Work around a Nix bug: hard links across outputs cause a build failure.
cp $bin/bin/getconf $bin/bin/getconf_
mv $bin/bin/getconf_ $bin/bin/getconf
}
genericBuild

View File

@@ -112,6 +112,8 @@ stdenv.mkDerivation ({
installFlags = [ "sysconfdir=$(out)/etc" ];
outputs = [ "dev" "out" "bin" "static" ];
buildInputs = lib.optionals (cross != null) [ gccCross ]
++ lib.optionals withGd [ gd libpng ];

View File

@@ -66,7 +66,7 @@ in
# To avoid a dependency on the build system 'bash'.
preFixup = ''
rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
'';
}
else {}))

View File

@@ -8,6 +8,8 @@ build null {
inherit fetchurl stdenv lib;
outputs = [ "out" ];
configureFlags = [ "--enable-add-ons" ];
buildInputs = [ texinfo perl ];

View File

@@ -18,6 +18,8 @@ build null {
builder = ./locales-builder.sh;
outputs = [ "out" ];
# Awful hack: `localedef' doesn't allow the path to `locale-archive'
# to be overriden, but you *can* specify a prefix, i.e. it will use
# <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use
@@ -25,7 +27,7 @@ build null {
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
mkdir -p $TMPDIR/"${stdenv.cc.libc.out}/lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile

View File

@@ -3,32 +3,26 @@
let
nameVersion = builtins.parseDrvName glibc.name;
glibc64 = glibc;
in
runCommand "${nameVersion.name}-multi-${nameVersion.version}"
{ inherit glibc32;
glibc64 = glibc;
}
{ outputs = [ "dev" "out" "bin" ]; } # TODO: no static version here (yet)
''
mkdir -p $out
ln -s $glibc64/* $out/
rm $out/lib $out/lib64
mkdir -p $out/lib
ln -s $glibc64/lib/* $out/lib
ln -s $glibc32/lib $out/lib/32
ln -s lib $out/lib64
mkdir -p "$out/lib"
ln -s '${glibc64.out}'/lib/* "$out/lib"
ln -s '${glibc32.out}/lib' "$out/lib/32"
ln -s lib "$out/lib64"
# fixing ldd RLTDLIST
rm $out/bin
cp -rs $glibc64/bin $out
chmod u+w $out/bin
rm $out/bin/ldd
mkdir -p "$bin/bin"
cp -s '${glibc64.bin}'/bin/* "$bin/bin/"
rm "$bin/bin/ldd"
sed -e "s|^RTLDLIST=.*$|RTLDLIST=\"$out/lib/ld-linux-x86-64.so.2 $out/lib/32/ld-linux.so.2\"|g" \
$glibc64/bin/ldd > $out/bin/ldd
chmod 555 $out/bin/ldd
'${glibc64.bin}/bin/ldd' > "$bin/bin/ldd"
chmod +x "$bin/bin/ldd"
rm $out/include
cp -rs $glibc32/include $out
chmod -R u+w $out/include
cp -rsf $glibc64/include $out
mkdir "$dev"
cp -rs '${glibc32}'/include "$dev/"
chmod +w -R "$dev"
cp -rsf '${glibc64}'/include "$dev/"
''