diff --git a/mingw-w64-binutils/0001-enable-gold-on.mingw32.patch b/mingw-w64-binutils/0001-enable-gold-on.mingw32.patch new file mode 100644 index 0000000000..a6fcd420a0 --- /dev/null +++ b/mingw-w64-binutils/0001-enable-gold-on.mingw32.patch @@ -0,0 +1,25 @@ +--- binutils-2.23.1/configure.orig 2013-03-24 23:12:45 +0400 ++++ binutils-2.23.1/configure 2013-03-24 23:30:06 +0400 +@@ -2865,6 +2865,7 @@ + yes|default) + # Check for ELF target. + is_elf=no ++ is_pe=no + case "${target}" in + *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ + | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ +@@ -2876,10 +2877,12 @@ + *) + is_elf=yes + ;; +- esac ++ esac;; ++ *-*-mingw*) ++ is_pe=yes;; + esac + +- if test "$is_elf" = "yes"; then ++ if test "$is_elf" = "yes" -o "$is_pe" = "yes"; then + # Check for target supported by gold. + case "${target}" in + i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) diff --git a/mingw-w64-binutils/0002-check-for-unusual-file-harder.patch b/mingw-w64-binutils/0002-check-for-unusual-file-harder.patch new file mode 100644 index 0000000000..81524f3a41 --- /dev/null +++ b/mingw-w64-binutils/0002-check-for-unusual-file-harder.patch @@ -0,0 +1,109 @@ +Configure scripts tend to do things like this: +nm -B /dev/null +which, on Windows, turn into: +nm -B nul +and nul here acts like a normal file with 0 size as far as stat() is concerned. +Check harder for the file in question being unusual (isatty() does see that). +And since configure script expects /dev/nul, do report it that way. + +--- binutils-git-39d1b2aef3c1dbbf31d82e555624afcbda9d58e7/binutils/bucomm.c.orig 2014-04-27 18:05:31.328777900 +0400 ++++ binutils-git-39d1b2aef3c1dbbf31d82e555624afcbda9d58e7/binutils/bucomm.c 2014-05-02 08:54:46.651964974 +0400 +@@ -570,7 +570,15 @@ + get_file_size (const char * file_name) + { + struct stat statbuf; +- ++ int f, t; ++ t = -1; ++ f = open (file_name, O_RDONLY | O_BINARY); ++ if (f != 0) ++ { ++ t = isatty (f); ++ close (f); ++ } ++ + if (stat (file_name, &statbuf) < 0) + { + if (errno == ENOENT) +@@ -579,8 +587,15 @@ + non_fatal (_("Warning: could not locate '%s'. reason: %s"), + file_name, strerror (errno)); + } +- else if (! S_ISREG (statbuf.st_mode)) +- non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); ++ else if (! S_ISREG (statbuf.st_mode) || t > 0) ++ { ++#ifdef _WIN32 ++ /* libtool passes /dev/null and checks for /dev/null in the output */ ++ if (stricmp (file_name, "nul") == 0) ++ file_name = "/dev/null"; ++#endif ++ non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); ++ } + else if (statbuf.st_size < 0) + non_fatal (_("Warning: '%s' has negative size, probably it is too large"), + file_name); +--- binutils-git-39d1b2aef3c1dbbf31d82e555624afcbda9d58e7/binutils/elfedit.c.orig 2014-04-27 18:05:31.340778000 +0400 ++++ binutils-git-39d1b2aef3c1dbbf31d82e555624afcbda9d58e7/binutils/elfedit.c 2014-05-02 08:55:09.433461424 +0400 +@@ -441,6 +441,14 @@ + check_file (const char *file_name, struct stat *statbuf_p) + { + struct stat statbuf; ++ int f, t; ++ t = -1; ++ f = open (file_name, O_RDONLY | O_BINARY); ++ if (f != 0) ++ { ++ t = isatty (f); ++ close (f); ++ } + + if (statbuf_p == NULL) + statbuf_p = &statbuf; +@@ -455,8 +463,13 @@ + return 1; + } + +- if (! S_ISREG (statbuf_p->st_mode)) ++ if (! S_ISREG (statbuf_p->st_mode) || t > 0) + { ++#ifdef _WIN32 ++ /* libtool passes /dev/null and checks for /dev/null in the output */ ++ if (stricmp (file_name, "nul") == 0) ++ file_name = "/dev/null"; ++#endif + error (_("'%s' is not an ordinary file\n"), file_name); + return 1; + } +--- binutils-git-39d1b2aef3c1dbbf31d82e555624afcbda9d58e7/binutils/readelf.c.orig 2014-04-27 18:05:31.384778200 +0400 ++++ binutils-git-39d1b2aef3c1dbbf31d82e555624afcbda9d58e7/binutils/readelf.c 2014-05-02 08:55:27.018918502 +0400 +@@ -14613,6 +14613,14 @@ + struct stat statbuf; + char armag[SARMAG]; + int ret; ++ int f, t; ++ t = -1; ++ f = open (file_name, O_RDONLY | O_BINARY); ++ if (f != 0) ++ { ++ t = isatty (f); ++ close (f); ++ } + + if (stat (file_name, &statbuf) < 0) + { +@@ -14624,8 +14632,13 @@ + return 1; + } + +- if (! S_ISREG (statbuf.st_mode)) ++ if (! S_ISREG (statbuf.st_mode) || t > 0) + { ++#ifdef _WIN32 ++ /* libtool passes /dev/null and checks for /dev/null in the output */ ++ if (stricmp (file_name, "nul") == 0) ++ file_name = "/dev/null"; ++#endif + error (_("'%s' is not an ordinary file\n"), file_name); + return 1; + } diff --git a/mingw-w64-binutils/0003-enable-shared-bfd.all.patch b/mingw-w64-binutils/0003-enable-shared-bfd.all.patch new file mode 100644 index 0000000000..53963df6e9 --- /dev/null +++ b/mingw-w64-binutils/0003-enable-shared-bfd.all.patch @@ -0,0 +1,11 @@ +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/bfd/Makefile.am.orig 2014-07-18 11:36:49.741468877 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/bfd/Makefile.am 2014-07-18 11:37:08.041610089 +0400 +@@ -27,7 +27,7 @@ + + bfddocdir = doc + +-libbfd_la_LDFLAGS = ++libbfd_la_LDFLAGS = -no-undefined + if INSTALL_LIBBFD + bfdlibdir = @bfdlibdir@ + bfdincludedir = @bfdincludedir@ diff --git a/mingw-w64-binutils/0003-link-to-libibtl-and-libiberty.mingw.patch b/mingw-w64-binutils/0003-link-to-libibtl-and-libiberty.mingw.patch new file mode 100644 index 0000000000..8060f62568 --- /dev/null +++ b/mingw-w64-binutils/0003-link-to-libibtl-and-libiberty.mingw.patch @@ -0,0 +1,48 @@ +--- gdb-7.6/bfd/Makefile.am.orig 2013-06-12 01:07:47 +0400 ++++ gdb-7.6/bfd/Makefile.am 2013-06-12 01:06:59 +0400 +@@ -826,6 +826,8 @@ + + ofiles: stamp-ofiles ; @true + ++LIBIBERTY = ../libiberty/libiberty.a ++ + # Since BFD64_LIBS is optional and we can't have substitution in + # libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead. + # However, list all sources in EXTRA_libbfd_la_SOURCES so the +@@ -833,6 +835,6 @@ + EXTRA_libbfd_la_SOURCES = $(CFILES) + libbfd_la_DEPENDENCIES = $(OFILES) ofiles + libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) +-libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ ++libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ -Wl,--whole-archive -Wl,$(LIBIBERTY) -Wl,$(LIBINTL) -Wl,--no-whole-archive + + # libtool will build .libs/libbfd.a. We create libbfd.a in the build +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/bfd/Makefile.in.orig 2014-07-23 15:07:57.487590651 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/bfd/Makefile.in 2014-07-23 15:09:45.500342237 +0400 +@@ -342,7 +342,7 @@ + SUBDIRS = doc po + bfddocdir = doc + libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \ +- @SHARED_LDFLAGS@ $(am__empty) ++ @SHARED_LDFLAGS@ $(am__empty) -no-undefined -Wl,--whole-archive -Wl,$(LIBIBERTY) -Wl,$(LIBINTL) -Wl,--no-whole-archive + @INSTALL_LIBBFD_TRUE@bfdlib_LTLIBRARIES = libbfd.la + @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) + @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ +@@ -1097,6 +1097,8 @@ + # bfd64_libs Routines for 64bit support + OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@ + ++LIBIBERTY = ../libiberty/libiberty.a ++ + # Since BFD64_LIBS is optional and we can't have substitution in + # libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead. + # However, list all sources in EXTRA_libbfd_la_SOURCES so the +@@ -1104,7 +1106,7 @@ + libbfd_la_SOURCES = $(BFD32_LIBS_CFILES) + EXTRA_libbfd_la_SOURCES = $(CFILES) + libbfd_la_DEPENDENCIES = $(OFILES) ofiles +-libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) ++libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) + + # libtool will build .libs/libbfd.a. We create libbfd.a in the build + # directory so that we don't have to convert all the programs that use diff --git a/mingw-w64-binutils/0004-libiberty-la.mingw.patch b/mingw-w64-binutils/0004-libiberty-la.mingw.patch new file mode 100644 index 0000000000..840663bdf8 --- /dev/null +++ b/mingw-w64-binutils/0004-libiberty-la.mingw.patch @@ -0,0 +1,44 @@ +--- /dev/null 2013-06-12 02:15:38 +0400 ++++ gdb-7.6/libiberty/libiberty.la 2013-06-12 02:15:09 +0400 +@@ -0,0 +1,41 @@ ++# libiberty.la - a libtool library file ++# Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a ++# ++# Please DO NOT delete this file! ++# It is necessary for linking the library. ++ ++# The name that we can dlopen(3). ++dlname='' ++ ++# Names of this library. ++library_names='libiberty.a' ++ ++# The name of the static archive. ++old_library='libiberty.a' ++ ++# Linker flags that can not go in dependency_libs. ++inherited_linker_flags='' ++ ++# Libraries that this one depends upon. ++dependency_libs='' ++ ++# Names of additional weak libraries provided by this library ++weak_library_names='' ++ ++# Version information for libiberty. ++current=0 ++age=0 ++revision=0 ++ ++# Is this an already installed library? ++installed=no ++ ++# Should we warn about portability when linking against -modules? ++shouldnotlink=no ++ ++# Files to dlopen/dlpreopen ++dlopen='' ++dlpreopen='' ++ ++# Directory that this library needs to be installed in: ++libdir='/mingw/lib' diff --git a/mingw-w64-binutils/0005-shared-opcodes.mingw.patch b/mingw-w64-binutils/0005-shared-opcodes.mingw.patch new file mode 100644 index 0000000000..988d541eae --- /dev/null +++ b/mingw-w64-binutils/0005-shared-opcodes.mingw.patch @@ -0,0 +1,58 @@ +--- gdb-7.6/opcodes/configure.ac.orig 2013-06-12 03:06:00 +0400 ++++ gdb-7.6/opcodes/configure.ac 2013-06-12 03:21:13 +0400 +@@ -165,11 +165,17 @@ + SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" + fi + ++ LCLINK="-Wl,-lc," + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" + ;; ++ *-*-mingw*) ++ SHARED_LDFLAGS="-no-undefined" ++ SHARED_LIBADD="-L`pwd`/../bfd -lbfd" ++ LCLINK= ++ ;; + *-*-darwin*) + SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" + SHARED_DEPENDENCIES="../bfd/libbfd.la" +@@ -192,7 +198,7 @@ + if test x"$bfd_cv_ld_as_needed" = xyes; then + # Link against libm only when needed. Put -lc, -lm inside -Wl + # to stop libtool reordering these options. +- SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed" ++ SHARED_LIBADD="$SHARED_LIBADD $LCLINK--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed" + else + SHARED_LIBADD="$SHARED_LIBADD $LIBM" + fi +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/opcodes/configure.orig 2014-07-23 14:30:36.728008438 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/opcodes/configure 2014-07-23 14:33:32.145230981 +0400 +@@ -12453,11 +12453,17 @@ + SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" + fi + ++ LCLINK="-Wl,-lc," + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" + ;; ++ *-*-mingw*) ++ SHARED_LDFLAGS="-no-undefined" ++ SHARED_LIBADD="-L`pwd`/../bfd -lbfd" ++ LCLINK= ++ ;; + *-*-darwin*) + SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" + SHARED_DEPENDENCIES="../bfd/libbfd.la" +@@ -12480,7 +12486,7 @@ + if test x"$bfd_cv_ld_as_needed" = xyes; then + # Link against libm only when needed. Put -lc, -lm inside -Wl + # to stop libtool reordering these options. +- SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed" ++ SHARED_LIBADD="$SHARED_LIBADD $LCLINK--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed" + else + SHARED_LIBADD="$SHARED_LIBADD $LIBM" + fi diff --git a/mingw-w64-binutils/0008-fix-libiberty-makefile.mingw.patch b/mingw-w64-binutils/0008-fix-libiberty-makefile.mingw.patch new file mode 100644 index 0000000000..1e8847c5f6 --- /dev/null +++ b/mingw-w64-binutils/0008-fix-libiberty-makefile.mingw.patch @@ -0,0 +1,43 @@ +--- gdb-7.6/libiberty/Makefile.in.orig 2013-06-12 04:27:21 +0400 ++++ gdb-7.6/libiberty/Makefile.in 2013-06-12 04:35:26 +0400 +@@ -129,7 +129,7 @@ + dwarfnames.c dyn-string.c \ + fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c \ + fnmatch.c fopen_unlocked.c \ +- getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \ ++ getcwd.c getpagesize.c getpwd.c getruntime.c \ + gettimeofday.c \ + hashtab.c hex.c \ + index.c insque.c \ +@@ -154,8 +154,8 @@ + strtoul.c strndup.c strnlen.c strverscmp.c \ + timeval-utils.c tmpnam.c \ + unlink-if-ordinary.c \ +- vasprintf.c vfork.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \ +- waitpid.c \ ++ vasprintf.c vfprintf.c vprintf.c vsnprintf.c vsprintf.c \ ++ msdos.c \ + xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c \ + xstrndup.c + +@@ -171,7 +171,7 @@ + ./fdmatch.$(objext) ./fibheap.$(objext) \ + ./filename_cmp.$(objext) ./floatformat.$(objext) \ + ./fnmatch.$(objext) ./fopen_unlocked.$(objext) \ +- ./getopt.$(objext) ./getopt1.$(objext) ./getpwd.$(objext) \ ++ ./getpwd.$(objext) \ + ./getruntime.$(objext) ./hashtab.$(objext) ./hex.$(objext) \ + ./lbasename.$(objext) ./lrealpath.$(objext) \ + ./make-relative-prefix.$(objext) ./make-temp-file.$(objext) \ +@@ -220,9 +220,9 @@ + ./strrchr.$(objext) ./strstr.$(objext) ./strtod.$(objext) \ + ./strtol.$(objext) ./strtoul.$(objext) ./strverscmp.$(objext) \ + ./tmpnam.$(objext) \ +- ./vasprintf.$(objext) ./vfork.$(objext) ./vfprintf.$(objext) \ ++ ./vasprintf.$(objext) ./vfprintf.$(objext) \ + ./vprintf.$(objext) ./vsnprintf.$(objext) ./vsprintf.$(objext) \ +- ./waitpid.$(objext) ++ ./msdos.$(objext) + + # These files are installed if the library has been configured to do so. + INSTALLED_HEADERS = \ diff --git a/mingw-w64-binutils/0009-fix-libiberty-configure.mingw.patch b/mingw-w64-binutils/0009-fix-libiberty-configure.mingw.patch new file mode 100644 index 0000000000..016ed5dad2 --- /dev/null +++ b/mingw-w64-binutils/0009-fix-libiberty-configure.mingw.patch @@ -0,0 +1,82 @@ +--- gdb-7.6/libiberty/configure.ac.orig 2013-06-12 05:10:53 +0400 ++++ gdb-7.6/libiberty/configure.ac 2013-06-12 05:11:31 +0400 +@@ -335,7 +335,6 @@ + funcs="$funcs vprintf" + funcs="$funcs vsnprintf" + funcs="$funcs vsprintf" +-funcs="$funcs waitpid" + funcs="$funcs setproctitle" + + # Also in the old function.def file: alloca, vfork, getopt. +@@ -437,6 +437,7 @@ + AC_LIBOBJ([insque]) + AC_LIBOBJ([mempcpy]) + AC_LIBOBJ([mkstemps]) ++ AC_LIBOBJ([msdos]) + AC_LIBOBJ([random]) + AC_LIBOBJ([rindex]) + AC_LIBOBJ([sigsetmask]) +@@ -446,7 +447,6 @@ + AC_LIBOBJ([strnlen]) + AC_LIBOBJ([strverscmp]) + AC_LIBOBJ([vasprintf]) +- AC_LIBOBJ([waitpid]) + + for f in $funcs; do + case "$f" in +@@ -615,9 +615,6 @@ + AC_REPLACE_FUNCS($funcs) + libiberty_AC_FUNC_C_ALLOCA + AC_FUNC_FORK +- if test $ac_cv_func_vfork_works = no; then +- AC_LIBOBJ([vfork]) +- fi + # We only need _doprnt if we might use it to implement v*printf. + if test $ac_cv_func_vprintf != yes \ + || test $ac_cv_func_vfprintf != yes \ +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/libiberty/configure.orig 2014-07-23 16:21:59.722230585 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/libiberty/configure 2014-07-23 16:22:45.790544654 +0400 +@@ -5394,7 +5394,6 @@ + funcs="$funcs vprintf" + funcs="$funcs vsnprintf" + funcs="$funcs vsprintf" +-funcs="$funcs waitpid" + funcs="$funcs setproctitle" + + # Also in the old function.def file: alloca, vfork, getopt. +@@ -5721,13 +5721,6 @@ + ;; + esac + +- case " $LIBOBJS " in +- *" waitpid.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS waitpid.$ac_objext" +- ;; +-esac +- +- + for f in $funcs; do + case "$f" in + asprintf | basename | bcmp | bcopy | bzero | clock | ffs | getpagesize | index | insque | mempcpy | mkstemps | random | rindex | sigsetmask | stpcpy | stpncpy | strdup | strndup | strnlen | strverscmp | vasprintf | waitpid) +@@ -5867,12 +5860,6 @@ + ;; + esac + +- case " $LIBOBJS " in +- *" vfork.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS vfork.$ac_objext" +- ;; +-esac +- + case " $LIBOBJS " in + *" waitpid.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS waitpid.$ac_objext" +@@ -6322,7 +6321,7 @@ + if test $ac_cv_func_vfork_works = no; then + case " $LIBOBJS " in + *" vfork.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS vfork.$ac_objext" ++ *) + ;; + esac + diff --git a/mingw-w64-binutils/0013-dont-link-gas-to-libiberty.mingw.patch b/mingw-w64-binutils/0013-dont-link-gas-to-libiberty.mingw.patch new file mode 100644 index 0000000000..fd5212ad6d --- /dev/null +++ b/mingw-w64-binutils/0013-dont-link-gas-to-libiberty.mingw.patch @@ -0,0 +1,32 @@ +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/gas/Makefile.am.orig 2014-07-23 19:37:06.742942242 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/gas/Makefile.am 2014-07-23 19:37:28.587098576 +0400 +@@ -386,7 +386,7 @@ + # How to link with both our special library facilities + # and the system's installed libraries. + +-GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a ++GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la + + # Files to be copied away after each stage in building. + STAGESTUFF = *.@OBJEXT@ $(noinst_PROGRAMS) +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/gas/Makefile.in.orig 2014-07-23 19:35:44.174351195 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/gas/Makefile.in 2014-07-23 19:36:13.414560529 +0400 +@@ -104,7 +104,8 @@ + am_as_new_OBJECTS = $(am__objects_1) + as_new_OBJECTS = $(am_as_new_OBJECTS) + am__DEPENDENCIES_1 = +-am__DEPENDENCIES_2 = ../bfd/libbfd.la ../libiberty/libiberty.a ++am__DEPENDENCIES_2 = ../bfd/libbfd.la ++# ../libiberty/libiberty.a + am_itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT) + itbl_test_OBJECTS = $(am_itbl_test_OBJECTS) + itbl_test_DEPENDENCIES = itbl-tops.@OBJEXT@ itbl-test.@OBJEXT@ \ +@@ -645,7 +646,7 @@ + + # How to link with both our special library facilities + # and the system's installed libraries. +-GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a ++GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la + + # Files to be copied away after each stage in building. + STAGESTUFF = *.@OBJEXT@ $(noinst_PROGRAMS) diff --git a/mingw-w64-binutils/0014-dont-link-binutils-to-libiberty.mingw.patch b/mingw-w64-binutils/0014-dont-link-binutils-to-libiberty.mingw.patch new file mode 100644 index 0000000000..025fed4696 --- /dev/null +++ b/mingw-w64-binutils/0014-dont-link-binutils-to-libiberty.mingw.patch @@ -0,0 +1,122 @@ +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.am.orig 2014-07-24 03:02:47.471723300 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.am 2014-07-24 03:13:03.161008156 +0400 +@@ -198,28 +198,28 @@ + # There's no global DEPENDENCIES. So, we must explicitly list everything + # which depends on libintl, since we don't know whether LIBINTL_DEP will be + # non-empty until configure time. Ugh! +-size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) $(OBJDUMP_PRIVATE_OFILES) +-nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) ++size_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++objdump_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) $(OPCODES) $(OBJDUMP_PRIVATE_OFILES) ++nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++ar_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++strings_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++srconv_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++windres_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++windmc_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + elfedit_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +-bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-bfdtest2_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) ++bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++bfdtest2_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + + LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) + +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.in.orig 2014-07-24 03:02:47.635724500 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.in 2014-07-24 03:13:16.974117340 +0400 +@@ -548,28 +548,28 @@ + # There's no global DEPENDENCIES. So, we must explicitly list everything + # which depends on libintl, since we don't know whether LIBINTL_DEP will be + # non-empty until configure time. Ugh! +-size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) $(OBJDUMP_PRIVATE_OFILES) +-nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) ++size_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++objdump_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) $(OPCODES) $(OBJDUMP_PRIVATE_OFILES) ++nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++ar_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++strings_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++srconv_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++windres_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++windmc_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + elfedit_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) +-bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) +-bfdtest2_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) ++bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) ++bfdtest2_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) + size_SOURCES = size.c $(BULIBS) + objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.am.orig 2014-07-24 03:14:02.660581500 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.am 2014-07-24 03:36:46.895776902 +0400 +@@ -221,7 +221,7 @@ + bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + bfdtest2_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + +-LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) ++LDADD = $(BFDLIB) $(LIBINTL) + + size_SOURCES = size.c $(BULIBS) + +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.in.orig 2014-07-24 03:14:02.868583000 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/binutils/Makefile.in 2014-07-24 03:36:52.198088982 +0400 +@@ -570,7 +570,7 @@ + dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) + bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) + bfdtest2_DEPENDENCIES = $(LIBINTL_DEP) $(BFDLIB) +-LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) ++LDADD = $(BFDLIB) $(LIBINTL) + size_SOURCES = size.c $(BULIBS) + objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) + strings_SOURCES = strings.c $(BULIBS) diff --git a/mingw-w64-binutils/0015-dont-link-ld-to-libiberty.mingw.patch b/mingw-w64-binutils/0015-dont-link-ld-to-libiberty.mingw.patch new file mode 100644 index 0000000000..c7a193d608 --- /dev/null +++ b/mingw-w64-binutils/0015-dont-link-ld-to-libiberty.mingw.patch @@ -0,0 +1,69 @@ +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/ld/Makefile.am.orig 2014-07-17 20:49:00.548854000 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/ld/Makefile.am 2014-07-24 03:51:54.867729925 +0400 +@@ -1956,8 +1956,8 @@ + ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c $(PLUGIN_C) \ + ldbuildid.c + ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \ +- $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP) +-ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) ++ $(BFDLIB) $(LIBINTL_DEP) ++ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBINTL) + + # Dependency tracking for the generated emulation files. + EXTRA_ld_new_SOURCES += $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES) +@@ -1990,16 +1990,16 @@ + ld-partial.@OBJEXT@: ld-new$(EXEEXT) + ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.@OBJEXT@ -r $(OFILES) + ld1$(EXEEXT): ld-partial.@OBJEXT@ +- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + ld1-full$(EXEEXT): ld-new +- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + ld2$(EXEEXT): ld1$(EXEEXT) +- ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + ld3$(EXEEXT): ld2$(EXEEXT) +- ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + bootstrap: ld3$(EXEEXT) + cmp ld2$(EXEEXT) ld3$(EXEEXT) +--- binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/ld/Makefile.in.orig 2014-07-17 20:49:00.552854000 +0400 ++++ binutils-git-e6cf2ae8bb4c675ebfafb137bf13e92ba96225e8/ld/Makefile.in 2014-07-24 03:52:19.962988250 +0400 +@@ -848,9 +848,9 @@ + ldbuildid.c + + ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \ +- $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP) ++ $(BFDLIB) $(LIBINTL_DEP) + +-ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) ++ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBINTL) + + # A test program for C++ constructors and destructors. + # This test is now in the testsuite. +@@ -3411,16 +3411,16 @@ + ld-partial.@OBJEXT@: ld-new$(EXEEXT) + ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.@OBJEXT@ -r $(OFILES) + ld1$(EXEEXT): ld-partial.@OBJEXT@ +- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.@OBJEXT@ $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + ld1-full$(EXEEXT): ld-new +- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + ld2$(EXEEXT): ld1$(EXEEXT) +- ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + ld3$(EXEEXT): ld2$(EXEEXT) +- ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS) ++ ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(HOSTING_LIBS) $(LIBS) + + bootstrap: ld3$(EXEEXT) + cmp ld2$(EXEEXT) ld3$(EXEEXT) diff --git a/mingw-w64-binutils/0017-fix-iconv-linking.all.patch b/mingw-w64-binutils/0017-fix-iconv-linking.all.patch new file mode 100644 index 0000000000..96991d5210 --- /dev/null +++ b/mingw-w64-binutils/0017-fix-iconv-linking.all.patch @@ -0,0 +1,54 @@ +--- binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/bfd/Makefile.am.orig 2014-08-01 21:54:27.917294900 +0400 ++++ binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/bfd/Makefile.am 2014-08-01 23:41:39.388829543 +0400 +@@ -833,7 +833,8 @@ + EXTRA_libbfd_la_SOURCES = $(CFILES) + libbfd_la_DEPENDENCIES = $(OFILES) ofiles + libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL) +-libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ -Wl,--whole-archive -Wl,$(LIBIBERTY) -Wl,$(LIBINTL) -Wl,--no-whole-archive ++comma := , ++libbfd_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@ -Wl,--whole-archive -Wl,$(LIBIBERTY) $(addprefix -Wl$(comma),$(LIBINTL)) -Wl,--no-whole-archive + + # libtool will build .libs/libbfd.a. We create libbfd.a in the build + # directory so that we don't have to convert all the programs that use +--- binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/bfd/Makefile.in.orig 2014-08-01 21:54:27.917294900 +0400 ++++ binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/bfd/Makefile.in 2014-08-01 23:42:11.628451359 +0400 +@@ -341,8 +341,9 @@ + CSEARCH = -I. -I$(srcdir) -I$(INCDIR) + SUBDIRS = doc po + bfddocdir = doc ++comma := , + libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \ +- @SHARED_LDFLAGS@ $(am__empty) -no-undefined -Wl,--whole-archive -Wl,$(LIBIBERTY) -Wl,$(LIBINTL) -Wl,--no-whole-archive ++ @SHARED_LDFLAGS@ $(am__empty) -no-undefined -Wl,--whole-archive -Wl,$(LIBIBERTY) $(addprefix -Wl$(comma),$(LIBINTL)) -Wl,--no-whole-archive + @INSTALL_LIBBFD_TRUE@bfdlib_LTLIBRARIES = libbfd.la + @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) + @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ +--- binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/intl/localcharset.c.orig 2014-07-24 17:46:54.721150000 +0400 ++++ binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/intl/localcharset.c 2014-08-01 23:46:23.527989681 +0400 +@@ -23,6 +23,10 @@ + # include + #endif + ++#ifndef STATIC ++#define STATIC static ++#endif ++ + /* Specification. */ + #include "localcharset.h" + +--- binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/intl/localcharset.h.orig 2014-07-24 17:46:54.721150000 +0400 ++++ binutils-git-90debf20f4cc4ddd7cfb6356fe0d3876a18604a6/intl/localcharset.h 2014-08-01 23:48:01.816349439 +0400 +@@ -31,7 +31,12 @@ + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +-extern const char * locale_charset (void); ++#ifdef STATIC ++STATIC ++#else ++extern ++#endif ++const char * locale_charset (void); + + + #ifdef __cplusplus diff --git a/mingw-w64-binutils/030-binutils-mingw-gnu-print.patch b/mingw-w64-binutils/0110-binutils-mingw-gnu-print.patch similarity index 66% rename from mingw-w64-binutils/030-binutils-mingw-gnu-print.patch rename to mingw-w64-binutils/0110-binutils-mingw-gnu-print.patch index 6b4d3cb0e3..88931e9fce 100644 --- a/mingw-w64-binutils/030-binutils-mingw-gnu-print.patch +++ b/mingw-w64-binutils/0110-binutils-mingw-gnu-print.patch @@ -130,3 +130,60 @@ diff -Naur binutils-2.24/gas/read.c binutils-2.24-mingw/gas/read.c as_warn (_("value 0x%llx truncated to 0x%llx"), (unsigned long long) get, (unsigned long long) use); #else +--- binutils-2.25/gas/as.h.orig 2014-12-26 08:20:07.506000000 +0300 ++++ binutils-2.25/gas/as.h 2014-12-26 08:21:13.350000000 +0300 +@@ -451,10 +451,10 @@ + + #define PRINTF_LIKE(FCN) \ + void FCN (const char *format, ...) \ +- __attribute__ ((__format__ (__printf__, 1, 2))) ++ __attribute__ ((__format__ (gnu_printf, 1, 2))) + #define PRINTF_WHERE_LIKE(FCN) \ + void FCN (char *file, unsigned int line, const char *format, ...) \ +- __attribute__ ((__format__ (__printf__, 3, 4))) ++ __attribute__ ((__format__ (gnu_printf, 3, 4))) + + #else /* __GNUC__ < 2 || defined(VMS) */ + +--- binutils-2.25/gold/configure.orig 2014-12-26 08:22:19.978000000 +0300 ++++ binutils-2.25/gold/configure 2014-12-26 08:22:23.697000000 +0300 +@@ -7530,7 +7530,7 @@ + /* end confdefs.h. */ + + template extern void foo(const char*, ...) +- __attribute__ ((__format__ (__printf__, 1, 2))); ++ __attribute__ ((__format__ (gnu_printf, 1, 2))); + template void foo(const char* format, ...) {} + void bar() { foo("%s\n", "foo"); } + +--- binutils-2.25/gold/configure.ac.orig 2014-12-26 08:22:49.521000000 +0300 ++++ binutils-2.25/gold/configure.ac 2014-12-26 08:23:05.556000000 +0300 +@@ -601,7 +601,7 @@ + [gold_cv_template_attribute], + [AC_COMPILE_IFELSE([ + template extern void foo(const char*, ...) +- __attribute__ ((__format__ (__printf__, 1, 2))); ++ __attribute__ ((__format__ (gnu_printf, 1, 2))); + template void foo(const char* format, ...) {} + void bar() { foo("%s\n", "foo"); } + ], [gold_cv_template_attribute=yes], [gold_cv_template_attribute=no])]) +--- binutils-2.25/include/ansidecl.h.orig 2014-12-26 08:23:33.513000000 +0300 ++++ binutils-2.25/include/ansidecl.h 2014-12-26 08:24:16.479000000 +0300 +@@ -197,7 +197,7 @@ + before GCC 3.3, but as of 3.3 we need to add the `nonnull' + attribute to retain this behavior. */ + #ifndef ATTRIBUTE_PRINTF +-#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) ++#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (gnu_printf, m, n))) ATTRIBUTE_NONNULL(m) + #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) + #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) + #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) +@@ -225,7 +225,7 @@ + NULL format specifier was allowed as of gcc 3.3. */ + #ifndef ATTRIBUTE_NULL_PRINTF + # if (GCC_VERSION >= 3003) +-# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ++# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (gnu_printf, m, n))) + # else + # define ATTRIBUTE_NULL_PRINTF(m, n) + # endif /* GNUC >= 3.3 */ diff --git a/mingw-w64-binutils/110-This-fixes-a-compile-time-warning.patch b/mingw-w64-binutils/110-This-fixes-a-compile-time-warning.patch deleted file mode 100644 index 34496a39e6..0000000000 --- a/mingw-w64-binutils/110-This-fixes-a-compile-time-warning.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 88667baf24e71481f0002c0452b94a1d53116725 Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Fri, 25 Apr 2014 17:00:20 +0100 -Subject: [PATCH] This fixes a compile time warning which is being treated as an error. Older - versions of gcc complain about part of a conditional expression always - evaluating to false because of the size of the operands involved, even when - the entire expression is already known to be false. - - * peXXigen.c (_bfd_XXi_swap_sym_out): Another fix for building on - a 342-bit host. This time for older versions of gcc. ---- - bfd/ChangeLog | 6 ++++++ - bfd/peXXigen.c | 10 +++++++++- - 2 files changed, 15 insertions(+), 1 deletions(-) - -diff --git a/bfd/ChangeLog b/bfd/ChangeLog -index f22dc90..ccff4ce 100644 ---- a/bfd/ChangeLog -+++ b/bfd/ChangeLog -@@ -1,3 +1,9 @@ -+2014-04-25 Nick Clifton -+ -+ PR ld/16821 -+ * peXXigen.c (_bfd_XXi_swap_sym_out): Another fix for building on -+ a 342-bit host. This time for older versions of gcc. -+ - 2014-04-24 Nick Clifton - - * peXXigen.c (rsrc_print_section): Fix compile time warning for -diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c -index d462753..dc45daf 100644 ---- a/bfd/peXXigen.c -+++ b/bfd/peXXigen.c -@@ -236,7 +236,15 @@ _bfd_XXi_swap_sym_out (bfd * abfd, void * inp, void * extp) - reduce the absolute value to < 1^32, and then transforming the - symbol into a section relative symbol. This of course is a hack. */ - if (sizeof (in->n_value) > 4 -+ /* GCC 4.6.x erroneously complains about the next test always being -+ false when compiled on a 32-bit host. (The sizeof test above -+ should have made the warning unnecessary). Hence we have to -+ predicate the test. It should not matter if the test is omitted -+ since the worst that can happen is that some absolute symbols -+ are needlessly converted to equivalent section relative symbols. */ -+#if defined BFD64 || ! defined __GNUC__ || __GNUC__ > 4 || __GNUC_MINOR__ > 6 - && in->n_value > ((1ULL << 32) - 1) -+#endif - && in->n_scnum == -1) - { - asection * sec; -@@ -248,7 +256,7 @@ _bfd_XXi_swap_sym_out (bfd * abfd, void * inp, void * extp) - in->n_scnum = sec->target_index; - } - /* else: FIXME: The value is outside the range of any section. This -- happens for __image_base__ and __ImageBase__ and maybe some other -+ happens for __image_base__ and __ImageBase and maybe some other - symbols as well. We should find a way to handle these values. */ - } - --- -1.7.1 - diff --git a/mingw-w64-binutils/PKGBUILD b/mingw-w64-binutils/PKGBUILD index 3c5a698e94..517cebf909 100644 --- a/mingw-w64-binutils/PKGBUILD +++ b/mingw-w64-binutils/PKGBUILD @@ -4,7 +4,7 @@ _realname=binutils pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=2.25 -pkgrel=1 +pkgrel=2 pkgdesc="A set of programs to assemble and manipulate binary and object files" arch=('any') url="http://www.gnu.org/software/binutils/" @@ -16,20 +16,50 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-libiconv" "${MINGW_PACKAGE_PREFIX}-zlib") options=('staticlibs' '!distcc' '!ccache') # 'debug' '!strip') #install=binutils.install source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.bz2{,.sig} - '030-binutils-mingw-gnu-print.patch' - '110-This-fixes-a-compile-time-warning.patch') + 0001-enable-gold-on.mingw32.patch + 0002-check-for-unusual-file-harder.patch + 0003-enable-shared-bfd.all.patch + 0003-link-to-libibtl-and-libiberty.mingw.patch + 0004-libiberty-la.mingw.patch + 0005-shared-opcodes.mingw.patch + 0008-fix-libiberty-makefile.mingw.patch + 0009-fix-libiberty-configure.mingw.patch + 0013-dont-link-gas-to-libiberty.mingw.patch + 0014-dont-link-binutils-to-libiberty.mingw.patch + 0015-dont-link-ld-to-libiberty.mingw.patch + 0017-fix-iconv-linking.all.patch + 0110-binutils-mingw-gnu-print.patch) md5sums=('d9f3303f802a5b6b0bb73a335ab89d66' 'SKIP' - 'c11228663002721df3437a0d6c8280ee' - '10fcfbca65c6939840dd0f4a575b8a99') + 'f3be04ed70b9d352a2c0e2a80b0706b2' + '2cc89a3c09cafa30c91ac890d3c68932' + 'b3580923675b22a78a66788fd70b99b9' + '700066e478edd9bbb82c9d967bf90a4a' + 'a91bbb38f462c26247f317e4004a99fd' + 'bcd56ce925ca7f85e30b42c28af539d1' + 'df13a2462c24d14376a09ec1d1609519' + '9cd71d49b765932a9701b66dfde00775' + '1d439afee5cbcc952719ae40021e6cec' + '6d3610000f041f66ada0a956101faeec' + '33b5eda35272e88b1c308e66484db958' + '66eeb2af697f5f1d0f372185aa2fb737' + '1c34f5ee0ee5d5008a617e1638362d43') prepare() { cd ${srcdir}/${_realname}-${pkgver} - patch -p1 -i "${srcdir}"/030-binutils-mingw-gnu-print.patch - - # 110-This-fixes-a-compile-time-warning.patch isn't needed for 2.24 and may not - # be needed after either; depending on what gets included in the next release. - # patch -p1 -i "${srcdir}"/110-This-fixes-a-compile-time-warning.patch + patch -p1 -i "${srcdir}"/0001-enable-gold-on.mingw32.patch + patch -p1 -i "${srcdir}"/0002-check-for-unusual-file-harder.patch + #patch -p1 -i "${srcdir}"/0003-enable-shared-bfd.all.patch + #patch -p1 -i "${srcdir}"/0003-link-to-libibtl-and-libiberty.mingw.patch + #patch -p1 -i "${srcdir}"/0004-libiberty-la.mingw.patch + #patch -p1 -i "${srcdir}"/0005-shared-opcodes.mingw.patch + patch -p1 -i "${srcdir}"/0008-fix-libiberty-makefile.mingw.patch + patch -p1 -i "${srcdir}"/0009-fix-libiberty-configure.mingw.patch + #patch -p1 -i "${srcdir}"/0013-dont-link-gas-to-libiberty.mingw.patch + #patch -p1 -i "${srcdir}"/0014-dont-link-binutils-to-libiberty.mingw.patch + #patch -p1 -i "${srcdir}"/0015-dont-link-ld-to-libiberty.mingw.patch + #patch -p1 -i "${srcdir}"/0017-fix-iconv-linking.all.patch + patch -p1 -i "${srcdir}"/0110-binutils-mingw-gnu-print.patch } @@ -58,10 +88,13 @@ build() { --with-sysroot=${MINGW_PREFIX} \ --with-libiconv-prefix=${MINGW_PREFIX} \ $_conf \ - --disable-nls \ + --enable-nls \ --disable-rpath \ --disable-multilib \ - --enable-install-libiberty + --enable-install-libiberty \ + --enable-plugins \ + --enable-gold \ + --disable-shared make } @@ -87,4 +120,6 @@ package() { # Add some useful headers #install -m644 ${srcdir}/${_realname}-${pkgver}/include/libiberty.h ${pkgdir}${MINGW_PREFIX}/include #install -m644 ${srcdir}/${_realname}-${pkgver}/include/demangle.h ${pkgdir}${MINGW_PREFIX}/include + + find ${pkgdir}${MINGW_PREFIX}/share -type f -iname "opcodes.mo" -o -iname "bfd.mo" | xargs -rtl1 rm }