mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
rename gcc-wrapper to cc-wrapper.
also makes cc-wrapper compatible with clang in the darwin fork.
This commit is contained in:
parent
e38c351f2b
commit
48f63c2f2e
@ -33,7 +33,7 @@ in
|
||||
composableDerivation {
|
||||
# use gccApple to compile on darwin
|
||||
mkDerivation = ( if stdenv.isDarwin
|
||||
then stdenvAdapters.overrideGCC stdenv gccApple
|
||||
then stdenvAdapters.overrideCC stdenv gccApple
|
||||
else stdenv ).mkDerivation;
|
||||
} (fix: {
|
||||
|
||||
|
@ -8,7 +8,7 @@ let inherit (args.composableDerivation) composableDerivation edf; in
|
||||
composableDerivation {
|
||||
# use gccApple to compile on darwin
|
||||
mkDerivation = ( if stdenv.isDarwin
|
||||
then stdenvAdapters.overrideGCC stdenv gccApple
|
||||
then stdenvAdapters.overrideCC stdenv gccApple
|
||||
else stdenv ).mkDerivation;
|
||||
} (fix: {
|
||||
|
||||
|
@ -6,7 +6,7 @@ if [ -e @out@/nix-support/libc-cflags ]; then
|
||||
fi
|
||||
|
||||
if [ -e @out@/nix-support/gcc-cflags ]; then
|
||||
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE"
|
||||
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/cc-cflags) $NIX_CFLAGS_COMPILE"
|
||||
fi
|
||||
|
||||
if [ -e @out@/nix-support/gnat-cflags ]; then
|
||||
@ -18,7 +18,7 @@ if [ -e @out@/nix-support/libc-ldflags ]; then
|
||||
fi
|
||||
|
||||
if [ -e @out@/nix-support/gcc-ldflags ]; then
|
||||
export NIX_LDFLAGS+=" $(cat @out@/nix-support/gcc-ldflags)"
|
||||
export NIX_LDFLAGS+=" $(cat @out@/nix-support/cc-ldflags)"
|
||||
fi
|
||||
|
||||
if [ -e @out@/nix-support/libc-ldflags-before ]; then
|
@ -79,6 +79,18 @@ if [ "$NIX_ENFORCE_PURITY" = 1 -a -n "$NIX_STORE" ]; then
|
||||
params=("${rest[@]}")
|
||||
fi
|
||||
|
||||
if test -n "@libcxx@"; then
|
||||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem@libcxx@/include/c++/v1"
|
||||
if [[ "@prog@" = *++ ]]; then
|
||||
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -stdlib=libc++"
|
||||
if test -z "$NIX_SKIP_CXX"; then
|
||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxx@/lib -stdlib=libc++"
|
||||
fi
|
||||
if test -z "$NIX_SKIP_CXXABI" && echo "$@" | grep -qvw -- -nostdlib; then
|
||||
NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L@libcxxabi@/lib -lc++abi"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add the flags for the C compiler proper.
|
||||
extraAfter=($NIX_CFLAGS_COMPILE)
|
@ -1,4 +1,4 @@
|
||||
# The Nixpkgs GCC is not directly usable, since it doesn't know where
|
||||
# The Nixpkgs CC is not directly usable, since it doesn't know where
|
||||
# the C library and standard header files are. Therefore the compiler
|
||||
# produced by that package cannot be installed directly in a user
|
||||
# environment and used from the command line. So we use a wrapper
|
||||
@ -6,34 +6,35 @@
|
||||
# compiler and the linker just "work".
|
||||
|
||||
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
||||
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
|
||||
, cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenv.shell
|
||||
, zlib ? null, extraPackages ? []
|
||||
, libcxx ? null, libcxxabi ? null
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
assert nativeTools -> nativePrefix != "";
|
||||
assert !nativeTools -> gcc != null && binutils != null && coreutils != null;
|
||||
assert !nativeTools -> cc != null && binutils != null && coreutils != null;
|
||||
assert !nativeLibc -> libc != null;
|
||||
|
||||
# For ghdl (the vhdl language provider to gcc) we need zlib in the wrapper.
|
||||
assert gcc.langVhdl or false -> zlib != null;
|
||||
assert cc.langVhdl or false -> zlib != null;
|
||||
|
||||
let
|
||||
|
||||
gccVersion = (builtins.parseDrvName gcc.name).version;
|
||||
gccName = (builtins.parseDrvName gcc.name).name;
|
||||
ccVersion = (builtins.parseDrvName cc.name).version;
|
||||
ccName = (builtins.parseDrvName cc.name).name;
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name =
|
||||
(if name != "" then name else gccName + "-wrapper") +
|
||||
(if gcc != null && gccVersion != "" then "-" + gccVersion else "");
|
||||
(if name != "" then name else ccName + "-wrapper") +
|
||||
(if cc != null && ccVersion != "" then "-" + ccVersion else "");
|
||||
|
||||
preferLocalBuild = true;
|
||||
|
||||
inherit gcc shell;
|
||||
inherit cc shell libcxx libcxxabi;
|
||||
libc = if nativeLibc then null else libc;
|
||||
binutils = if nativeTools then null else binutils;
|
||||
# The wrapper scripts use 'cat', so we may need coreutils.
|
||||
@ -73,7 +74,7 @@ stdenv.mkDerivation {
|
||||
# compile, because it uses "#include_next <limits.h>" to find the
|
||||
# limits.h file in ../includes-fixed. To remedy the problem,
|
||||
# another -idirafter is necessary to add that directory again.
|
||||
echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
|
||||
echo "-B$libc/lib/ -idirafter $libc/include -idirafter $cc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
|
||||
|
||||
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
|
||||
|
||||
@ -86,43 +87,50 @@ stdenv.mkDerivation {
|
||||
''
|
||||
|
||||
+ (if nativeTools then ''
|
||||
gccPath="${nativePrefix}/bin"
|
||||
ccPath="${nativePrefix}/bin"
|
||||
ldPath="${nativePrefix}/bin"
|
||||
'' else ''
|
||||
echo $gcc > $out/nix-support/orig-gcc
|
||||
echo $cc > $out/nix-support/orig-cc
|
||||
|
||||
# GCC shows $gcc/lib in `gcc -print-search-dirs', but not
|
||||
# $gcc/lib64 (even though it does actually search there...)..
|
||||
# GCC shows $cc/lib in `gcc -print-search-dirs', but not
|
||||
# $cc/lib64 (even though it does actually search there...)..
|
||||
# This confuses libtool. So add it to the compiler tool search
|
||||
# path explicitly.
|
||||
if [ -e "$gcc/lib64" -a ! -L "$gcc/lib64" ]; then
|
||||
gccLDFlags+=" -L$gcc/lib64"
|
||||
gccCFlags+=" -B$gcc/lib64"
|
||||
if [ -e "$cc/lib64" -a ! -L "$cc/lib64" ]; then
|
||||
ccLDFlags+=" -L$cc/lib64"
|
||||
ccCFlags+=" -B$cc/lib64"
|
||||
fi
|
||||
gccLDFlags+=" -L$gcc/lib"
|
||||
ccLDFlags+=" -L$cc/lib"
|
||||
|
||||
${optionalString gcc.langVhdl or false ''
|
||||
gccLDFlags+=" -L${zlib}/lib"
|
||||
${optionalString cc.langVhdl or false ''
|
||||
ccLDFlags+=" -L${zlib}/lib"
|
||||
''}
|
||||
|
||||
# Find the gcc libraries path (may work only without multilib).
|
||||
${optionalString gcc.langAda or false ''
|
||||
basePath=`echo $gcc/lib/*/*/*`
|
||||
gccCFlags+=" -B$basePath -I$basePath/adainclude"
|
||||
${optionalString cc.langAda or false ''
|
||||
basePath=`echo $cc/lib/*/*/*`
|
||||
ccCFlags+=" -B$basePath -I$basePath/adainclude"
|
||||
gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib"
|
||||
echo "$gnatCFlags" > $out/nix-support/gnat-cflags
|
||||
''}
|
||||
|
||||
echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
|
||||
echo "$gccCFlags" > $out/nix-support/gcc-cflags
|
||||
if [ -e $ccPath/clang ]; then
|
||||
# Need files like crtbegin.o from gcc
|
||||
# It's unclear if these will ever be provided by an LLVM project
|
||||
ccCFlags="$ccCFlags -B$basePath"
|
||||
ccCFlags="$ccCFlags -isystem$cc/lib/clang/$ccVersion/include"
|
||||
fi
|
||||
|
||||
gccPath="$gcc/bin"
|
||||
echo "$ccLDFlags" > $out/nix-support/cc-ldflags
|
||||
echo "$ccCFlags" > $out/nix-support/cc-cflags
|
||||
|
||||
ccPath="$cc/bin"
|
||||
ldPath="$binutils/bin"
|
||||
|
||||
# Propagate the wrapped gcc so that if you install the wrapper,
|
||||
# Propagate the wrapped cc so that if you install the wrapper,
|
||||
# you get tools like gcov, the manpages, etc. as well (including
|
||||
# for binutils and Glibc).
|
||||
echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
|
||||
echo $cc $binutils $libc > $out/nix-support/propagated-user-env-packages
|
||||
|
||||
echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
|
||||
''
|
||||
@ -136,7 +144,7 @@ stdenv.mkDerivation {
|
||||
|
||||
+ ''
|
||||
# Create a symlink to as (the assembler). This is useful when a
|
||||
# gcc-wrapper is installed in a user environment, as it ensures that
|
||||
# cc-wrapper is installed in a user environment, as it ensures that
|
||||
# the right assembler is called.
|
||||
if [ -e $ldPath/as ]; then
|
||||
ln -s $ldPath/as $out/bin/as
|
||||
@ -152,64 +160,56 @@ stdenv.mkDerivation {
|
||||
wrap ld.bfd ${./ld-wrapper.sh} $binutils/bin/ld.bfd
|
||||
fi
|
||||
|
||||
if [ -e $gccPath/gcc ]; then
|
||||
wrap gcc ${./gcc-wrapper.sh} $gccPath/gcc
|
||||
if [ -e $ccPath/gcc ]; then
|
||||
wrap gcc ${./cc-wrapper.sh} $ccPath/gcc
|
||||
ln -s gcc $out/bin/cc
|
||||
elif [ -e $gccPath/clang ]; then
|
||||
wrap clang ${./gcc-wrapper.sh} $gccPath/clang
|
||||
elif [ -e $ccPath/clang ]; then
|
||||
wrap clang ${./cc-wrapper.sh} $ccPath/clang
|
||||
ln -s clang $out/bin/cc
|
||||
fi
|
||||
|
||||
if [ -e $gccPath/g++ ]; then
|
||||
wrap g++ ${./gcc-wrapper.sh} $gccPath/g++
|
||||
if [ -e $ccPath/g++ ]; then
|
||||
wrap g++ ${./cc-wrapper.sh} $ccPath/g++
|
||||
ln -s g++ $out/bin/c++
|
||||
elif [ -e $gccPath/clang++ ]; then
|
||||
wrap clang++ ${./gcc-wrapper.sh} $gccPath/clang++
|
||||
elif [ -e $ccPath/clang++ ]; then
|
||||
wrap clang++ ${./cc-wrapper.sh} $ccPath/clang++
|
||||
ln -s clang++ $out/bin/c++
|
||||
fi
|
||||
|
||||
if [ -e $gccPath/cpp ]; then
|
||||
wrap cpp ${./gcc-wrapper.sh} $gccPath/cpp
|
||||
if [ -e $ccPath/cpp ]; then
|
||||
wrap cpp ${./cc-wrapper.sh} $ccPath/cpp
|
||||
fi
|
||||
''
|
||||
|
||||
+ optionalString gcc.langFortran or false ''
|
||||
wrap gfortran ${./gcc-wrapper.sh} $gccPath/gfortran
|
||||
+ optionalString cc.langFortran or false ''
|
||||
wrap gfortran ${./cc-wrapper.sh} $ccPath/gfortran
|
||||
ln -sv gfortran $out/bin/g77
|
||||
ln -sv gfortran $out/bin/f77
|
||||
''
|
||||
|
||||
+ optionalString gcc.langJava or false ''
|
||||
wrap gcj ${./gcc-wrapper.sh} $gccPath/gcj
|
||||
+ optionalString cc.langJava or false ''
|
||||
wrap gcj ${./cc-wrapper.sh} $ccPath/gcj
|
||||
''
|
||||
|
||||
+ optionalString gcc.langGo or false ''
|
||||
wrap gccgo ${./gcc-wrapper.sh} $gccPath/gccgo
|
||||
+ optionalString cc.langGo or false ''
|
||||
wrap ccgo ${./cc-wrapper.sh} $ccPath/gccgo
|
||||
''
|
||||
|
||||
+ optionalString gcc.langAda or false ''
|
||||
wrap gnatgcc ${./gcc-wrapper.sh} $gccPath/gnatgcc
|
||||
wrap gnatmake ${./gnat-wrapper.sh} $gccPath/gnatmake
|
||||
wrap gnatbind ${./gnat-wrapper.sh} $gccPath/gnatbind
|
||||
wrap gnatlink ${./gnatlink-wrapper.sh} $gccPath/gnatlink
|
||||
+ optionalString cc.langAda or false ''
|
||||
wrap gnatgcc ${./cc-wrapper.sh} $ccPath/gnatgcc
|
||||
wrap gnatmake ${./gnat-wrapper.sh} $ccPath/gnatmake
|
||||
wrap gnatbind ${./gnat-wrapper.sh} $ccPath/gnatbind
|
||||
wrap gnatlink ${./gnatlink-wrapper.sh} $ccPath/gnatlink
|
||||
''
|
||||
|
||||
+ optionalString gcc.langVhdl or false ''
|
||||
ln -s $gccPath/ghdl $out/bin/ghdl
|
||||
+ optionalString cc.langVhdl or false ''
|
||||
ln -s $ccPath/ghdl $out/bin/ghdl
|
||||
''
|
||||
|
||||
+ ''
|
||||
substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook
|
||||
substituteAll ${./add-flags} $out/nix-support/add-flags.sh
|
||||
cp -p ${./utils.sh} $out/nix-support/utils.sh
|
||||
|
||||
if [ -e $out/bin/clang ]; then
|
||||
echo 'export CC; : ''${CC:=clang}' >> $out/nix-support/setup-hook
|
||||
fi
|
||||
|
||||
if [ -e $out/bin/clang++ ]; then
|
||||
echo 'export CXX; : ''${CXX:=clang++}' >> $out/nix-support/setup-hook
|
||||
fi
|
||||
'';
|
||||
|
||||
# The dynamic linker has different names on different Linux platforms.
|
||||
@ -229,7 +229,7 @@ stdenv.mkDerivation {
|
||||
libc = stdenv.ccCross.libc;
|
||||
coreutils = coreutils.crossDrv;
|
||||
binutils = binutils.crossDrv;
|
||||
gcc = gcc.crossDrv;
|
||||
cc = cc.crossDrv;
|
||||
#
|
||||
# This is not the best way to do this. I think the reference should be
|
||||
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
|
||||
@ -242,10 +242,10 @@ stdenv.mkDerivation {
|
||||
};
|
||||
|
||||
meta =
|
||||
let gcc_ = if gcc != null then gcc else {}; in
|
||||
(if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) //
|
||||
let cc_ = if cc != null then cc else {}; in
|
||||
(if cc_ ? meta then removeAttrs cc.meta ["priority"] else {}) //
|
||||
{ description =
|
||||
stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_
|
||||
stdenv.lib.attrByPath ["meta" "description"] "System C compiler" cc_
|
||||
+ " (wrapper script)";
|
||||
};
|
||||
}
|
@ -18,8 +18,8 @@ envHooks+=(addCVars)
|
||||
|
||||
# Note: these come *after* $out in the PATH (see setup.sh).
|
||||
|
||||
if [ -n "@gcc@" ]; then
|
||||
addToSearchPath PATH @gcc@/bin
|
||||
if [ -n "@cc@" ]; then
|
||||
addToSearchPath PATH @cc@/bin
|
||||
fi
|
||||
|
||||
if [ -n "@binutils@" ]; then
|
@ -8,7 +8,7 @@ rec {
|
||||
|
||||
|
||||
# Override the compiler in stdenv for specific packages.
|
||||
overrideGCC = stdenv: gcc: stdenv.override { allowedRequisites = null; cc = gcc; };
|
||||
overrideCC = stdenv: cc: stdenv.override { allowedRequisites = null; cc = cc; };
|
||||
|
||||
|
||||
# Add some arbitrary packages to buildInputs for specific packages.
|
||||
|
@ -18,13 +18,13 @@ import ../generic rec {
|
||||
|
||||
system = stdenv.system;
|
||||
|
||||
cc = import ../../build-support/gcc-wrapper {
|
||||
cc = import ../../build-support/cc-wrapper {
|
||||
nativeTools = false;
|
||||
nativeLibc = true;
|
||||
inherit stdenv;
|
||||
extraPackages = stdenv.lib.optional haveLibCxx pkgs.libcxx;
|
||||
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
|
||||
gcc = if useClang33 then pkgs.clang_33.gcc else pkgs.clang.gcc;
|
||||
cc = if useClang33 then pkgs.clang_33.cc else pkgs.clang.cc;
|
||||
coreutils = pkgs.coreutils;
|
||||
shell = pkgs.bash + "/bin/sh";
|
||||
};
|
||||
|
@ -85,10 +85,10 @@ rec {
|
||||
|
||||
cc = if isNull gccPlain
|
||||
then "/no-such-path"
|
||||
else lib.makeOverridable (import ../../build-support/gcc-wrapper) {
|
||||
else lib.makeOverridable (import ../../build-support/cc-wrapper) {
|
||||
nativeTools = false;
|
||||
nativeLibc = false;
|
||||
gcc = gccPlain;
|
||||
cc = gccPlain;
|
||||
libc = glibc;
|
||||
inherit binutils coreutils;
|
||||
name = name;
|
||||
@ -209,7 +209,7 @@ rec {
|
||||
mpc = pkgs.mpc.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
|
||||
isl = pkgs.isl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
|
||||
cloog = pkgs.cloog.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
|
||||
gccPlain = pkgs.gcc.gcc;
|
||||
gccPlain = pkgs.gcc.cc;
|
||||
};
|
||||
extraBuildInputs = [ stage2.pkgs.patchelf stage2.pkgs.paxctl ];
|
||||
};
|
||||
@ -229,10 +229,10 @@ rec {
|
||||
# other purposes (binutils and top-level pkgs) too.
|
||||
inherit (stage3.pkgs) gettext gnum4 gmp perl glibc zlib linuxHeaders;
|
||||
|
||||
gcc = lib.makeOverridable (import ../../build-support/gcc-wrapper) {
|
||||
gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
|
||||
nativeTools = false;
|
||||
nativeLibc = false;
|
||||
gcc = stage4.stdenv.cc.gcc;
|
||||
cc = stage4.stdenv.cc.cc;
|
||||
libc = stage4.pkgs.glibc;
|
||||
inherit (stage4.pkgs) binutils coreutils;
|
||||
name = "";
|
||||
|
@ -98,8 +98,8 @@ rec {
|
||||
};
|
||||
|
||||
|
||||
cc = import ../../build-support/gcc-wrapper {
|
||||
name = "gcc-native";
|
||||
cc = import ../../build-support/cc-wrapper {
|
||||
name = "cc-native";
|
||||
nativeTools = true;
|
||||
nativeLibc = true;
|
||||
nativePrefix = if system == "i686-solaris" then "/usr/gnu" else if system == "x86_64-solaris" then "/opt/local/gcc47" else "/usr";
|
||||
|
@ -13,13 +13,13 @@ import ../generic rec {
|
||||
|
||||
system = stdenv.system;
|
||||
|
||||
gcc = import ../../build-support/gcc-wrapper {
|
||||
cc = import ../../build-support/cc-wrapper {
|
||||
nativeTools = false;
|
||||
nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr";
|
||||
nativeLibc = true;
|
||||
inherit stdenv;
|
||||
binutils = pkgs.binutils;
|
||||
gcc = pkgs.gcc.gcc;
|
||||
cc = pkgs.gcc.cc;
|
||||
coreutils = pkgs.coreutils;
|
||||
shell = pkgs.bash + "/bin/sh";
|
||||
};
|
||||
@ -29,8 +29,8 @@ import ../generic rec {
|
||||
fetchurlBoot = stdenv.fetchurlBoot;
|
||||
|
||||
overrides = pkgs_: {
|
||||
inherit gcc;
|
||||
inherit (gcc) binutils;
|
||||
inherit cc;
|
||||
inherit (cc) binutils;
|
||||
inherit (pkgs)
|
||||
gzip bzip2 xz bash coreutils diffutils findutils gawk
|
||||
gnumake gnused gnutar gnugrep gnupatch perl;
|
||||
|
@ -239,7 +239,7 @@ let
|
||||
# just the plain stdenv.
|
||||
stdenv_32bit = lowPrio (
|
||||
if system == "x86_64-linux" then
|
||||
overrideGCC stdenv gcc48_multi
|
||||
overrideCC stdenv gcc48_multi
|
||||
else
|
||||
stdenv);
|
||||
|
||||
@ -2624,7 +2624,7 @@ let
|
||||
torbutton = callPackage ../tools/security/torbutton { };
|
||||
|
||||
torbrowser = callPackage ../tools/security/tor/torbrowser.nix {
|
||||
stdenv = overrideGCC stdenv gcc49;
|
||||
stdenv = overrideCC stdenv gcc49;
|
||||
};
|
||||
|
||||
torsocks = callPackage ../tools/security/tor/torsocks.nix { };
|
||||
@ -3046,10 +3046,10 @@ let
|
||||
|
||||
ccl = callPackage ../development/compilers/ccl { };
|
||||
|
||||
clang = wrapGCC llvmPackages.clang;
|
||||
clang = wrapCC llvmPackages.clang;
|
||||
|
||||
clang_34 = wrapGCC llvmPackages_34.clang;
|
||||
clang_33 = wrapGCC (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix);
|
||||
clang_34 = wrapCC llvmPackages_34.clang;
|
||||
clang_33 = wrapCC (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix);
|
||||
|
||||
clangAnalyzer = callPackage ../development/tools/analysis/clang-analyzer {
|
||||
clang = clang_34;
|
||||
@ -3062,8 +3062,8 @@ let
|
||||
|
||||
clangSelf = clangWrapSelf llvmPackagesSelf.clang;
|
||||
|
||||
clangWrapSelf = build: (import ../build-support/gcc-wrapper) {
|
||||
gcc = build;
|
||||
clangWrapSelf = build: (import ../build-support/cc-wrapper) {
|
||||
cc = build;
|
||||
stdenv = clangStdenv;
|
||||
libc = glibc;
|
||||
binutils = binutils;
|
||||
@ -3074,8 +3074,8 @@ let
|
||||
};
|
||||
|
||||
#Use this instead of stdenv to build with clang
|
||||
clangStdenv = if stdenv.isDarwin then stdenv else lowPrio (stdenvAdapters.overrideGCC stdenv clang);
|
||||
libcxxStdenv = stdenvAdapters.overrideGCC stdenv (clangWrapSelf llvmPackages.clang);
|
||||
clangStdenv = if stdenv.isDarwin then stdenv else lowPrio (stdenvAdapters.overrideCC stdenv clang);
|
||||
libcxxStdenv = stdenvAdapters.overrideCC stdenv (clangWrapSelf llvmPackages.clang);
|
||||
|
||||
clean = callPackage ../development/compilers/clean { };
|
||||
|
||||
@ -3115,7 +3115,7 @@ let
|
||||
|
||||
gccApple = throw "gccApple is no longer supported";
|
||||
|
||||
gcc34 = wrapGCC (import ../development/compilers/gcc/3.4 {
|
||||
gcc34 = wrapCC (import ../development/compilers/gcc/3.4 {
|
||||
inherit fetchurl stdenv noSysDirs;
|
||||
});
|
||||
|
||||
@ -3177,14 +3177,14 @@ let
|
||||
cross = assert crossSystem != null; crossSystem;
|
||||
};
|
||||
|
||||
gcc44 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc/4.4) {
|
||||
gcc44 = lowPrio (wrapCC (makeOverridable (import ../development/compilers/gcc/4.4) {
|
||||
inherit fetchurl stdenv gmp mpfr /* ppl cloogppl */
|
||||
gettext which noSysDirs;
|
||||
texinfo = texinfo4;
|
||||
profiledCompiler = true;
|
||||
}));
|
||||
|
||||
gcc45 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.5 {
|
||||
gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
|
||||
inherit fetchurl stdenv gmp mpfr mpc libelf zlib perl
|
||||
gettext which noSysDirs;
|
||||
texinfo = texinfo4;
|
||||
@ -3207,7 +3207,7 @@ let
|
||||
else null;
|
||||
}));
|
||||
|
||||
gcc46 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.6 {
|
||||
gcc46 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.6 {
|
||||
inherit noSysDirs;
|
||||
|
||||
ppl = null;
|
||||
@ -3229,7 +3229,7 @@ let
|
||||
texinfo = texinfo413;
|
||||
}));
|
||||
|
||||
gcc48 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.8 {
|
||||
gcc48 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 {
|
||||
inherit noSysDirs;
|
||||
|
||||
# PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
|
||||
@ -3248,14 +3248,14 @@ let
|
||||
|
||||
gcc48_multi =
|
||||
if system == "x86_64-linux" then lowPrio (
|
||||
wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi (gcc48.gcc.override {
|
||||
stdenv = overrideGCC stdenv (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi gcc.gcc);
|
||||
wrapCCWith (import ../build-support/cc-wrapper) glibc_multi (gcc48.gcc.override {
|
||||
stdenv = overrideCC stdenv (wrapCCWith (import ../build-support/cc-wrapper) glibc_multi gcc.gcc);
|
||||
profiledCompiler = false;
|
||||
enableMultilib = true;
|
||||
}))
|
||||
else throw "Multilib gcc not supported on ‘${system}’";
|
||||
|
||||
gcc48_debug = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.8 {
|
||||
gcc48_debug = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.8 {
|
||||
stripped = false;
|
||||
|
||||
inherit noSysDirs;
|
||||
@ -3264,7 +3264,7 @@ let
|
||||
binutilsCross = null;
|
||||
}));
|
||||
|
||||
gcc49 = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.9 {
|
||||
gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 {
|
||||
inherit noSysDirs;
|
||||
|
||||
# PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
|
||||
@ -3283,7 +3283,7 @@ let
|
||||
|
||||
gfortran = gfortran48;
|
||||
|
||||
gfortran48 = wrapGCC (gcc48.gcc.override {
|
||||
gfortran48 = wrapCC (gcc48.cc.override {
|
||||
name = "gfortran";
|
||||
langFortran = true;
|
||||
langCC = false;
|
||||
@ -3293,7 +3293,7 @@ let
|
||||
|
||||
gcj = gcj48;
|
||||
|
||||
gcj48 = wrapGCC (gcc48.gcc.override {
|
||||
gcj48 = wrapCC (gcc48.cc.override {
|
||||
name = "gcj";
|
||||
langJava = true;
|
||||
langFortran = false;
|
||||
@ -3309,7 +3309,7 @@ let
|
||||
|
||||
gnat = gnat45; # failed to make 4.6 or 4.8 build
|
||||
|
||||
gnat45 = wrapGCC (gcc45.gcc.override {
|
||||
gnat45 = wrapCC (gcc45.cc.override {
|
||||
name = "gnat";
|
||||
langCC = false;
|
||||
langC = true;
|
||||
@ -3328,14 +3328,14 @@ let
|
||||
|
||||
gccgo = gccgo48;
|
||||
|
||||
gccgo48 = wrapGCC (gcc48.gcc.override {
|
||||
gccgo48 = wrapCC (gcc48.cc.override {
|
||||
name = "gccgo";
|
||||
langCC = true; #required for go.
|
||||
langC = true;
|
||||
langGo = true;
|
||||
});
|
||||
|
||||
ghdl = wrapGCC (import ../development/compilers/gcc/4.3 {
|
||||
ghdl = wrapCC (import ../development/compilers/gcc/4.3 {
|
||||
inherit stdenv fetchurl gmp mpfr noSysDirs gnat;
|
||||
texinfo = texinfo4;
|
||||
name = "ghdl";
|
||||
@ -4020,7 +4020,18 @@ let
|
||||
|
||||
win32hello = callPackage ../development/compilers/visual-c++/test { };
|
||||
|
||||
wrapGCCWith = gccWrapper: glibc: baseGCC: gccWrapper {
|
||||
wrapCCWith = ccWrapper: libc: baseCC: ccWrapper {
|
||||
nativeTools = stdenv.cc.nativeTools or false;
|
||||
nativeLibc = stdenv.cc.nativeLibc or false;
|
||||
nativePrefix = stdenv.cc.nativePrefix or "";
|
||||
cc = baseCC;
|
||||
libc = libc;
|
||||
inherit stdenv binutils coreutils zlib;
|
||||
};
|
||||
|
||||
wrapCC = wrapCCWith (makeOverridable (import ../build-support/cc-wrapper)) glibc;
|
||||
# legacy version, used for gnat bootstrapping
|
||||
wrapGCC-old = baseGCC: (makeOverridable (import ../build-support/gcc-wrapper-old)) {
|
||||
nativeTools = stdenv.cc.nativeTools or false;
|
||||
nativeLibc = stdenv.cc.nativeLibc or false;
|
||||
nativePrefix = stdenv.cc.nativePrefix or "";
|
||||
@ -4029,10 +4040,6 @@ let
|
||||
inherit stdenv binutils coreutils zlib;
|
||||
};
|
||||
|
||||
wrapGCC = wrapGCCWith (makeOverridable (import ../build-support/gcc-wrapper)) glibc;
|
||||
# legacy version, used for gnat bootstrapping
|
||||
wrapGCC-old = wrapGCCWith (makeOverridable (import ../build-support/gcc-wrapper-old)) glibc;
|
||||
|
||||
wrapGCCCross =
|
||||
{gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}:
|
||||
|
||||
@ -4361,7 +4368,7 @@ let
|
||||
|
||||
avrgcclibc = callPackage ../development/misc/avr-gcc-with-avr-libc {
|
||||
gcc = gcc46;
|
||||
stdenv = overrideGCC stdenv gcc46;
|
||||
stdenv = overrideCC stdenv gcc46;
|
||||
};
|
||||
|
||||
avr8burnomat = callPackage ../development/misc/avr8-burn-omat { };
|
||||
@ -4517,8 +4524,8 @@ let
|
||||
# };
|
||||
#
|
||||
ccacheWrapper = makeOverridable ({ extraConfig ? "" }:
|
||||
wrapGCC (ccache.links extraConfig)) {};
|
||||
ccacheStdenv = lowPrio (overrideGCC stdenv ccacheWrapper);
|
||||
wrapCC (ccache.links extraConfig)) {};
|
||||
ccacheStdenv = lowPrio (overrideCC stdenv ccacheWrapper);
|
||||
|
||||
cccc = callPackage ../development/tools/analysis/cccc { };
|
||||
|
||||
@ -4600,8 +4607,8 @@ let
|
||||
# };
|
||||
#
|
||||
distccWrapper = makeOverridable ({ extraConfig ? "" }:
|
||||
wrapGCC (distcc.links extraConfig)) {};
|
||||
distccStdenv = lowPrio (overrideGCC stdenv distccWrapper);
|
||||
wrapCC (distcc.links extraConfig)) {};
|
||||
distccStdenv = lowPrio (overrideCC stdenv distccWrapper);
|
||||
|
||||
distccMasquerade = if stdenv.isDarwin
|
||||
then null
|
||||
@ -4772,7 +4779,7 @@ let
|
||||
|
||||
phantomjs = callPackage ../development/tools/phantomjs {
|
||||
stdenv = if stdenv.isDarwin
|
||||
then overrideGCC stdenv gccApple
|
||||
then overrideCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -4925,7 +4932,7 @@ let
|
||||
# On Darwin, Valgrind 3.7.0 expects Apple's GCC (for
|
||||
# `__private_extern'.)
|
||||
if stdenv.isDarwin
|
||||
then overrideGCC stdenv gccApple
|
||||
then overrideCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -5243,7 +5250,7 @@ let
|
||||
vpxSupport = !stdenv.isMips;
|
||||
|
||||
stdenv = if stdenv.isDarwin
|
||||
then overrideGCC stdenv gccApple
|
||||
then overrideCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -6141,7 +6148,7 @@ let
|
||||
libmikmod = callPackage ../development/libraries/libmikmod {
|
||||
# resolve the "stray '@' in program" errors
|
||||
stdenv = if stdenv.isDarwin
|
||||
then overrideGCC stdenv gccApple
|
||||
then overrideCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -6250,7 +6257,7 @@ let
|
||||
|
||||
libproxy = callPackage ../development/libraries/libproxy {
|
||||
stdenv = if stdenv.isDarwin
|
||||
then overrideGCC stdenv gcc
|
||||
then overrideCC stdenv gcc
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -7072,7 +7079,7 @@ let
|
||||
|
||||
stfl = callPackage ../development/libraries/stfl {
|
||||
stdenv = if stdenv.isDarwin
|
||||
then overrideGCC stdenv gccApple
|
||||
then overrideCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -10213,7 +10220,7 @@ let
|
||||
irssi = callPackage ../applications/networking/irc/irssi {
|
||||
# compile with gccApple on darwin to support the -no-cpp-precompile flag
|
||||
stdenv = if stdenv.isDarwin
|
||||
then stdenvAdapters.overrideGCC stdenv gccApple
|
||||
then stdenvAdapters.overrideCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
@ -11542,7 +11549,7 @@ let
|
||||
xdotool = callPackage ../tools/X11/xdotool { };
|
||||
|
||||
xen = callPackage ../applications/virtualization/xen {
|
||||
stdenv = overrideGCC stdenv gcc45;
|
||||
stdenv = overrideCC stdenv gcc45;
|
||||
};
|
||||
|
||||
xfe = callPackage ../applications/misc/xfe {
|
||||
@ -11661,7 +11668,7 @@ let
|
||||
(let callPackage = newScope pkgs.zathuraCollection; in
|
||||
import ../applications/misc/zathura {
|
||||
inherit callPackage pkgs fetchurl;
|
||||
stdenv = overrideGCC stdenv gcc49;
|
||||
stdenv = overrideCC stdenv gcc49;
|
||||
useMupdf = config.zathura.useMupdf or false;
|
||||
});
|
||||
|
||||
@ -11673,7 +11680,7 @@ let
|
||||
|
||||
girara = callPackage ../applications/misc/girara {
|
||||
gtk = gtk3;
|
||||
stdenv = overrideGCC stdenv gcc49;
|
||||
stdenv = overrideCC stdenv gcc49;
|
||||
};
|
||||
|
||||
girara-light = callPackage ../applications/misc/girara {
|
||||
|
Loading…
Reference in New Issue
Block a user