Files
MINGW-packages/mingw-w64-binutils-git/0110-binutils-mingw-gnu-print.patch
2014-12-26 09:59:47 +03:00

190 lines
7.8 KiB
Diff

diff -Naur binutils-2.24/bfd/bfd-in.h binutils-2.24-mingw/bfd/bfd-in.h
--- binutils-2.24/bfd/bfd-in.h 2013-11-04 19:33:37.000000000 +0400
+++ binutils-2.24-mingw/bfd/bfd-in.h 2014-03-13 22:24:26.512400000 +0400
@@ -137,7 +137,7 @@
#if BFD_HOST_64BIT_LONG
#define BFD_VMA_FMT "l"
-#elif defined (__MSVCRT__)
+#elif defined(__MSVCRT__) && !defined( __USE_MINGW_ANSI_STDIO)
#define BFD_VMA_FMT "I64"
#else
#define BFD_VMA_FMT "ll"
diff -Naur binutils-2.24/bfd/bfd-in2.h binutils-2.24-mingw/bfd/bfd-in2.h
--- binutils-2.24/bfd/bfd-in2.h 2013-11-18 12:40:15.000000000 +0400
+++ binutils-2.24-mingw/bfd/bfd-in2.h 2014-03-13 22:24:03.580400000 +0400
@@ -144,7 +144,7 @@
#if BFD_HOST_64BIT_LONG
#define BFD_VMA_FMT "l"
-#elif defined (__MSVCRT__)
+#elif defined (__MSVCRT__) && !defined(__USE_MINGW_ANSI_STDIO)
#define BFD_VMA_FMT "I64"
#else
#define BFD_VMA_FMT "ll"
diff -Naur binutils-2.24/binutils/dwarf.c binutils-2.24-mingw/binutils/dwarf.c
--- binutils-2.24/binutils/dwarf.c 2013-11-08 14:13:48.000000000 +0400
+++ binutils-2.24-mingw/binutils/dwarf.c 2014-03-13 22:58:50.101400000 +0400
@@ -140,7 +140,7 @@
}
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
-#ifndef __MINGW32__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
#define DWARF_VMA_FMT "ll"
#define DWARF_VMA_FMT_LONG "%16.16llx"
#else
diff -Naur binutils-2.24/binutils/nm.c binutils-2.24-mingw/binutils/nm.c
--- binutils-2.24/binutils/nm.c 2013-11-08 14:13:48.000000000 +0400
+++ binutils-2.24-mingw/binutils/nm.c 2014-03-13 22:18:43.452800000 +0400
@@ -164,7 +164,7 @@
#if BFD_HOST_64BIT_LONG
static char value_format_64bit[] = "%016lx";
#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
static char value_format_64bit[] = "%016llx";
#else
static char value_format_64bit[] = "%016I64x";
@@ -290,7 +290,7 @@
#if BFD_HOST_64BIT_LONG
value_format_64bit[5] = *radix;
#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
value_format_64bit[6] = *radix;
#else
value_format_64bit[7] = *radix;
diff -Naur binutils-2.24/binutils/prdbg.c binutils-2.24-mingw/binutils/prdbg.c
--- binutils-2.24/binutils/prdbg.c 2013-11-04 19:33:37.000000000 +0400
+++ binutils-2.24-mingw/binutils/prdbg.c 2014-03-13 22:19:45.603200000 +0400
@@ -502,7 +502,7 @@
#if BFD_HOST_64BIT_LONG_LONG
else if (sizeof (vma) <= sizeof (unsigned long long))
{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
if (hexp)
sprintf (buf, "0x%llx", (unsigned long long) vma);
else if (unsignedp)
diff -Naur binutils-2.24/binutils/readelf.c binutils-2.24-mingw/binutils/readelf.c
--- binutils-2.24/binutils/readelf.c 2013-11-18 12:40:15.000000000 +0400
+++ binutils-2.24-mingw/binutils/readelf.c 2014-03-13 22:20:53.494400000 +0400
@@ -1006,7 +1006,7 @@
: "%12.12lx %12.12lx ",
offset, inf);
#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
printf (do_wide
? "%16.16llx %16.16llx "
: "%12.12llx %12.12llx ",
@@ -10836,7 +10836,7 @@
{
size_t maxlen = end - data;
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
/* PR 11128: Use two separate invocations in order to work
around bugs in the Solaris 8 implementation of printf. */
printf (" [%6tx] ", data - start);
diff -Naur binutils-2.24/binutils/strings.c binutils-2.24-mingw/binutils/strings.c
--- binutils-2.24/binutils/strings.c 2013-11-04 19:33:37.000000000 +0400
+++ binutils-2.24-mingw/binutils/strings.c 2014-03-13 22:21:29.140400000 +0400
@@ -557,7 +557,7 @@
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
if (sizeof (start) > sizeof (long))
{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
printf ("%7llo ", (unsigned long long) start);
#else
printf ("%7I64o ", (unsigned long long) start);
@@ -576,7 +576,7 @@
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
if (sizeof (start) > sizeof (long))
{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
printf ("%7lld ", (unsigned long long) start);
#else
printf ("%7I64d ", (unsigned long long) start);
@@ -595,7 +595,7 @@
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
if (sizeof (start) > sizeof (long))
{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
printf ("%7llx ", (unsigned long long) start);
#else
printf ("%7I64x ", (unsigned long long) start);
diff -Naur binutils-2.24/gas/read.c binutils-2.24-mingw/gas/read.c
--- binutils-2.24/gas/read.c 2013-11-08 14:13:48.000000000 +0400
+++ binutils-2.24-mingw/gas/read.c 2014-03-13 22:22:11.806400000 +0400
@@ -4293,7 +4293,7 @@
|| (get & hibit) == 0))
{ /* Leading bits contain both 0s & 1s. */
#if defined (BFD64) && BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
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<typename T> extern void foo(const char*, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)));
+ __attribute__ ((__format__ (gnu_printf, 1, 2)));
template<typename T> void foo(const char* format, ...) {}
void bar() { foo<int>("%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<typename T> extern void foo(const char*, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)));
+ __attribute__ ((__format__ (gnu_printf, 1, 2)));
template<typename T> void foo(const char* format, ...) {}
void bar() { foo<int>("%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 */