nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

Revert commits on binutils for OpenRISC 1000

This reverts commits
ebd89f6de1894f3c3d22e4bb8cb879be7e9556b3
c6f6db77ac53e84006353396283d271cb1b22460
257fb62387f1324a9cb75465dceb3d84eefc2b4d
dbe556af9cb9d00c6c50d76a1c1abade5455ab2f

authored by

luc65r and committed by
Frederik Rietdijk
3205b32b 5a25e3e7

+31 -290
+1 -1
pkgs/development/libraries/libbfd/default.nix
··· 10 10 outputs = [ "out" "dev" ]; 11 11 12 12 patches = binutils-unwrapped.patches ++ [ 13 - (binutils-unwrapped.patchesDir + "/build-components-separately.patch") 13 + ../../tools/misc/binutils/build-components-separately.patch 14 14 (fetchpatch { 15 15 url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch"; 16 16 sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
+1 -1
pkgs/development/libraries/libopcodes/default.nix
··· 10 10 outputs = [ "out" "dev" ]; 11 11 12 12 patches = binutils-unwrapped.patches ++ [ 13 - (binutils-unwrapped.patchesDir + "/build-components-separately.patch") 13 + ../../tools/misc/binutils/build-components-separately.patch 14 14 ]; 15 15 16 16 # We just want to build libopcodes
+29 -54
pkgs/development/tools/misc/binutils/default.nix
··· 8 8 , bison ? null 9 9 , flex 10 10 , texinfo 11 - , perl 12 11 }: 13 12 14 13 # Note: this package is used for bootstrapping fetchurl, and thus ··· 21 22 # Remove gold-symbol-visibility patch when updating, the proper fix 22 23 # is now upstream. 23 24 # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=330b90b5ffbbc20c5de6ae6c7f60c40fab2e7a4f;hp=99181ccac0fc7d82e7dabb05dc7466e91f1645d3 24 - version = "${minorVersion}${patchVersion}"; 25 - minorVersion = if stdenv.targetPlatform.isOr1k then "2.34" else "2.31"; 26 - patchVersion = if stdenv.targetPlatform.isOr1k then "" else ".1"; 27 - 25 + version = "2.31.1"; 28 26 basename = "binutils"; 29 27 # The targetPrefix prepended to binary names to allow multiple binuntils on the 30 28 # PATH to both be usable. ··· 33 37 rev = "708acc851880dbeda1dd18aca4fd0a95b2573b36"; 34 38 sha256 = "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63"; 35 39 }; 36 - 37 - # binutils sources not part of the bootstrap. 38 - non-boot-src = (fetchurl { 39 - url = "mirror://gnu/binutils/${basename}-${version}.tar.bz2"; 40 - sha256 = { 41 - "2.31.1" = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z"; 42 - "2.34" = "1rin1f5c7wm4n3piky6xilcrpf2s0n3dd5vqq8irrxkcic3i1w49"; 43 - }.${version}; 44 - }); 45 - 46 40 # HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM 47 - normal-src = stdenv.__bootPackages.binutils-unwrapped.src or non-boot-src; 48 - 49 - # Platforms where we directly use the final source. 50 - # Generally for cross-compiled platforms, where the boot source won't compile. 51 - skipBootSrc = stdenv.targetPlatform.isOr1k; 52 - 53 - # Select the specific source according to the platform in use. 54 - src = if stdenv.targetPlatform.isVc4 then vc4-binutils-src 55 - else if skipBootSrc then non-boot-src 56 - else normal-src; 57 - 58 - patchesDir = ./patches + "/${minorVersion}"; 41 + normal-src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl { 42 + url = "mirror://gnu/binutils/${basename}-${version}.tar.bz2"; 43 + sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z"; 44 + }); 59 45 in 60 46 61 47 stdenv.mkDerivation { 62 48 pname = targetPrefix + basename; 63 - inherit src version; 49 + inherit version; 50 + 51 + src = if stdenv.targetPlatform.isVc4 then vc4-binutils-src else normal-src; 64 52 65 53 patches = [ 66 54 # Make binutils output deterministic by default. 67 - "${patchesDir}/deterministic.patch" 55 + ./deterministic.patch 68 56 69 57 # Bfd looks in BINDIR/../lib for some plugins that don't 70 58 # exist. This is pointless (since users can't install plugins 71 59 # there) and causes a cycle between the lib and bin outputs, so 72 60 # get rid of it. 73 - "${patchesDir}/no-plugins.patch" 61 + ./no-plugins.patch 74 62 75 63 # Help bfd choose between elf32-littlearm, elf32-littlearm-symbian, and 76 64 # elf32-littlearm-vxworks in favor of the first. 77 65 # https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766 78 - "${patchesDir}/disambiguate-arm-targets.patch" 66 + ./disambiguate-arm-targets.patch 79 67 80 68 # For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's 81 69 # not clear why this behavior was decided upon but it has the unfortunate ··· 67 87 # shared objects when cross-compiling. Consequently, we are forced to 68 88 # override this behavior, forcing ld to search DT_RPATH even when 69 89 # cross-compiling. 70 - "${patchesDir}/always-search-rpath.patch" 71 - ] 72 - # For version 2.31 exclusively 73 - ++ lib.optionals (!stdenv.targetPlatform.isVc4 && minorVersion == "2.31") [ 90 + ./always-search-rpath.patch 91 + 92 + ] ++ lib.optionals (!stdenv.targetPlatform.isVc4) 93 + [ 74 94 # https://sourceware.org/bugzilla/show_bug.cgi?id=22868 75 - ./patches/2.31/gold-symbol-visibility.patch 95 + ./gold-symbol-visibility.patch 76 96 77 97 # https://sourceware.org/bugzilla/show_bug.cgi?id=23428 78 98 # un-break features so linking against musl doesn't produce crash-only binaries 79 - ./patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch 80 - ./patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch 81 - ./patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch 82 - ] 83 - ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch 84 - ++ # This patch was suggested by Nick Clifton to fix 85 - # https://sourceware.org/bugzilla/show_bug.cgi?id=16177 86 - # It can be removed when that 7-year-old bug is closed. 87 - # This binutils bug causes GHC to emit broken binaries on armv7, and 88 - # indeed GHC will refuse to compile with a binutils suffering from it. See 89 - # this comment for more information: 90 - # https://gitlab.haskell.org/ghc/ghc/issues/4210#note_78333 91 - lib.optional stdenv.targetPlatform.isAarch32 ./R_ARM_COPY.patch 92 - ; 99 + ./0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch 100 + ./0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch 101 + ./0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch 102 + ] ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch 103 + ++ # This patch was suggested by Nick Clifton to fix 104 + # https://sourceware.org/bugzilla/show_bug.cgi?id=16177 105 + # It can be removed when that 7-year-old bug is closed. 106 + # This binutils bug causes GHC to emit broken binaries on armv7, and 107 + # indeed GHC will refuse to compile with a binutils suffering from it. See 108 + # this comment for more information: 109 + # https://gitlab.haskell.org/ghc/ghc/issues/4210#note_78333 110 + lib.optional stdenv.targetPlatform.isAarch32 ./R_ARM_COPY.patch; 93 111 94 112 outputs = [ "out" "info" "man" ]; 95 113 96 114 depsBuildBuild = [ buildPackages.stdenv.cc ]; 97 115 nativeBuildInputs = [ 98 116 bison 99 - ] ++ lib.optionals (lib.versionAtLeast version "2.34") [ 100 - perl 101 - texinfo 102 117 ] ++ (lib.optionals stdenv.targetPlatform.isiOS [ 103 118 autoreconfHook 104 119 ]) ++ lib.optionals stdenv.targetPlatform.isVc4 [ texinfo flex ]; ··· 157 182 enableParallelBuilding = true; 158 183 159 184 passthru = { 160 - inherit targetPrefix patchesDir; 185 + inherit targetPrefix; 161 186 }; 162 187 163 188 meta = with lib; {
pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
pkgs/development/tools/misc/binutils/patches/2.31/always-search-rpath.patch pkgs/development/tools/misc/binutils/always-search-rpath.patch
pkgs/development/tools/misc/binutils/patches/2.31/build-components-separately.patch pkgs/development/tools/misc/binutils/build-components-separately.patch
pkgs/development/tools/misc/binutils/patches/2.31/deterministic.patch pkgs/development/tools/misc/binutils/deterministic.patch
pkgs/development/tools/misc/binutils/patches/2.31/disambiguate-arm-targets.patch pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch
pkgs/development/tools/misc/binutils/patches/2.31/gold-symbol-visibility.patch pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch
pkgs/development/tools/misc/binutils/patches/2.31/no-plugins.patch pkgs/development/tools/misc/binutils/no-plugins.patch
-14
pkgs/development/tools/misc/binutils/patches/2.34/always-search-rpath.patch
··· 1 - diff --git a/ld/genscripts.sh b/ld/genscripts.sh 2 - index b6940d376d..0feb1adfd0 100755 3 - --- a/ld/genscripts.sh 4 - +++ b/ld/genscripts.sh 5 - @@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then 6 - USE_LIBPATH=yes 7 - fi 8 - 9 - +# TODO: why is this needed? 10 - +USE_LIBPATH=yes 11 - + 12 - # Set the library search path, for libraries named by -lfoo. 13 - # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used. 14 - # Otherwise, the default is set here.
-164
pkgs/development/tools/misc/binutils/patches/2.34/build-components-separately.patch
··· 1 - diff --git a/bfd/configure.ac b/bfd/configure.ac 2 - index c5bfbd5d..45ad4c26 100644 3 - --- a/bfd/configure.ac 4 - +++ b/bfd/configure.ac 5 - @@ -278,31 +278,19 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed, 6 - 7 - LT_LIB_M 8 - 9 - -# When building a shared libbfd, link against the pic version of libiberty 10 - -# so that apps that use libbfd won't need libiberty just to satisfy any 11 - -# libbfd references. 12 - -# We can't do that if a pic libiberty is unavailable since including non-pic 13 - -# code would insert text relocations into libbfd. 14 - SHARED_LIBADD= 15 - -SHARED_LDFLAGS= 16 - +SHARED_LDFLAGS=-liberty 17 - if test "$enable_shared" = "yes"; then 18 - -changequote(,)dnl 19 - - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` 20 - -changequote([,])dnl 21 - - if test -n "$x"; then 22 - - SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" 23 - - fi 24 - - 25 - case "${host}" in 26 - # More hacks to build DLLs on Windows. 27 - *-*-cygwin*) 28 - SHARED_LDFLAGS="-no-undefined" 29 - - SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" 30 - + SHARED_LIBADD="-liberty -lintl -lcygwin -lkernel32" 31 - ;; 32 - 33 - # Use built-in libintl on macOS, since it is not provided by libc. 34 - *-*-darwin*) 35 - - SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl" 36 - + SHARED_LIBADD="-liberty -lintl" 37 - ;; 38 - esac 39 - 40 - diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am 41 - index 4f06074a..6836c589 100644 42 - --- a/opcodes/Makefile.am 43 - +++ b/opcodes/Makefile.am 44 - @@ -51,7 +51,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir) 45 - endif 46 - 47 - # This is where bfd.h lives. 48 - -BFD_H = ../bfd/bfd.h 49 - +BFD_H = $(BFDDIR)/bfd.h 50 - 51 - BUILD_LIBS = @BUILD_LIBS@ 52 - BUILD_LIB_DEPS = @BUILD_LIB_DEPS@ 53 - @@ -301,7 +301,7 @@ OFILES = @BFD_MACHINES@ 54 - # development.sh is used to determine -Werror default. 55 - CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh 56 - 57 - -AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@ 58 - +AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@ 59 - 60 - disassemble.lo: disassemble.c 61 - if am__fastdepCC 62 - @@ -322,12 +322,21 @@ libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c 63 - # old version of libbfd, or to pick up libbfd for the wrong architecture 64 - # if host != build. So for building with shared libraries we use a 65 - # hardcoded path to libbfd.so instead of relying on the entries in libbfd.la. 66 - -libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ 67 - +libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion 68 - libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@ 69 - -libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@ 70 - +libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ 71 - # Allow dependency tracking to work on all the source files. 72 - EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES) 73 - 74 - +libtool-soversion: 75 - + @echo "creating $@" 76 - + bfd_soversion="$(VERSION)" ;\ 77 - + . $(BFDDIR)/development.sh ;\ 78 - + if test "$$development" = true ; then \ 79 - + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ 80 - + fi ;\ 81 - + echo "$${bfd_soversion}" > $@ 82 - + 83 - # libtool will build .libs/libopcodes.a. We create libopcodes.a in 84 - # the build directory so that we don't have to convert all the 85 - # programs that use libopcodes.a simultaneously. This is a hack which 86 - diff --git a/opcodes/configure.ac b/opcodes/configure.ac 87 - index 00be9c88..6e589ae4 100644 88 - --- a/opcodes/configure.ac 89 - +++ b/opcodes/configure.ac 90 - @@ -86,6 +86,7 @@ AC_PROG_INSTALL 91 - 92 - AC_CHECK_HEADERS(string.h strings.h stdlib.h limits.h) 93 - ACX_HEADER_STRING 94 - +GCC_HEADER_STDINT(bfd_stdint.h) 95 - 96 - AC_CHECK_DECLS([basename, stpcpy]) 97 - 98 - @@ -137,61 +138,27 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed, 99 - 100 - LT_LIB_M 101 - 102 - -#Libs for generator progs 103 - -if test "x$cross_compiling" = "xno"; then 104 - - BUILD_LIBS=../libiberty/libiberty.a 105 - - BUILD_LIB_DEPS=$BUILD_LIBS 106 - -else 107 - - # if cross-compiling, assume that the system provides -liberty 108 - - # and that the version is compatible with new headers. 109 - - BUILD_LIBS=-liberty 110 - - BUILD_LIB_DEPS= 111 - -fi 112 - -BUILD_LIBS="$BUILD_LIBS $LIBINTL" 113 - -BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP" 114 - +BUILD_LIBS="-liberty $LIBINTL" 115 - +BUILD_LIB_DEPS="$LIBINTL_DEP" 116 - 117 - AC_SUBST(BUILD_LIBS) 118 - AC_SUBST(BUILD_LIB_DEPS) 119 - 120 - # Horrible hacks to build DLLs on Windows and a shared library elsewhere. 121 - SHARED_LDFLAGS= 122 - -SHARED_LIBADD= 123 - +SHARED_LIBADD=-liberty 124 - SHARED_DEPENDENCIES= 125 - if test "$enable_shared" = "yes"; then 126 - -# When building a shared libopcodes, link against the pic version of libiberty 127 - -# so that apps that use libopcodes won't need libiberty just to satisfy any 128 - -# libopcodes references. 129 - -# We can't do that if a pic libiberty is unavailable since including non-pic 130 - -# code would insert text relocations into libopcodes. 131 - # Note that linking against libbfd as we do here, which is itself linked 132 - # against libiberty, may not satisfy all the libopcodes libiberty references 133 - # since libbfd may not pull in the entirety of libiberty. 134 - -changequote(,)dnl 135 - - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` 136 - -changequote([,])dnl 137 - - if test -n "$x"; then 138 - - SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" 139 - - fi 140 - - 141 - case "${host}" in 142 - *-*-cygwin*) 143 - SHARED_LDFLAGS="-no-undefined" 144 - - SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" 145 - + SHARED_LIBADD="-lbfd -liberty -lintl -lcygwin" 146 - ;; 147 - - *-*-darwin*) 148 - - SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" 149 - - SHARED_DEPENDENCIES="../bfd/libbfd.la" 150 - - ;; 151 - *) 152 - - case "$host_vendor" in 153 - - hp) 154 - - SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}" 155 - - ;; 156 - - *) 157 - - SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}" 158 - - ;; 159 - - esac 160 - - SHARED_DEPENDENCIES="../bfd/libbfd.la" 161 - + SHARED_LIBADD="-lbfd ${SHARED_LIBADD}" 162 - ;; 163 - esac 164 -
-12
pkgs/development/tools/misc/binutils/patches/2.34/deterministic.patch
··· 1 - diff -ur orig/binutils-2.23.1/ld/ldlang.c binutils-2.23.1/ld/ldlang.c 2 - --- orig/ld/ldlang.c 3 - +++ new/ld/ldlang.c 4 - @@ -3095,6 +3095,8 @@ 5 - ldfile_output_machine)) 6 - einfo (_("%P%F:%s: can not set architecture: %E\n"), name); 7 - 8 - + link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT; 9 - + 10 - link_info.hash = bfd_link_hash_table_create (link_info.output_bfd); 11 - if (link_info.hash == NULL) 12 - einfo (_("%P%F: can not create hash table: %E\n"));
-23
pkgs/development/tools/misc/binutils/patches/2.34/disambiguate-arm-targets.patch
··· 1 - diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c 2 - index 9f956d3..f5b61f1 100644 3 - --- a/bfd/elf32-arm.c 4 - +++ b/bfd/elf32-arm.c 5 - @@ -19585,7 +19585,10 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker) 6 - #undef ELF_MAXPAGESIZE 7 - #define ELF_MAXPAGESIZE 0x1000 8 - 9 - +/* Prioritize elf32-*arm (priority 1) over elf32-*arm-vxworks (priority 2) */ 10 - +#define elf_match_priority 2 11 - #include "elf32-target.h" 12 - +#undef elf_match_priority 13 - 14 - 15 - /* Merge backend specific data from an object file to the output 16 - @@ -19974,4 +19977,7 @@ elf32_arm_symbian_plt_sym_val (bfd_vma i, const asection *plt, 17 - #undef ELF_MAXPAGESIZE 18 - #define ELF_MAXPAGESIZE 0x8000 19 - 20 - +/* Prioritize elf32-*arm (priority 1) over elf32-*arm-symbian (priority 2) */ 21 - +#define elf_match_priority 2 22 - #include "elf32-target.h" 23 - +#undef elf_match_priority
-21
pkgs/development/tools/misc/binutils/patches/2.34/no-plugins.patch
··· 1 - diff --git a/bfd/plugin.c b/bfd/plugin.c 2 - index 537ab60311..bfe7957f96 100644 3 - --- a/bfd/plugin.c 4 - +++ b/bfd/plugin.c 5 - @@ -386,6 +386,7 @@ load_plugin (bfd *abfd) 6 - if (plugin_program_name == NULL) 7 - return found; 8 - 9 - +#if 0 10 - /* Try not to search the same dir twice, by looking at st_dev and 11 - st_ino for the dir. If we are on a file system that always sets 12 - st_ino to zero or the actual st_ino is zero we might waste some 13 - @@ -437,7 +438,7 @@ load_plugin (bfd *abfd) 14 - if (found) 15 - break; 16 - } 17 - - 18 - +#endif 19 - return found; 20 - } 21 -