1There is a mix between longs and long longs. 2 3Index: newlib/libc/include/inttypes.h 4=================================================================== 5RCS file: /cvs/src/src/newlib/libc/include/inttypes.h,v 6retrieving revision 1.3 7diff -u -p -r1.3 inttypes.h 8--- newlib/libc/include/inttypes.h 16 Dec 2005 19:03:12 -0000 1.3 9+++ newlib/libc/include/inttypes.h 8 Nov 2007 16:32:44 -0000 10@@ -163,12 +163,12 @@ 11 12 13 /* 64-bit types */ 14-#if __have_longlong64 15-#define __PRI64(x) __STRINGIFY(ll##x) 16-#define __SCN64(x) __STRINGIFY(ll##x) 17-#elif __have_long64 18+#if __have_long64 19 #define __PRI64(x) __STRINGIFY(l##x) 20 #define __SCN64(x) __STRINGIFY(l##x) 21+#elif __have_longlong64 22+#define __PRI64(x) __STRINGIFY(ll##x) 23+#define __SCN64(x) __STRINGIFY(ll##x) 24 #else 25 #define __PRI64(x) __STRINGIFY(x) 26 #define __SCN64(x) __STRINGIFY(x) 27@@ -217,12 +217,12 @@ 28 #endif 29 30 /* max-bit types */ 31-#if __have_longlong64 32-#define __PRIMAX(x) __STRINGIFY(ll##x) 33-#define __SCNMAX(x) __STRINGIFY(ll##x) 34-#elif __have_long64 35+#if __have_long64 36 #define __PRIMAX(x) __STRINGIFY(l##x) 37 #define __SCNMAX(x) __STRINGIFY(l##x) 38+#elif __have_longlong64 39+#define __PRIMAX(x) __STRINGIFY(ll##x) 40+#define __SCNMAX(x) __STRINGIFY(ll##x) 41 #else 42 #define __PRIMAX(x) __STRINGIFY(x) 43 #define __SCNMAX(x) __STRINGIFY(x) 44@@ -242,12 +242,12 @@ 45 #define SCNxMAX __SCNMAX(x) 46 47 /* ptr types */ 48-#if __have_longlong64 49-#define __PRIPTR(x) __STRINGIFY(ll##x) 50-#define __SCNPTR(x) __STRINGIFY(ll##x) 51-#elif __have_long64 52+#if __have_long64 53 #define __PRIPTR(x) __STRINGIFY(l##x) 54 #define __SCNPTR(x) __STRINGIFY(l##x) 55+#elif __have_longlong64 56+#define __PRIPTR(x) __STRINGIFY(ll##x) 57+#define __SCNPTR(x) __STRINGIFY(ll##x) 58 #else 59 #define __PRIPTR(x) __STRINGIFY(x) 60 #define __SCNPTR(x) __STRINGIFY(x) 61 62We don't want u?int32_t to be long as our code assume in a lot of places to be 63int. 64 65Index: newlib/libc/include/stdint.h 66=================================================================== 67RCS file: /cvs/src/src/newlib/libc/include/stdint.h,v 68retrieving revision 1.10 69diff -u -p -r1.10 stdint.h 70--- newlib/libc/include/stdint.h 16 Aug 2006 21:39:43 -0000 1.10 71+++ newlib/libc/include/stdint.h 12 Feb 2008 13:07:52 -0000 72@@ -38,7 +38,7 @@ extern "C" { 73 #if __STDINT_EXP(LONG_MAX) > 0x7fffffff 74 #define __have_long64 1 75 #elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__) 76-#define __have_long32 1 77+/* #define __have_long32 1 */ 78 #endif 79 80 #if __STDINT_EXP(SCHAR_MAX) == 0x7f 81 82Define the basic ia64 jump buffer 83 84Index: newlib/libc/include/sys/config.h 85=================================================================== 86RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v 87retrieving revision 1.47 88diff -u -p -r1.47 config.h 89--- newlib/libc/include/sys/config.h 15 Mar 2007 21:32:12 -0000 1.47 90+++ newlib/libc/include/sys/config.h 8 Nov 2007 16:32:44 -0000 91@@ -71,6 +71,10 @@ 92 #endif 93 #endif 94 95+#ifndef __DYNAMIC_REENT__ 96+#define __DYNAMIC_REENT__ 97+#endif 98+ 99 #ifdef __mn10200__ 100 #define __SMALL_BITFIELDS 101 #endif 102 103Dynamic pointer to our reentrancy zone 104 105Index: newlib/libc/reent/getreent.c 106=================================================================== 107RCS file: /cvs/src/src/newlib/libc/reent/getreent.c,v 108retrieving revision 1.2 109diff -u -p -r1.2 getreent.c 110--- newlib/libc/reent/getreent.c 7 Sep 2007 00:45:55 -0000 1.2 111+++ newlib/libc/reent/getreent.c 8 Nov 2007 16:32:44 -0000 112@@ -3,12 +3,20 @@ 113 #include <_ansi.h> 114 #include <reent.h> 115 116+#define weak_alias(name, aliasname) \ 117+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); 118+ 119 #ifdef __getreent 120 #undef __getreent 121 #endif 122+#ifdef __libc_getreent 123+#undef __libc_getreent 124+#endif 125 126 struct _reent * 127-_DEFUN_VOID(__getreent) 128+__libc_getreent (void) 129 { 130 return _impure_ptr; 131 } 132+weak_alias(__libc_getreent,__getreent) 133+ 134 135We can't provide a red zone in mini-os. 136 137Index: newlib/libc/machine/x86_64/memcpy.S 138=================================================================== 139RCS file: /cvs/src/src/newlib/libc/machine/x86_64/memcpy.S,v 140retrieving revision 1.1 141diff -u -p -r1.1 memcpy.S 142--- newlib/libc/machine/x86_64/memcpy.S 28 Aug 2007 21:56:49 -0000 1.1 143+++ newlib/libc/machine/x86_64/memcpy.S 8 Nov 2007 16:32:44 -0000 144@@ -30,10 +30,18 @@ quadword_aligned: 145 cmpq $256, rdx 146 jb quadword_copy 147 148+#if 1 149+ subq $32, rsp 150+ movq rax, 24 (rsp) 151+ movq r12, 16 (rsp) 152+ movq r13, 8 (rsp) 153+ movq r14, 0 (rsp) 154+#else 155 movq rax, -8 (rsp) 156 movq r12, -16 (rsp) 157 movq r13, -24 (rsp) 158 movq r14, -32 (rsp) 159+#endif 160 161 movq rdx, rcx /* Copy 128 bytes at a time with minimum cache polution */ 162 shrq $7, rcx 163@@ -89,10 +97,18 @@ loop: 164 movq rdx, rcx 165 andq $127, rcx 166 rep movsb 167+#if 1 168+ movq 24 (rsp), rax 169+ movq 16 (rsp), r12 170+ movq 8 (rsp), r13 171+ movq 0 (rsp), r14 172+ addq $32, rsp 173+#else 174 movq -8 (rsp), rax 175 movq -16 (rsp), r12 176 movq -24 (rsp), r13 177 movq -32 (rsp), r14 178+#endif 179 ret 180 181 182--- newlib/libc/machine/x86_64/x86_64mach.h.orig 2008-07-11 14:57:23.062269000 +0100 183+++ newlib/libc/machine/x86_64/x86_64mach.h 2008-07-11 14:58:01.262503000 +0100 184@@ -22,81 +22,81 @@ 185 186 #define REG(x) CONCAT1(__REG_PREFIX__, x) 187 188-#define rax REG(rax) 189-#define rbx REG(rbx) 190-#define rcx REG(rcx) 191-#define rdx REG(rdx) 192-#define rsi REG(rsi) 193-#define rdi REG(rdi) 194-#define rbp REG(rbp) 195-#define rsp REG(rsp) 196- 197-#define r8 REG(r8) 198-#define r9 REG(r9) 199-#define r10 REG(r10) 200-#define r11 REG(r11) 201-#define r12 REG(r12) 202-#define r13 REG(r13) 203-#define r14 REG(r14) 204-#define r15 REG(r15) 205- 206-#define eax REG(eax) 207-#define ebx REG(ebx) 208-#define ecx REG(ecx) 209-#define edx REG(edx) 210-#define esi REG(esi) 211-#define edi REG(edi) 212-#define ebp REG(ebp) 213-#define esp REG(esp) 214- 215-#define st0 REG(st) 216-#define st1 REG(st(1)) 217-#define st2 REG(st(2)) 218-#define st3 REG(st(3)) 219-#define st4 REG(st(4)) 220-#define st5 REG(st(5)) 221-#define st6 REG(st(6)) 222-#define st7 REG(st(7)) 223- 224-#define ax REG(ax) 225-#define bx REG(bx) 226-#define cx REG(cx) 227-#define dx REG(dx) 228- 229-#define ah REG(ah) 230-#define bh REG(bh) 231-#define ch REG(ch) 232-#define dh REG(dh) 233- 234-#define al REG(al) 235-#define bl REG(bl) 236-#define cl REG(cl) 237-#define dl REG(dl) 238- 239-#define sil REG(sil) 240- 241-#define mm1 REG(mm1) 242-#define mm2 REG(mm2) 243-#define mm3 REG(mm3) 244-#define mm4 REG(mm4) 245-#define mm5 REG(mm5) 246-#define mm6 REG(mm6) 247-#define mm7 REG(mm7) 248- 249-#define xmm0 REG(xmm0) 250-#define xmm1 REG(xmm1) 251-#define xmm2 REG(xmm2) 252-#define xmm3 REG(xmm3) 253-#define xmm4 REG(xmm4) 254-#define xmm5 REG(xmm5) 255-#define xmm6 REG(xmm6) 256-#define xmm7 REG(xmm7) 257- 258-#define cr0 REG(cr0) 259-#define cr1 REG(cr1) 260-#define cr2 REG(cr2) 261-#define cr3 REG(cr3) 262-#define cr4 REG(cr4) 263+#define rax %rax 264+#define rbx %rbx 265+#define rcx %rcx 266+#define rdx %rdx 267+#define rsi %rsi 268+#define rdi %rdi 269+#define rbp %rbp 270+#define rsp %rsp 271+ 272+#define r8 %r8 273+#define r9 %r9 274+#define r10 %r10 275+#define r11 %r11 276+#define r12 %r12 277+#define r13 %r13 278+#define r14 %r14 279+#define r15 %r15 280+ 281+#define eax %eax 282+#define ebx %ebx 283+#define ecx %ecx 284+#define edx %edx 285+#define esi %esi 286+#define edi %edi 287+#define ebp %ebp 288+#define esp %esp 289+ 290+#define st0 %st 291+#define st1 %st(1) 292+#define st2 %st(2) 293+#define st3 %st(3) 294+#define st4 %st(4) 295+#define st5 %st(5) 296+#define st6 %st(6) 297+#define st7 %st(7) 298+ 299+#define ax %ax 300+#define bx %bx 301+#define cx %cx 302+#define dx %dx 303+ 304+#define ah %ah 305+#define bh %bh 306+#define ch %ch 307+#define dh %dh 308+ 309+#define al %al 310+#define bl %bl 311+#define cl %cl 312+#define dl %dl 313+ 314+#define sil %sil 315+ 316+#define mm1 %mm1 317+#define mm2 %mm2 318+#define mm3 %mm3 319+#define mm4 %mm4 320+#define mm5 %mm5 321+#define mm6 %mm6 322+#define mm7 %mm7 323+ 324+#define xmm0 %xmm0 325+#define xmm1 %xmm1 326+#define xmm2 %xmm2 327+#define xmm3 %xmm3 328+#define xmm4 %xmm4 329+#define xmm5 %xmm5 330+#define xmm6 %xmm6 331+#define xmm7 %xmm7 332+ 333+#define cr0 %cr0 334+#define cr1 %cr1 335+#define cr2 %cr2 336+#define cr3 %cr3 337+#define cr4 %cr4 338 339 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION 340 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function 341--- newlib/libc/machine/x86_64/memcpy.S.orig 2008-07-11 15:12:27.494693000 +0100 342+++ newlib/libc/machine/x86_64/memcpy.S 2008-07-11 15:12:29.448706000 +0100 343@@ -60,14 +60,14 @@ 344 movq 48 (rsi), r13 345 movq 56 (rsi), r14 346 347- movntiq rax, (rdi) 348- movntiq r8 , 8 (rdi) 349- movntiq r9 , 16 (rdi) 350- movntiq r10, 24 (rdi) 351- movntiq r11, 32 (rdi) 352- movntiq r12, 40 (rdi) 353- movntiq r13, 48 (rdi) 354- movntiq r14, 56 (rdi) 355+ movnti rax, (rdi) 356+ movnti r8 , 8 (rdi) 357+ movnti r9 , 16 (rdi) 358+ movnti r10, 24 (rdi) 359+ movnti r11, 32 (rdi) 360+ movnti r12, 40 (rdi) 361+ movnti r13, 48 (rdi) 362+ movnti r14, 56 (rdi) 363 364 movq 64 (rsi), rax 365 movq 72 (rsi), r8 366@@ -78,14 +78,14 @@ 367 movq 112 (rsi), r13 368 movq 120 (rsi), r14 369 370- movntiq rax, 64 (rdi) 371- movntiq r8 , 72 (rdi) 372- movntiq r9 , 80 (rdi) 373- movntiq r10, 88 (rdi) 374- movntiq r11, 96 (rdi) 375- movntiq r12, 104 (rdi) 376- movntiq r13, 112 (rdi) 377- movntiq r14, 120 (rdi) 378+ movnti rax, 64 (rdi) 379+ movnti r8 , 72 (rdi) 380+ movnti r9 , 80 (rdi) 381+ movnti r10, 88 (rdi) 382+ movnti r11, 96 (rdi) 383+ movnti r12, 104 (rdi) 384+ movnti r13, 112 (rdi) 385+ movnti r14, 120 (rdi) 386 387 leaq 128 (rsi), rsi 388 leaq 128 (rdi), rdi 389--- newlib/libc/machine/i386/i386mach.h 2000-08-28 18:50:06.000000000 +0100 390+++ newlib/libc/machine/i386/i386mach.h 2008-07-11 15:17:13.874409000 +0100 391@@ -27,46 +27,46 @@ 392 393 #define REG(x) CONCAT1(__REG_PREFIX__, x) 394 395-#define eax REG(eax) 396-#define ebx REG(ebx) 397-#define ecx REG(ecx) 398-#define edx REG(edx) 399-#define esi REG(esi) 400-#define edi REG(edi) 401-#define ebp REG(ebp) 402-#define esp REG(esp) 403- 404-#define st0 REG(st) 405-#define st1 REG(st(1)) 406-#define st2 REG(st(2)) 407-#define st3 REG(st(3)) 408-#define st4 REG(st(4)) 409-#define st5 REG(st(5)) 410-#define st6 REG(st(6)) 411-#define st7 REG(st(7)) 412- 413-#define ax REG(ax) 414-#define bx REG(bx) 415-#define cx REG(cx) 416-#define dx REG(dx) 417- 418-#define ah REG(ah) 419-#define bh REG(bh) 420-#define ch REG(ch) 421-#define dh REG(dh) 422- 423-#define al REG(al) 424-#define bl REG(bl) 425-#define cl REG(cl) 426-#define dl REG(dl) 427- 428-#define mm1 REG(mm1) 429-#define mm2 REG(mm2) 430-#define mm3 REG(mm3) 431-#define mm4 REG(mm4) 432-#define mm5 REG(mm5) 433-#define mm6 REG(mm6) 434-#define mm7 REG(mm7) 435+#define eax %eax 436+#define ebx %ebx 437+#define ecx %ecx 438+#define edx %edx 439+#define esi %esi 440+#define edi %edi 441+#define ebp %ebp 442+#define esp %esp 443+ 444+#define st0 %st 445+#define st1 %st(1) 446+#define st2 %st(2) 447+#define st3 %st(3) 448+#define st4 %st(4) 449+#define st5 %st(5) 450+#define st6 %st(6) 451+#define st7 %st(7) 452+ 453+#define ax %ax 454+#define bx %bx 455+#define cx %cx 456+#define dx %dx 457+ 458+#define ah %ah 459+#define bh %bh 460+#define ch %ch 461+#define dh %dh 462+ 463+#define al %al 464+#define bl %bl 465+#define cl %cl 466+#define dl %dl 467+ 468+#define mm1 %mm1 469+#define mm2 %mm2 470+#define mm3 %mm3 471+#define mm4 %mm4 472+#define mm5 %mm5 473+#define mm6 %mm6 474+#define mm7 %mm7 475 476 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION 477 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function 478--- newlib/libc/machine/x86_64/memset.S 2007-08-28 22:56:49.000000000 +0100 479+++ newlib/libc/machine/x86_64/memset.S 2008-07-11 15:16:59.098320000 +0100 480@@ -40,22 +40,22 @@ 481 482 .p2align 4 483 loop: 484- movntiq rax, (rdi) 485- movntiq rax, 8 (rdi) 486- movntiq rax, 16 (rdi) 487- movntiq rax, 24 (rdi) 488- movntiq rax, 32 (rdi) 489- movntiq rax, 40 (rdi) 490- movntiq rax, 48 (rdi) 491- movntiq rax, 56 (rdi) 492- movntiq rax, 64 (rdi) 493- movntiq rax, 72 (rdi) 494- movntiq rax, 80 (rdi) 495- movntiq rax, 88 (rdi) 496- movntiq rax, 96 (rdi) 497- movntiq rax, 104 (rdi) 498- movntiq rax, 112 (rdi) 499- movntiq rax, 120 (rdi) 500+ movnti rax, (rdi) 501+ movnti rax, 8 (rdi) 502+ movnti rax, 16 (rdi) 503+ movnti rax, 24 (rdi) 504+ movnti rax, 32 (rdi) 505+ movnti rax, 40 (rdi) 506+ movnti rax, 48 (rdi) 507+ movnti rax, 56 (rdi) 508+ movnti rax, 64 (rdi) 509+ movnti rax, 72 (rdi) 510+ movnti rax, 80 (rdi) 511+ movnti rax, 88 (rdi) 512+ movnti rax, 96 (rdi) 513+ movnti rax, 104 (rdi) 514+ movnti rax, 112 (rdi) 515+ movnti rax, 120 (rdi) 516 517 leaq 128 (rdi), rdi 518 519--- newlib/libm/machine/i386/i386mach.h.orig 2008-07-11 15:30:37.367227000 +0100 520+++ newlib/libm/machine/i386/i386mach.h 2008-07-11 15:30:55.232337000 +0100 521@@ -27,46 +27,46 @@ 522 523 #define REG(x) CONCAT1(__REG_PREFIX__, x) 524 525-#define eax REG(eax) 526-#define ebx REG(ebx) 527-#define ecx REG(ecx) 528-#define edx REG(edx) 529-#define esi REG(esi) 530-#define edi REG(edi) 531-#define ebp REG(ebp) 532-#define esp REG(esp) 533- 534-#define st0 REG(st) 535-#define st1 REG(st(1)) 536-#define st2 REG(st(2)) 537-#define st3 REG(st(3)) 538-#define st4 REG(st(4)) 539-#define st5 REG(st(5)) 540-#define st6 REG(st(6)) 541-#define st7 REG(st(7)) 542- 543-#define ax REG(ax) 544-#define bx REG(bx) 545-#define cx REG(cx) 546-#define dx REG(dx) 547- 548-#define ah REG(ah) 549-#define bh REG(bh) 550-#define ch REG(ch) 551-#define dh REG(dh) 552- 553-#define al REG(al) 554-#define bl REG(bl) 555-#define cl REG(cl) 556-#define dl REG(dl) 557- 558-#define mm1 REG(mm1) 559-#define mm2 REG(mm2) 560-#define mm3 REG(mm3) 561-#define mm4 REG(mm4) 562-#define mm5 REG(mm5) 563-#define mm6 REG(mm6) 564-#define mm7 REG(mm7) 565+#define eax %eax 566+#define ebx %ebx 567+#define ecx %ecx 568+#define edx %edx 569+#define esi %esi 570+#define edi %edi 571+#define ebp %ebp 572+#define esp %esp 573+ 574+#define st0 %st 575+#define st1 %st(1) 576+#define st2 %st(2) 577+#define st3 %st(3) 578+#define st4 %st(4) 579+#define st5 %st(5) 580+#define st6 %st(6) 581+#define st7 %st(7) 582+ 583+#define ax %ax 584+#define bx %bx 585+#define cx %cx 586+#define dx %dx 587+ 588+#define ah %ah 589+#define bh %bh 590+#define ch %ch 591+#define dh %dh 592+ 593+#define al %al 594+#define bl %bl 595+#define cl %cl 596+#define dl %dl 597+ 598+#define mm1 %mm1 599+#define mm2 %mm2 600+#define mm3 %mm3 601+#define mm4 %mm4 602+#define mm5 %mm5 603+#define mm6 %mm6 604+#define mm7 %mm7 605 606 #ifdef _I386MACH_NEED_SOTYPE_FUNCTION 607 #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function 608 609 610We want to have a 64bit offsets libc even on 32bit platforms. 611 612--- ./newlib/configure.host.orig 2008-08-07 16:01:17.801946000 +0100 613+++ ./newlib/configure.host 2008-08-07 16:01:34.181064000 +0100 614@@ -317,6 +317,8 @@ 615 oext=lo 616 lpfx= 617 aext=la ;; 618+ i[34567]86-xen-elf) 619+ stdio64_dir=stdio64 ;; 620 *) ;; #shared library not supported for ${host} 621 esac 622 623--- newlib/libc/include/sys/_types.h.orig 2008-08-07 15:22:44.925008000 +0100 624+++ newlib/libc/include/sys/_types.h 2008-08-07 15:22:50.824044000 +0100 625@@ -13,8 +13,12 @@ 626 #include <sys/lock.h> 627 628 #ifndef __off_t_defined 629+#ifdef __MINIOS__ 630+typedef long long _off_t; 631+#else 632 typedef long _off_t; 633 #endif 634+#endif 635 636 #if defined(__rtems__) 637 /* device numbers are 32-bit major and and 32-bit minor */ 638--- ./newlib/libc/include/sys/config.h.orig 2008-08-07 14:43:25.915866000 +0100 639+++ ./newlib/libc/include/sys/config.h 2008-08-07 14:44:13.508154000 +0100 640@@ -69,6 +69,10 @@ 641 /* we use some glibc header files so turn on glibc large file feature */ 642 #define _LARGEFILE64_SOURCE 1 643 #endif 644+#ifdef __MINIOS__ 645+#define __LARGE64_FILES 1 646+#define _LARGEFILE64_SOURCE 1 647+#endif 648 #endif 649 650 #ifndef __DYNAMIC_REENT__ 651--- ./newlib/libc/include/sys/_default_fcntl.h.orig 2008-08-07 15:08:22.377836000 +0100 652+++ ./newlib/libc/include/sys/_default_fcntl.h 2008-08-07 15:08:31.651890000 +0100 653@@ -170,7 +170,11 @@ 654 /* Provide _<systemcall> prototypes for functions provided by some versions 655 of newlib. */ 656 #ifdef _COMPILING_NEWLIB 657-extern int _open _PARAMS ((const char *, int, ...)); 658+extern int _open _PARAMS ((const char *, int, ...)) 659+#ifdef __MINIOS__ 660+ asm("open64") 661+#endif 662+ ; 663 extern int _fcntl _PARAMS ((int, int, ...)); 664 #ifdef __LARGE64_FILES 665 extern int _open64 _PARAMS ((const char *, int, ...)); 666--- ./newlib/libc/include/sys/unistd.h.orig 2008-08-07 15:09:36.449280000 +0100 667+++ ./newlib/libc/include/sys/unistd.h 2008-08-07 15:09:51.210370000 +0100 668@@ -101,7 +101,11 @@ 669 int _EXFUN(link, (const char *__path1, const char *__path2 )); 670 int _EXFUN(nice, (int __nice_value )); 671 #if !defined(__INSIDE_CYGWIN__) 672-off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )); 673+off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )) 674+#ifdef __MINIOS__ 675+ asm("lseek64") 676+#endif 677+ ; 678 #endif 679 #if defined(__SPU__) 680 #define F_ULOCK 0 681--- ./newlib/libc/include/sys/stat.h.orig 2008-08-07 16:08:50.495116000 +0100 682+++ ./newlib/libc/include/sys/stat.h 2008-08-07 16:10:21.799753000 +0100 683@@ -49,6 +49,9 @@ 684 long st_spare4[2]; 685 #endif 686 }; 687+#ifdef __MINIOS__ 688+#define stat64 stat 689+#endif 690 #endif 691 692 #define _IFMT 0170000 /* type of file */ 693@@ -132,7 +135,11 @@ 694 /* Provide prototypes for most of the _<systemcall> names that are 695 provided in newlib for some compilers. */ 696 #ifdef _COMPILING_NEWLIB 697-int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); 698+int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )) 699+#ifdef __MINIOS__ 700+ asm("fstat64") 701+#endif 702+ ; 703 int _EXFUN(_stat,( const char *__path, struct stat *__sbuf )); 704 #ifdef __LARGE64_FILES 705 struct stat64; 706--- ./newlib/libc/include/_syslist.h.orig 2008-08-07 16:24:19.122605000 +0100 707+++ ./newlib/libc/include/_syslist.h 2008-08-07 16:24:21.548628000 +0100 708@@ -14,6 +14,7 @@ 709 #define _kill kill 710 #define _link link 711 #define _lseek lseek 712+#define _lseek64 lseek64 713 #define _open open 714 #define _read read 715 #define _sbrk sbrk 716--- newlib/libc/include/reent.h.orig 2008-08-07 16:28:49.846502000 +0100 717+++ newlib/libc/include/reent.h 2008-08-07 16:29:02.096586000 +0100 718@@ -87,6 +87,9 @@ 719 #if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB) 720 #define stat64 __stat64 721 #endif 722+#if defined(__MINIOS__) 723+#define stat64 stat 724+#endif 725 726 struct stat64; 727 728