From 12c071b8655bc93d0bc80ed755e62aa2a44837b3 Mon Sep 17 00:00:00 2001 From: brian Date: Fri, 30 Jan 2004 07:44:01 +0000 Subject: [PATCH] 2003/12/31 23:42:52 darcs-hash:20040130074401-aa32f-93f25e8c4f70fcaa926e5ea6ec0f6dd65ed00e8f.gz --- upstream/freetype-2.1.4/patches/ft-nostdio.patch | 83 ++++++++++++++++++++ .../gcc-3.3/patches/gcc-fdata-sections-bss.patch | 40 ++++++++++ 2 files changed, 123 insertions(+) create mode 100644 upstream/freetype-2.1.4/patches/ft-nostdio.patch create mode 100644 upstream/gcc-3.3/patches/gcc-fdata-sections-bss.patch diff --git a/upstream/freetype-2.1.4/patches/ft-nostdio.patch b/upstream/freetype-2.1.4/patches/ft-nostdio.patch new file mode 100644 index 0000000..6098c50 --- /dev/null +++ b/upstream/freetype-2.1.4/patches/ft-nostdio.patch @@ -0,0 +1,83 @@ +--- src/base/ftsystem.c.origf Mon Dec 29 05:45:54 2003 ++++ src/base/ftsystem.c Mon Dec 29 05:46:08 2003 +@@ -32,7 +32,8 @@ + #include FT_ERRORS_H + #include FT_TYPES_H + +-#include ++#include ++#include + #include + + +@@ -151,7 +152,7 @@ + + /* We use the macro STREAM_FILE for convenience to extract the */ + /* system-specific stream handle from a given FreeType stream object */ +-#define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer ) ++#define STREAM_FD( stream ) ( (int)stream->descriptor.value ) + + + /*************************************************************************/ +@@ -168,7 +169,7 @@ + FT_CALLBACK_DEF( void ) + ft_ansi_stream_close( FT_Stream stream ) + { +- fclose( STREAM_FILE( stream ) ); ++ close(STREAM_FD(stream)); + + stream->descriptor.pointer = NULL; + stream->size = 0; +@@ -202,14 +203,14 @@ + unsigned char* buffer, + unsigned long count ) + { +- FILE* file; ++ int fd; + + +- file = STREAM_FILE( stream ); ++ fd = STREAM_FD( stream ); + +- fseek( file, offset, SEEK_SET ); ++ if(lseek( fd, offset, SEEK_SET ) < 0) return 0; + +- return (unsigned long)fread( buffer, 1, count, file ); ++ return (unsigned long) read(fd,buffer,count); + } + + +@@ -219,14 +220,14 @@ + FT_Stream_Open( FT_Stream stream, + const char* filepathname ) + { +- FILE* file; ++ int fd,n; + + + if ( !stream ) + return FT_Err_Invalid_Stream_Handle; + +- file = fopen( filepathname, "rb" ); +- if ( !file ) ++ fd = open( filepathname, O_RDONLY); ++ if (fd < 0) + { + FT_ERROR(( "FT_Stream_Open:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); +@@ -234,11 +235,11 @@ + return FT_Err_Cannot_Open_Resource; + } + +- fseek( file, 0, SEEK_END ); +- stream->size = ftell( file ); +- fseek( file, 0, SEEK_SET ); ++ n = lseek( fd, 0, SEEK_END ); ++ stream-> size = n < 0 ? 0 : n; ++ lseek( fd, 0, SEEK_SET ); + +- stream->descriptor.pointer = file; ++ stream->descriptor.value = fd; + stream->pathname.pointer = (char*)filepathname; + stream->pos = 0; + diff --git a/upstream/gcc-3.3/patches/gcc-fdata-sections-bss.patch b/upstream/gcc-3.3/patches/gcc-fdata-sections-bss.patch new file mode 100644 index 0000000..3a99ce4 --- /dev/null +++ b/upstream/gcc-3.3/patches/gcc-fdata-sections-bss.patch @@ -0,0 +1,40 @@ +I *think* this bug has been fixed in the 3.4 tree. Unfortunately this +code changed significantly between 3.3 and 3.4 so it wasn't possible to +backport the fix. + +If the GCC tree is ever updated to 3.4 this patch won't apply. It can +probably be safely removed. + +-Brians + + +--- gcc/config/mips/mips.c.orig Mon Dec 29 06:30:42 2003 ++++ gcc/config/mips/mips.c Mon Dec 29 07:16:35 2003 +@@ -10535,11 +10535,13 @@ + int len, size, sec; + const char *name, *prefix; + char *string; +- static const char *const prefixes[4][2] = { ++ static const char *const prefixes[6][2] = { + { ".text.", ".gnu.linkonce.t." }, + { ".rodata.", ".gnu.linkonce.r." }, + { ".data.", ".gnu.linkonce.d." }, +- { ".sdata.", ".gnu.linkonce.s." } ++ { ".sdata.", ".gnu.linkonce.sb." }, ++ { ".bss.", ".gnu.linkonce.b." }, ++ { ".sbss.", ".gnu.linkonce.sb." } + }; + + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); +@@ -10551,8 +10553,9 @@ + if (TREE_CODE (decl) == FUNCTION_DECL) + sec = 0; + else if (DECL_INITIAL (decl) == 0 +- || DECL_INITIAL (decl) == error_mark_node) +- sec = 2; ++ || DECL_INITIAL (decl) == error_mark_node ++ || initializer_zerop (DECL_INITIAL (decl))) ++ sec = (size > 0 && size <= mips_section_threshold) ? 5 : 4; + else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) + && TREE_CODE (decl) == STRING_CST + && !flag_writable_strings) -- 1.7.10.4