diff options
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 6 | ||||
-rw-r--r-- | newlib/Makefile.am | 5 | ||||
-rw-r--r-- | newlib/patches/08-new-newlib-libc-include-inttypes-h.patch | 97 |
3 files changed, 107 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f150121..6b248f0 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2009-01-18 Neal H. Walfield <neal@gnu.org> + + * patches/08-new-newlib-libc-include-inttypes-h.patch: New file. + * Makefile.am (patch_files): Add + 08-new-newlib-libc-include-inttypes-h.patch. + 2009-01-17 Neal H. Walfield <neal@gnu.org> * Makefile.am [ARCH_X86_64]: Compile with -fPIC. diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 99cfa69..6f13e1a 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -34,7 +34,8 @@ patch_files = \ 04-newlib-newlib-configure-ac.patch \ 05-newlib-newlib-libc-include-machine-setjmp-h.patch \ 06-newlib-newlib-libc-machine-i386-i386mach-h.patch \ - 07-newlib-newlib-libm-machine-i386-i386mach-h.patch + 07-newlib-newlib-libm-machine-i386-i386mach-h.patch \ + 08-new-newlib-libc-include-inttypes-h.patch # Files to link into newlib's source tree (relative to $(srcdir)/addon) addon = \ @@ -161,6 +162,8 @@ if ARCH_X86_64 # # ../newlib/libc-routines.a(lib_a-strcpy.o):(.eh_frame+0x20): # relocation truncated to fit: R_X86_64_32 against `.text' + # + # See, e.g., http://forge.csail.mit.edu/pipermail/mitgcm-support/2005-October/003505.html EXTRA_CFLAGS = -fPIC else EXTRA_CFLAGS = diff --git a/newlib/patches/08-new-newlib-libc-include-inttypes-h.patch b/newlib/patches/08-new-newlib-libc-include-inttypes-h.patch new file mode 100644 index 0000000..9f3810c --- /dev/null +++ b/newlib/patches/08-new-newlib-libc-include-inttypes-h.patch @@ -0,0 +1,97 @@ +#! /bin/sh +patch -p1 -f $* < $0 +exit $? + +Bug fix. Wrong printf format specifier for standard types on systems +with 64-bit longs and long longs. + +diff -c newlib/newlib/libc/include/inttypes.h.orig newlib/newlib/libc/include/inttypes.h +--- newlib/newlib/libc/include/inttypes.h.orig 2009-01-17 21:26:49.000000000 +0100 ++++ newlib/newlib/libc/include/inttypes.h 2009-01-17 21:41:31.000000000 +0100 +@@ -163,12 +163,12 @@ + + + /* 64-bit types */ +-#if __have_longlong64 +-#define __PRI64(x) __STRINGIFY(ll##x) +-#define __SCN64(x) __STRINGIFY(ll##x) +-#elif __have_long64 ++#if __have_long64 + #define __PRI64(x) __STRINGIFY(l##x) + #define __SCN64(x) __STRINGIFY(l##x) ++#elif __have_longlong64 ++#define __PRI64(x) __STRINGIFY(ll##x) ++#define __SCN64(x) __STRINGIFY(ll##x) + #else + #define __PRI64(x) __STRINGIFY(x) + #define __SCN64(x) __STRINGIFY(x) +@@ -217,12 +217,12 @@ + #endif + + /* max-bit types */ +-#if __have_longlong64 +-#define __PRIMAX(x) __STRINGIFY(ll##x) +-#define __SCNMAX(x) __STRINGIFY(ll##x) +-#elif __have_long64 ++#if __have_long64 + #define __PRIMAX(x) __STRINGIFY(l##x) + #define __SCNMAX(x) __STRINGIFY(l##x) ++#elif __have_longlong64 ++#define __PRIMAX(x) __STRINGIFY(ll##x) ++#define __SCNMAX(x) __STRINGIFY(ll##x) + #else + #define __PRIMAX(x) __STRINGIFY(x) + #define __SCNMAX(x) __STRINGIFY(x) +@@ -242,12 +242,12 @@ + #define SCNxMAX __SCNMAX(x) + + /* ptr types */ +-#if __have_longlong64 +-#define __PRIPTR(x) __STRINGIFY(ll##x) +-#define __SCNPTR(x) __STRINGIFY(ll##x) +-#elif __have_long64 ++#if __have_long64 + #define __PRIPTR(x) __STRINGIFY(l##x) + #define __SCNPTR(x) __STRINGIFY(l##x) ++#elif __have_longlong64 ++#define __PRIPTR(x) __STRINGIFY(ll##x) ++#define __SCNPTR(x) __STRINGIFY(ll##x) + #else + #define __PRIPTR(x) __STRINGIFY(x) + #define __SCNPTR(x) __STRINGIFY(x) + + +diff -c newlib/newlib/libc/include/stdint.h newlib/newlib/libc/include/stdint.h.orig +--- newlib/newlib/libc/include/stdint.h.orig 2006-08-16 23:39:43.000000000 +0200 ++++ newlib/newlib/libc/include/stdint.h 2009-01-17 22:20:26.000000000 +0100 +@@ -375,22 +375,22 @@ + #endif + + #if __int64_t_defined +-#if __have_longlong64 +-#define INT64_C(x) x##LL +-#define UINT64_C(x) x##ULL +-#else ++#if __have_long64 + #define INT64_C(x) x##L + #define UINT64_C(x) x##UL ++#else ++#define INT64_C(x) x##LL ++#define UINT64_C(x) x##ULL + #endif + #endif + + /** Macros for greatest-width integer constant expression */ +-#if __have_longlong64 +-#define INTMAX_C(x) x##LL +-#define UINTMAX_C(x) x##ULL +-#else ++#if __have_long64 + #define INTMAX_C(x) x##L + #define UINTMAX_C(x) x##UL ++#else ++#define INTMAX_C(x) x##LL ++#define UINTMAX_C(x) x##ULL + #endif + + |