aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/compilers/gcc/4.9
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/gcc/4.9')
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch24
2 files changed, 36 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix b/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
index f7fbe1ec554..98d4b61648e 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
@@ -11,7 +11,7 @@
, enableLTO ? true
, texinfo ? null
, 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)
, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
@@ -63,6 +63,7 @@ let majorVersion = "4";
patches =
[ ../use-source-date-epoch.patch ../parallel-bconfig.patch ./parallel-strsignal.patch
+ ./libsanitizer.patch
(fetchpatch {
name = "avoid-ustat-glibc-2.28.patch";
url = "https://gitweb.gentoo.org/proj/gcc-patches.git/plain/4.9.4/gentoo/100_all_avoid-ustat-glibc-2.28.patch?id=55fcb515620a8f7d3bb77eba938aa0fcf0d67c96";
@@ -172,11 +173,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
@@ -276,8 +280,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 = {
diff --git a/nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch b/nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch
new file mode 100644
index 00000000000..f1a438a4e5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch
@@ -0,0 +1,24 @@
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index aec950454..5bda9b3a3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -156,18 +156,13 @@ namespace __sanitizer {
+ #elif defined(__sparc__)
+ # if defined(__arch64__)
+ unsigned mode;
+- unsigned short __pad1;
+-# else
+- unsigned short __pad1;
+- unsigned short mode;
+ unsigned short __pad2;
+ # endif
+ unsigned short __seq;
+ unsigned long long __unused1;
+ unsigned long long __unused2;
+ #else
+- unsigned short mode;
+- unsigned short __pad1;
++ unsigned int mode;
+ unsigned short __seq;
+ unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)