aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/gcc/6/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/6/default.nix32
1 files changed, 20 insertions, 12 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/6/default.nix b/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
index 173ca128ee0..a2f034a4827 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
@@ -13,7 +13,7 @@
, texinfo ? null
, flex
, perl ? null # optional, for texi2pod (then pod2man); required for Java
-, gmp, mpfr, libmpc, gettext, which
+, gmp, mpfr, libmpc, gettext, which, patchelf
, libelf # optional, for link-time optimizations (LTO)
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
@@ -64,9 +64,9 @@ let majorVersion = "6";
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
- patches =
- [ ../use-source-date-epoch.patch ]
- ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
+ patches = optionals (!stdenv.targetPlatform.isRedox) [
+ ../use-source-date-epoch.patch ./0001-Fix-build-for-glibc-2.31.patch
+ ] ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch
@@ -120,6 +120,11 @@ stdenv.mkDerivation ({
repo = "gcc-vc4";
rev = "e90ff43f9671c760cf0d1dd62f569a0fb9bf8918";
sha256 = "0gxf66hwqk26h8f853sybphqa5ca0cva2kmrw5jsiv6139g0qnp8";
+ } else if stdenv.targetPlatform.isRedox then fetchFromGitHub {
+ owner = "redox-os";
+ repo = "gcc";
+ rev = "f360ac095028d286fc6dde4d02daed48f59813fa"; # `redox` branch
+ sha256 = "1an96h8l58pppyh3qqv90g8hgcfd9hj7igvh2gigmkxbrx94khfl";
} else fetchurl {
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
sha256 = "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby";
@@ -182,15 +187,18 @@ stdenv.mkDerivation ({
nativeBuildInputs = [ texinfo which gettext ]
++ (optional (perl != null) perl)
++ (optional javaAwtGtk pkgconfig)
- ++ (optional (stdenv.targetPlatform.isVc4) flex);
+ ++ (optional (with stdenv.targetPlatform; isVc4 || isRedox) flex);
# For building runtime libs
depsBuildTarget =
- if hostPlatform == buildPlatform then [
- targetPackages.stdenv.cc.bintools # newly-built gcc will be used
- ] else assert targetPlatform == hostPlatform; [ # build != host == target
- stdenv.cc
- ];
+ (
+ if hostPlatform == buildPlatform then [
+ targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+ ] else assert targetPlatform == hostPlatform; [ # build != host == target
+ stdenv.cc
+ ]
+ )
+ ++ optional targetPlatform.isLinux patchelf;
buildInputs = [
gmp mpfr libmpc libelf
@@ -292,8 +300,8 @@ stdenv.mkDerivation ({
(import ../common/extra-target-flags.nix {
inherit stdenv crossStageStatic libcCross threadsCross;
})
- EXTRA_TARGET_FLAGS
- EXTRA_TARGET_LDFLAGS
+ EXTRA_FLAGS_FOR_TARGET
+ EXTRA_LDFLAGS_FOR_TARGET
;
passthru = {