* stdenv-nix-linux should more-or-less work again now.
svn path=/nixpkgs/trunk/; revision=826
This commit is contained in:
parent
ab73ec398b
commit
a1b3ae0c81
|
@ -5,22 +5,22 @@ export NIX_NO_SELF_RPATH=1
|
|||
. $stdenv/setup
|
||||
|
||||
tar xvfj $glibcSrc
|
||||
(cd glibc-* && tar xvfj $linuxthreadsSrc)
|
||||
(cd glibc-* && tar xvfj $linuxthreadsSrc) || false
|
||||
|
||||
(cd glibc-* && patch -p1 < $vaargsPatch)
|
||||
(cd glibc-* && patch -p1 < $vaargsPatch) || false
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
LDFLAGS=-Wl,-S ../glibc-*/configure --prefix=$out --enable-add-ons --disable-profile
|
||||
../glibc-*/configure --prefix=$out --enable-add-ons --disable-profile
|
||||
|
||||
make
|
||||
make install
|
||||
#make localedata/install-locales
|
||||
make localedata/install-locales
|
||||
strip -S $out/lib/*.a $out/lib/*.so $out/lib/gconv/*.so || true
|
||||
strip -s $out/bin/* $out/sbin/* $out/libexec/* || true
|
||||
|
||||
ln -sf /etc/ld.so.cache $out/etc/ld.so.cache
|
||||
rm $out/etc/ld.so.cache
|
||||
|
||||
(cd $out/include && ln -s $kernelHeaders/include/* .)
|
||||
(cd $out/include && ln -s $kernelHeaders/include/* .) || false
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#! /bin/sh
|
||||
#! /bin/sh -e
|
||||
|
||||
. $stdenv/setup || exit 1
|
||||
. $stdenv/setup
|
||||
|
||||
tar xvfj $src || exit 1
|
||||
cd binutils-* || exit 1
|
||||
tar xvfj $src
|
||||
cd binutils-*
|
||||
|
||||
# Clear the default library search path.
|
||||
if test "$noSysDirs" == "1"; then
|
||||
echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt || exit 1
|
||||
if test "$enforcePurity" = "1"; then
|
||||
echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt
|
||||
fi
|
||||
|
||||
./configure --prefix=$out || exit 1
|
||||
make || exit 1
|
||||
make install || exit 1
|
||||
./configure --prefix=$out
|
||||
make
|
||||
make install
|
||||
|
||||
strip -S $out/lib/*.a || exit 1
|
||||
strip -S $out/lib/*.a
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{stdenv, fetchurl}: derivation {
|
||||
{stdenv, fetchurl, enforcePurity ? true}:
|
||||
|
||||
derivation {
|
||||
name = "binutils-2.14";
|
||||
system = stdenv.system;
|
||||
builder = ./builder.sh;
|
||||
|
@ -6,6 +8,5 @@
|
|||
url = ftp://ftp.nluug.nl/pub/gnu/binutils/binutils-2.14.tar.bz2;
|
||||
md5 = "2da8def15d28af3ec6af0982709ae90a";
|
||||
};
|
||||
stdenv = stdenv;
|
||||
noSysDirs = stdenv.noSysDirs;
|
||||
inherit stdenv enforcePurity;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, name, preHook, postHook, initialPath, gcc
|
||||
{ stdenv, name, preHook ? null, postHook ? null, initialPath, gcc
|
||||
, param1 ? "", param2 ? "", param3 ? "", param4 ? "", param5 ? ""
|
||||
}:
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
set -e
|
||||
|
||||
test -z $NIX_GCC && NIX_GCC=@gcc@
|
||||
|
||||
|
||||
# Set up the initial path.
|
||||
PATH=
|
||||
for i in @gcc@ @initialPath@; do
|
||||
for i in $NIX_GCC @initialPath@; do
|
||||
PATH=$PATH${PATH:+:}$i/bin
|
||||
done
|
||||
|
||||
|
@ -18,12 +20,18 @@ param2=@param2@
|
|||
param3=@param3@
|
||||
param4=@param4@
|
||||
param5=@param5@
|
||||
. @preHook@
|
||||
if test -n "@preHook@"; then
|
||||
. @preHook@
|
||||
fi
|
||||
|
||||
|
||||
# Check that the pre-hook initialised SHELL.
|
||||
if test -z "$SHELL"; then echo "SHELL not set"; exit 1; fi
|
||||
|
||||
|
||||
# Hack: run gcc's setup hook.
|
||||
if test -f @gcc@/nix-support/setup-hook; then
|
||||
. @gcc@/nix-support/setup-hook
|
||||
if test -f $NIX_GCC/nix-support/setup-hook; then
|
||||
. $NIX_GCC/nix-support/setup-hook
|
||||
fi
|
||||
|
||||
|
||||
|
@ -93,7 +101,9 @@ export TZ=UTC
|
|||
|
||||
|
||||
# Execute the post-hook.
|
||||
. @postHook@
|
||||
if test -n "@postHook@"; then
|
||||
. @postHook@
|
||||
fi
|
||||
|
||||
PATH=$_PATH${_PATH:+:}$PATH
|
||||
if test "$NIX_DEBUG" = "1"; then
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
(import ../generic) {
|
||||
name = "stdenv-native";
|
||||
preHook = ./prehook.sh;
|
||||
postHook = ./posthook.sh;
|
||||
initialPath = "/usr/local /usr /";
|
||||
|
||||
inherit stdenv;
|
||||
|
||||
gcc = (import ../../build-support/gcc-wrapper) {
|
||||
inherit stdenv;
|
||||
name = "gcc-native";
|
||||
isNative = true;
|
||||
gcc = "/usr";
|
||||
nativePrefix = "/usr";
|
||||
inherit stdenv;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
{system, glibc}: (import ../generic) {
|
||||
name = "stdenv-linux-boot";
|
||||
system = system;
|
||||
prehook = ./prehook-boot.sh;
|
||||
posthook = ./posthook.sh;
|
||||
{stdenv, glibc}:
|
||||
|
||||
(import ../generic) {
|
||||
name = "stdenv-nix-linux-boot";
|
||||
preHook = ./prehook-boot.sh;
|
||||
initialPath = "/usr/local /usr /";
|
||||
param1 = "";
|
||||
param2 = "";
|
||||
param3 = "";
|
||||
param4 = glibc;
|
||||
param5 = "";
|
||||
noSysDirs = true;
|
||||
|
||||
inherit stdenv;
|
||||
|
||||
gcc = (import ../../build-support/gcc-wrapper) {
|
||||
name = "gcc-native";
|
||||
isNative = true;
|
||||
nativePrefix = "/usr";
|
||||
inherit stdenv glibc;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
{bootStdenv, pkgs, glibc}: (import ../generic) {
|
||||
{stdenv, glibc, pkgs}:
|
||||
|
||||
(import ../generic) {
|
||||
name = "stdenv-nix-linux";
|
||||
system = bootStdenv.system;
|
||||
prehook = ./prehook.sh;
|
||||
posthook = ./posthook.sh;
|
||||
preHook = ./prehook.sh;
|
||||
initialPath = (import ../nix/path.nix) {pkgs = pkgs;};
|
||||
|
||||
inherit stdenv;
|
||||
|
||||
gcc = (import ../../build-support/gcc-wrapper) {
|
||||
name = "gcc-native";
|
||||
isNative = false;
|
||||
gcc = pkgs.gcc;
|
||||
binutils = pkgs.binutils;
|
||||
inherit stdenv glibc;
|
||||
};
|
||||
|
||||
param1 = pkgs.bash;
|
||||
param2 = pkgs.gcc;
|
||||
param3 = pkgs.binutils;
|
||||
param4 = glibc;
|
||||
param5 = "";
|
||||
noSysDirs = true;
|
||||
}
|
||||
|
|
|
@ -1,18 +1 @@
|
|||
export SHELL=/bin/sh
|
||||
|
||||
export NIX_CC=/usr/bin/gcc
|
||||
export NIX_CXX=/usr/bin/g++
|
||||
export NIX_LD=/usr/bin/ld
|
||||
|
||||
# The "-B$param4/lib" is a quick hack to force gcc to link against the
|
||||
# crt1.o from our own glibc, rather than the one in /usr/lib. The
|
||||
# real solution is of course to prevent those paths from being used by
|
||||
# gcc in the first place.
|
||||
# !!! -B should really be in NIX_CFLAGS_LINK, but ld-wrapper also uses
|
||||
# that one (incorrectly?).
|
||||
export NIX_CFLAGS_COMPILE="-B$param4/lib -isystem $param4/include $NIX_CFLAGS_COMPILE"
|
||||
export NIX_CFLAGS_LINK="-L$param4/lib $NIX_CFLAGS_LINK"
|
||||
export NIX_LDFLAGS="-dynamic-linker $param4/lib/ld-linux.so.2 -rpath $param4/lib $NIX_LDFLAGS"
|
||||
|
||||
export NIX_LIBC_INCLUDES="$param4/include"
|
||||
export NIX_LIBC_LIBS="$param4/lib"
|
||||
|
|
|
@ -1,18 +1,3 @@
|
|||
export SHELL=$param1
|
||||
|
||||
export NIX_CC=$param2/bin/gcc
|
||||
export NIX_CXX=$param2/bin/g++
|
||||
export NIX_LD=$param3/bin/ld
|
||||
|
||||
# The "-B$param4/lib" is a quick hack to force gcc to link against the
|
||||
# crt1.o from our own glibc, rather than the one in /usr/lib. The
|
||||
# real solution is of course to prevent those paths from being used by
|
||||
# gcc in the first place.
|
||||
# !!! -B should really be in NIX_CFLAGS_LINK, but ld-wrapper also uses
|
||||
# that one (incorrectly?).
|
||||
export NIX_CFLAGS_COMPILE="-B$param4/lib -isystem $param4/include $NIX_CFLAGS_COMPILE"
|
||||
export NIX_CFLAGS_LINK="-L$param4/lib -L$param2/lib $NIX_CFLAGS_LINK"
|
||||
export NIX_LDFLAGS="-dynamic-linker $param4/lib/ld-linux.so.2 -rpath $param4/lib -rpath $param2/lib $NIX_LDFLAGS"
|
||||
|
||||
export NIX_LIBC_INCLUDES="$param4/include"
|
||||
export NIX_LIBC_LIBS="$param4/lib"
|
||||
export NIX_ENFORCE_PURITY=1
|
||||
|
|
|
@ -198,12 +198,12 @@
|
|||
};
|
||||
|
||||
gcc = (import ../development/compilers/gcc) {
|
||||
inherit fetchurl stdenv binutils;
|
||||
inherit fetchurl stdenv;
|
||||
};
|
||||
|
||||
g77 = (import ../build-support/gcc-wrapper) {
|
||||
inherit stdenv;
|
||||
gcc = (import ../development/compilers/gcc-new) {
|
||||
gcc = (import ../development/compilers/gcc) {
|
||||
inherit fetchurl stdenv;
|
||||
langF77 = true;
|
||||
langCC = false;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
# 2) Construct a stdenv consisting of the native build environment,
|
||||
# plus the pure glibc.
|
||||
stdenvLinuxBoot1 = (import ../stdenv/nix-linux/boot.nix) {
|
||||
system = system;
|
||||
stdenv = stdenvInitial;
|
||||
glibc = stdenvLinuxGlibc;
|
||||
};
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
# might end up linking against /lib/libncurses). So repeat, but
|
||||
# now use the Nix-built tools from step 2/3.
|
||||
stdenvLinuxBoot2 = (import ../stdenv/nix-linux) {
|
||||
bootStdenv = stdenvLinuxBoot1;
|
||||
stdenv = stdenvLinuxBoot1;
|
||||
pkgs = stdenvLinuxBoot1Pkgs;
|
||||
glibc = stdenvLinuxGlibc;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@ export NIX_DEBUG=1
|
|||
|
||||
. $stdenv/setup
|
||||
|
||||
#export NIX_CFLAGS_COMPILE="-v $NIX_CFLAGS_COMPILE"
|
||||
export NIX_ENFORCE_PURITY=1
|
||||
|
||||
mkdir $out
|
||||
mkdir $out/bin
|
||||
|
@ -24,6 +24,8 @@ gcc -L /nix/store/abcd/lib -isystem /usr/lib hello.c -o $out/bin/hello
|
|||
|
||||
$out/bin/hello
|
||||
|
||||
exit 0
|
||||
|
||||
cat > hello2.cc <<EOF
|
||||
#include <iostream>
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
let {
|
||||
system = "i686-linux";
|
||||
|
||||
stdenvInitial = (import ../../stdenv/initial) {
|
||||
name = "stdenv-initial";
|
||||
inherit system;
|
||||
stdenvs = (import ../../system/stdenvs.nix) {
|
||||
system = "i686-linux";
|
||||
allPackages = import ../../system/all-packages-generic.nix;
|
||||
};
|
||||
|
||||
stdenv = (import ../../stdenv/native) {stdenv = stdenvInitial;};
|
||||
stdenv = stdenvs.stdenvLinuxBoot1;
|
||||
|
||||
test = derivation {
|
||||
name = "simple-test";
|
||||
|
|
Loading…
Reference in a new issue