aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/gcc/7/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/7/default.nix21
1 files changed, 13 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/7/default.nix b/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
index 9153268a12b..6d066044ec1 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
@@ -10,7 +10,7 @@
, enableLTO ? true
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
-, 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
@@ -53,6 +53,8 @@ let majorVersion = "7";
./riscv-pthread-reentrant.patch
# https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00297.html
./riscv-no-relax.patch
+
+ ./0001-Fix-build-for-glibc-2.31.patch
]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optionals targetPlatform.isNetBSD [
@@ -156,11 +158,14 @@ stdenv.mkDerivation ({
# 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
@@ -247,8 +252,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 = {