diff options
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/builder-defs/builder-defs.nix | 6 | ||||
-rw-r--r-- | pkgs/build-support/cabal/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh | 8 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper-old/add-flags | 2 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper-old/gcc-wrapper-old.sh | 10 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper-old/gcc-wrapper.sh | 12 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper-old/ld-wrapper.sh | 2 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper/add-flags | 2 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper/gcc-wrapper.sh | 10 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper/ld-wrapper.sh | 2 | ||||
-rw-r--r-- | pkgs/build-support/gcc-wrapper/setup-hook.sh | 5 |
12 files changed, 34 insertions, 29 deletions
diff --git a/pkgs/build-support/builder-defs/builder-defs.nix b/pkgs/build-support/builder-defs/builder-defs.nix index 5c9ec402d4b8..da5d22498523 100644 --- a/pkgs/build-support/builder-defs/builder-defs.nix +++ b/pkgs/build-support/builder-defs/builder-defs.nix @@ -100,13 +100,13 @@ let inherit (builtins) head tail trace; in ${stdenv.preHook} set -e - NIX_GCC=${stdenv.gcc} + NIX_CC=${stdenv.cc} export SHELL=${stdenv.shell} PATH_DELIMITER=':' # Set up the initial path. PATH= - for i in \$NIX_GCC ${toString stdenv.initialPath}; do + for i in \$NIX_CC ${toString stdenv.initialPath}; do PATH=\$PATH\${PATH:+\"\${PATH_DELIMITER}\"}\$i/bin done @@ -138,7 +138,7 @@ let inherit (builtins) head tail trace; in } pkgs=\"\" - for i in \$NIX_GCC ${toString realBuildInputs}; do + for i in \$NIX_CC ${toString realBuildInputs}; do findInputs \$i done diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index ce0eca1a2bb9..0243fcff0991 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -220,6 +220,8 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; done done + configureFlags+=" --with-gcc=$CC" + ${optionalString (self.enableSharedExecutables && self.stdenv.isLinux) '' configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}" ''} diff --git a/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh index ec1f6004edd9..c15777144e11 100644 --- a/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh @@ -1,7 +1,7 @@ #! @shell@ -e -if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then - source "$NIX_GCC_WRAPPER_START_HOOK" +if test -n "$NIX_CC_WRAPPER_START_HOOK"; then + source "$NIX_CC_WRAPPER_START_HOOK" fi if test -z "$NIX_CROSS_GLIBC_FLAGS_SET"; then @@ -107,8 +107,8 @@ if test "$NIX_DEBUG" = "1"; then done fi -if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then - source "$NIX_GCC_WRAPPER_EXEC_HOOK" +if test -n "$NIX_CC_WRAPPER_EXEC_HOOK"; then + source "$NIX_CC_WRAPPER_EXEC_HOOK" fi # We want gcc to call the wrapper linker, not that of binutils. diff --git a/pkgs/build-support/gcc-wrapper-old/add-flags b/pkgs/build-support/gcc-wrapper-old/add-flags index 26e536f6d575..7714a6305739 100644 --- a/pkgs/build-support/gcc-wrapper-old/add-flags +++ b/pkgs/build-support/gcc-wrapper-old/add-flags @@ -25,4 +25,4 @@ if test -e @out@/nix-support/libc-ldflags-before; then export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" fi -export NIX_GCC_WRAPPER_FLAGS_SET=1 +export NIX_CC_WRAPPER_FLAGS_SET=1 diff --git a/pkgs/build-support/gcc-wrapper-old/gcc-wrapper-old.sh b/pkgs/build-support/gcc-wrapper-old/gcc-wrapper-old.sh index ac6312a25cac..a9d18036952e 100644 --- a/pkgs/build-support/gcc-wrapper-old/gcc-wrapper-old.sh +++ b/pkgs/build-support/gcc-wrapper-old/gcc-wrapper-old.sh @@ -1,10 +1,10 @@ #! @shell@ -e -if [ -n "$NIX_GCC_WRAPPER_START_HOOK" ]; then - source "$NIX_GCC_WRAPPER_START_HOOK" +if [ -n "$NIX_CC_WRAPPER_START_HOOK" ]; then + source "$NIX_CC_WRAPPER_START_HOOK" fi -if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then +if [ -z "$NIX_CC_WRAPPER_FLAGS_SET" ]; then source @out@/nix-support/add-flags.sh fi @@ -139,8 +139,8 @@ if [ -n "$NIX_DEBUG" ]; then done fi -if [ -n "$NIX_GCC_WRAPPER_EXEC_HOOK" ]; then - source "$NIX_GCC_WRAPPER_EXEC_HOOK" +if [ -n "$NIX_CC_WRAPPER_EXEC_HOOK" ]; then + source "$NIX_CC_WRAPPER_EXEC_HOOK" fi exec @prog@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" diff --git a/pkgs/build-support/gcc-wrapper-old/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper-old/gcc-wrapper.sh index 2ad7783a442c..8f12f08ddc7c 100644 --- a/pkgs/build-support/gcc-wrapper-old/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper-old/gcc-wrapper.sh @@ -1,10 +1,10 @@ #! @shell@ -e -if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then - source "$NIX_GCC_WRAPPER_START_HOOK" +if test -n "$NIX_CC_WRAPPER_START_HOOK"; then + source "$NIX_CC_WRAPPER_START_HOOK" fi -if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then +if test -z "$NIX_CC_WRAPPER_FLAGS_SET"; then source @out@/nix-support/add-flags.sh fi @@ -130,15 +130,15 @@ if test "$NIX_DEBUG" = "1"; then done fi -if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then - source "$NIX_GCC_WRAPPER_EXEC_HOOK" +if test -n "$NIX_CC_WRAPPER_EXEC_HOOK"; then + source "$NIX_CC_WRAPPER_EXEC_HOOK" fi # Call the real `gcc'. 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). -if test -z "$NIX_GCC_NEEDS_GREP"; then +if test -z "$NIX_CC_NEEDS_GREP"; then @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} else (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ diff --git a/pkgs/build-support/gcc-wrapper-old/ld-wrapper.sh b/pkgs/build-support/gcc-wrapper-old/ld-wrapper.sh index 822c4a03a218..db50d25cb3b9 100644 --- a/pkgs/build-support/gcc-wrapper-old/ld-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper-old/ld-wrapper.sh @@ -4,7 +4,7 @@ if test -n "$NIX_LD_WRAPPER_START_HOOK"; then source "$NIX_LD_WRAPPER_START_HOOK" fi -if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then +if test -z "$NIX_CC_WRAPPER_FLAGS_SET"; then source @out@/nix-support/add-flags.sh fi diff --git a/pkgs/build-support/gcc-wrapper/add-flags b/pkgs/build-support/gcc-wrapper/add-flags index d75f378e2c97..be79fc370ec9 100644 --- a/pkgs/build-support/gcc-wrapper/add-flags +++ b/pkgs/build-support/gcc-wrapper/add-flags @@ -25,4 +25,4 @@ if [ -e @out@/nix-support/libc-ldflags-before ]; then export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" fi -export NIX_GCC_WRAPPER_FLAGS_SET=1 +export NIX_CC_WRAPPER_FLAGS_SET=1 diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix index b2f7d07560d3..aed1ab817aad 100644 --- a/pkgs/build-support/gcc-wrapper/default.nix +++ b/pkgs/build-support/gcc-wrapper/default.nix @@ -226,7 +226,7 @@ stdenv.mkDerivation { crossAttrs = { shell = shell.crossDrv + shell.crossDrv.shellPath; - libc = stdenv.gccCross.libc; + libc = stdenv.ccCross.libc; coreutils = coreutils.crossDrv; binutils = binutils.crossDrv; gcc = gcc.crossDrv; diff --git a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh index d0c82c82dc1c..c918cc30d9ab 100644 --- a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh @@ -1,10 +1,10 @@ #! @shell@ -e -if [ -n "$NIX_GCC_WRAPPER_START_HOOK" ]; then - source "$NIX_GCC_WRAPPER_START_HOOK" +if [ -n "$NIX_CC_WRAPPER_START_HOOK" ]; then + source "$NIX_CC_WRAPPER_START_HOOK" fi -if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then +if [ -z "$NIX_CC_WRAPPER_FLAGS_SET" ]; then source @out@/nix-support/add-flags.sh fi @@ -139,8 +139,8 @@ if [ -n "$NIX_DEBUG" ]; then done fi -if [ -n "$NIX_GCC_WRAPPER_EXEC_HOOK" ]; then - source "$NIX_GCC_WRAPPER_EXEC_HOOK" +if [ -n "$NIX_CC_WRAPPER_EXEC_HOOK" ]; then + source "$NIX_CC_WRAPPER_EXEC_HOOK" fi exec @prog@ ${extraBefore[@]} "${params[@]}" "${extraAfter[@]}" diff --git a/pkgs/build-support/gcc-wrapper/ld-wrapper.sh b/pkgs/build-support/gcc-wrapper/ld-wrapper.sh index 894dbf9a352c..30c531b76479 100644 --- a/pkgs/build-support/gcc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/ld-wrapper.sh @@ -4,7 +4,7 @@ if [ -n "$NIX_LD_WRAPPER_START_HOOK" ]; then source "$NIX_LD_WRAPPER_START_HOOK" fi -if [ -z "$NIX_GCC_WRAPPER_FLAGS_SET" ]; then +if [ -z "$NIX_CC_WRAPPER_FLAGS_SET" ]; then source @out@/nix-support/add-flags.sh fi diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh index a6b7edbcb694..fc10e8fb2c31 100644 --- a/pkgs/build-support/gcc-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh @@ -1,4 +1,4 @@ -export NIX_GCC=@out@ +export NIX_CC=@out@ addCVars () { if [ -d $1/include ]; then @@ -33,3 +33,6 @@ fi if [ -n "@coreutils@" ]; then addToSearchPath PATH @coreutils@/bin fi + +export CC=gcc +export CXX=g++ |