diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index caab0b246801..863bf16cf613 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -6,7 +6,9 @@ let targetIsMips = stdenv.system == "mips64-linux" || (cross != null && cross.arch == "mips"); in stdenv.mkDerivation rec { - name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}"; + # In the case of targetIsMips we apply a version-bump patch + name = (if targetIsMips then "binutils-2.20.51" else + basename) + stdenv.lib.optionalString (cross != null) "-${cross.config}"; src = fetchurl { url = "mirror://gnu/binutils/${basename}.tar.bz2"; @@ -18,7 +20,11 @@ stdenv.mkDerivation rec { # RUNPATH instead of RPATH on binaries. This is important because # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime. ./new-dtags.patch - ] ++ stdenv.lib.optionals targetIsMips [ ./loongson2f.patch ./version-bump.patch ]; + ] + # For loongson2f (the only mips running nixos now) we need these patches for + # linux to build. It checks the binutils version, so we have even to udpate the + # version. + ++ stdenv.lib.optionals targetIsMips [ ./loongson2f.patch ./version-bump.patch ]; inherit noSysDirs; diff --git a/pkgs/development/tools/misc/binutils/loongson2f.patch b/pkgs/development/tools/misc/binutils/loongson2f.patch index 18d0634d1108..8b89b8fe1525 100644 --- a/pkgs/development/tools/misc/binutils/loongson2f.patch +++ b/pkgs/development/tools/misc/binutils/loongson2f.patch @@ -42,31 +42,6 @@ Subject: [PATCH] * config/tc-mips.c (mips_fix_loongson2f, mips_fix_loong create mode 100644 gas/testsuite/gas/mips/loongson-2f-3.d create mode 100644 gas/testsuite/gas/mips/loongson-2f-3.s -diff --git a/gas/ChangeLog b/gas/ChangeLog -index f35eb3a..6dca72b 100644 ---- a/gas/ChangeLog -+++ b/gas/ChangeLog -@@ -1,3 +1,20 @@ -+2010-02-25 Wu Zhangjin -+ -+ * config/tc-mips.c (mips_fix_loongson2f, mips_fix_loongson2f_nop, -+ mips_fix_loongson2f_jump): New variables. -+ (md_longopts): Add New options -mfix-loongson2f-nop/jump, -+ -mno-fix-loongson2f-nop/jump. -+ (md_parse_option): Initialize variables via above options. -+ (options): New enums for the above options. -+ (md_begin): Initialize nop_insn from LOONGSON2F_NOP_INSN. -+ (fix_loongson2f, fix_loongson2f_nop, fix_loongson2f_jump): -+ New functions. -+ (append_insn): call fix_loongson2f(). -+ (mips_handle_align): Replace the implicit nops. -+ * config/tc-mips.h (MAX_MEM_FOR_RS_ALIGN_CODE): Modified -+ for the new mips_handle_align(). -+ * doc/c-mips.texi: Document the new options. -+ - 2010-02-23 Daniel Gutson - - * config/tc-arm.c (do_rd_rm_rn): Added warning diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 94128fe..f901ae4 100644 --- a/gas/config/tc-mips.c @@ -363,22 +338,6 @@ index 34fa694..641e60f 100644 @item -mfix-vr4120 @itemx -mno-fix-vr4120 Insert nops to work around certain VR4120 errata. This option is -diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog -index 3ee595b..439e734 100644 ---- a/gas/testsuite/ChangeLog -+++ b/gas/testsuite/ChangeLog -@@ -1,3 +1,11 @@ -+2010-02-25 Wu Zhangjin -+ -+ * gas/mips/loongson-2f-2.s: New test of -mfix-loongson2f-nop. -+ * gas/mips/loongson-2f-2.d: Likewise. -+ * gas/mips/loongson-2f-3.s: New test of -mfix-loongson2f-jump. -+ * gas/mips/loongson-2f-3.d: Likewise. -+ * gas/mips/mips.exp: Run the new tests. -+ - 2010-02-24 Nick Clifton - - PR binutils/6773 diff --git a/gas/testsuite/gas/mips/loongson-2f-2.d b/gas/testsuite/gas/mips/loongson-2f-2.d new file mode 100644 index 0000000..f5267a8 @@ -502,18 +461,6 @@ index 14ce5cc..34bb5ea 100644 run_dump_test_arches "octeon" [mips_arch_list_matching octeon] run_list_test_arches "octeon-ill" "" \ -diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog -index 39cecde..549d565 100644 ---- a/include/opcode/ChangeLog -+++ b/include/opcode/ChangeLog -@@ -1,3 +1,7 @@ -+2010-02-25 Wu Zhangjin -+ -+ * mips.h: (LOONGSON2F_NOP_INSN): New macro. -+ - 2010-02-08 Philipp Tomsich - - * opcode/ppc.h (PPC_OPCODE_TITAN): Define. diff --git a/include/opcode/mips.h b/include/opcode/mips.h index 27d10e6..d6b3cf4 100644 --- a/include/opcode/mips.h diff --git a/pkgs/development/tools/misc/binutils/version-bump.patch b/pkgs/development/tools/misc/binutils/version-bump.patch index 5fc49865c523..3860570e8db2 100644 --- a/pkgs/development/tools/misc/binutils/version-bump.patch +++ b/pkgs/development/tools/misc/binutils/version-bump.patch @@ -1,29 +1,3 @@ -From 3ca360dab62f7008f42d835affe5c89144db3e07 Mon Sep 17 00:00:00 2001 -From: Tristan Gingold -Date: Fri, 4 Sep 2009 08:48:19 +0000 -Subject: [PATCH] bfd/ - 2009-09-04 Tristan Gingold - - * configure.in: Bump version to 2.20.51 - * configure: Regenerated. ---- - bfd/ChangeLog | 5 +++++ - bfd/configure.in | 2 +- - 2 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/bfd/ChangeLog b/bfd/ChangeLog -index 8a26fa4..8b0f252 100644 ---- a/bfd/ChangeLog -+++ b/bfd/ChangeLog -@@ -1,3 +1,8 @@ -+2009-09-04 Tristan Gingold -+ -+ * configure.in: Bump version to 2.20.51 -+ * configure: Regenerated. -+ - 2009-09-04 Alan Modra - - * elf32-spu.c (spu_elf_relocate_section): Correct 2009-07-24 logic. diff --git a/bfd/configure.in b/bfd/configure.in index 0a8d486..a3cc89a 100644 --- a/bfd/configure.in @@ -32,7 +6,7 @@ index 0a8d486..a3cc89a 100644 AC_CANONICAL_TARGET AC_ISC_POSIX --AM_INIT_AUTOMAKE(bfd, 2.19.51) +-AM_INIT_AUTOMAKE(bfd, 2.20.1) +AM_INIT_AUTOMAKE(bfd, 2.20.51) dnl These must be called before LT_INIT, because it may want