summary refs log tree commit diff
path: root/pkgs/stdenv/nix-linux/prehook-boot.sh
blob: 193f232c33746605d1468b291aa4156c661ec0d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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"