From ea3cce92bfa4662ed6d2632f271390bdc7530176 Mon Sep 17 00:00:00 2001 From: fake Date: Tue, 17 Aug 2004 14:41:22 +0000 Subject: [PATCH] fake: update dietlibc to 0.27: - remove diethome.patch, gcc-34.patch, dirent_h.patch, and realpath fix - fix pkg_sed.patch - on apply, please rename pkg_patch/pkg_gcc3*.patch -> pkg_patch/pkg_gcc.patch (pkgfork woes) diff -rduN package/base/dietlibc/diethome.patch package/base/dietlibc/diethome.patch [2004081304434013800] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@3890 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/dietlibc/diethome.patch | 53 ------- package/base/dietlibc/dietlibc.conf | 13 +- package/base/dietlibc/dietlibc.desc | 4 +- package/base/dietlibc/dirent_h.patch | 57 -------- package/base/dietlibc/gcc34.patch | 122 ----------------- package/base/dietlibc/pkg_patch/pkg_sed.patch | 47 ++----- .../dietlibc/realpath-fix-thanks-fefe.patch | 129 ------------------ 7 files changed, 23 insertions(+), 402 deletions(-) delete mode 100644 package/base/dietlibc/diethome.patch delete mode 100644 package/base/dietlibc/dirent_h.patch delete mode 100644 package/base/dietlibc/gcc34.patch delete mode 100644 package/base/dietlibc/realpath-fix-thanks-fefe.patch diff --git a/package/base/dietlibc/diethome.patch b/package/base/dietlibc/diethome.patch deleted file mode 100644 index b90c3287c..000000000 --- a/package/base/dietlibc/diethome.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- dietlibc-0.25/diet.c.orig 2004-06-28 13:49:18.742612936 +0200 -+++ dietlibc-0.25/diet.c 2004-06-28 14:12:08.260414584 +0200 -@@ -64,7 +64,7 @@ - int preprocess=0; - int verbose=0; - int profile=0; -- char diethome[]=DIETHOME; -+ char *diethome; - char platform[1000]; - #ifdef __DYN_LIB - int shared=0; -@@ -72,7 +72,7 @@ - char* shortplatform=0; - #ifdef WANT_SAFEGUARD - char safeguard1[]="-include"; -- char safeguard2[]=DIETHOME "/include/dietref.h"; -+ char safeguard2[1000]; /*=DIETHOME "/include/dietref.h";*/ - #endif - const char *nostdlib="-nostdlib"; - const char *libgcc="-lgcc"; -@@ -82,13 +82,29 @@ - int mangleopts=0; - char manglebuf[1024]; - -+ /* Handle DIETHOME environment var */ -+ if (!(diethome = getenv("DIETHOME"))) -+ diethome = DIETHOME; -+ -+ if (strlen(diethome) > 500) { -+ __write2("Environment variable DIETHOME is too long.\n"); -+ return -1; -+ } -+ -+#ifdef WANT_SAFEGUARD -+ strcpy(safeguard2, diethome); -+ strcat(safeguard2, "/include/dietref.h"); -+#endif -+ -+ strcpy(platform, diethome); -+ - #ifdef INSTALLVERSION -- strcpy(platform,DIETHOME "/lib-"); -+ strcat(platform, "/lib-"); - #else - #ifndef __DYN_LIB -- strcpy(platform,DIETHOME "/bin-"); -+ strcat(platform, "/bin-"); - #else -- strcpy(platform,DIETHOME "/pic-"); -+ strcat(platform, "/pic-"); - #endif - #endif - strcpy(dashL,"-L"); diff --git a/package/base/dietlibc/dietlibc.conf b/package/base/dietlibc/dietlibc.conf index a7ef8c5f6..254def5ff 100644 --- a/package/base/dietlibc/dietlibc.conf +++ b/package/base/dietlibc/dietlibc.conf @@ -46,23 +46,24 @@ EOT # build package if [ "$crossnative" = native ] ; then # dietlibc uses uname - so we always need to set MYARCH - eval "$MAKE MYARCH=$cpu $makeopt" + eval "$MAKE MYARCH=$cpu $makeopt CC='$CC --specs=specs'" if [ $toolsdir = tools.cross ] ; then cp -v bin-*/diet-i $toolsbin/diet || true cp -v bin-*/diet-dyn-i $toolsbin/diet-dyn || true fi - eval "$MAKE MYARCH=$cpu $makeinstopt" + eval "$MAKE MYARCH=$cpu $makeinstopt CC='$CC --specs=specs'" else mkdir bin-$cpu ; ln -s bin-$cpu "bin-${CC%%-*}" - eval "$MAKE $makeopt" + eval "$MAKE $makeopt CC=$HOSTCC" if [ $toolsdir = tools.cross ] ; then cp -v bin-*/diet-i $toolsbin/diet || true cp -v bin-*/diet-dyn-i $toolsbin/diet-dyn || true fi - eval "$MAKE ARCH=$cpu $makeopt CROSS=$archprefix" + # in the dietlibc Makefile, $CROSS is prepended to $CC + eval "$MAKE ARCH=$cpu $makeopt CROSS=$archprefix CC='gcc --specs=specs'" eval "$MAKE ARCH=$cpu $makeinstopt" fi @@ -76,10 +77,10 @@ if [ "$prefix" = "usr" -o "$prefix" = "usr/local" ] ; then makeinstopt="$makeinstopt prefix=/$prefix/dietlibc" makeinstopt="$makeinstopt BINDIR=/$prefix/bin" makeinstopt="$makeinstopt MAN1DIR=/$prefix/man/man1" - makeopt="$makeopt prefix=/$prefix/dietlibc CC=gcc all" + makeopt="$makeopt prefix=/$prefix/dietlibc all" else makeinstopt="$makeinstopt prefix=/$prefix" - makeopt="$makeopt prefix=/$prefix CC=gcc all" + makeopt="$makeopt prefix=/$prefix all" fi cpu="`echo "$arch_machine" | sed -e s/i.86/i386/ -e s/powerpc/ppc/`" diff --git a/package/base/dietlibc/dietlibc.desc b/package/base/dietlibc/dietlibc.desc index 9250f730d..65c95697b 100644 --- a/package/base/dietlibc/dietlibc.desc +++ b/package/base/dietlibc/dietlibc.desc @@ -39,9 +39,9 @@ [L] GPL [S] Stable -[V] 0.25 +[V] 0.27 [P] X 01-3-----9 102.000 -[D] 2556882219 dietlibc-0.25.tar.bz2 http://www.kernel.org/pub/linux/libs/dietlibc/ +[D] 3551932880 dietlibc-0.27.tar.bz2 http://www.kernel.org/pub/linux/libs/dietlibc/ [D] 1283832747 sparc64-softfpu-dietlibc0.25-1.0.diff.bz2 http://www.rocklinux.net/people/fake/dietlibc/ diff --git a/package/base/dietlibc/dirent_h.patch b/package/base/dietlibc/dirent_h.patch deleted file mode 100644 index 00c1edc2e..000000000 --- a/package/base/dietlibc/dirent_h.patch +++ /dev/null @@ -1,57 +0,0 @@ -# --- ROCK-COPYRIGHT-NOTE-BEGIN --- -# -# This copyright note is auto-generated by ./scripts/Create-CopyPatch. -# Please add additional copyright information _after_ the line containing -# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by -# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! -# -# ROCK Linux: rock-src/package/base/dietlibc/dirent_h.patch -# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf -# -# This patch file is dual-licensed. It is available under the license the -# patched project is licensed under, as long as it is an OpenSource license -# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms -# of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# --- ROCK-COPYRIGHT-NOTE-END --- - -Needed by coreutils. Upstream? Please recheck if there is an other solution. - ---- ./include/dirent.h~ Sat Apr 19 09:12:38 2003 -+++ ./include/dirent.h Sat Apr 19 09:13:24 2003 -@@ -61,4 +61,33 @@ - #define alphasort alphasort64 - #endif - -+#ifdef _BSD_SOURCE -+/* File types for `d_type'. */ -+enum -+ { -+ DT_UNKNOWN = 0, -+# define DT_UNKNOWN DT_UNKNOWN -+ DT_FIFO = 1, -+# define DT_FIFO DT_FIFO -+ DT_CHR = 2, -+# define DT_CHR DT_CHR -+ DT_DIR = 4, -+# define DT_DIR DT_DIR -+ DT_BLK = 6, -+# define DT_BLK DT_BLK -+ DT_REG = 8, -+# define DT_REG DT_REG -+ DT_LNK = 10, -+# define DT_LNK DT_LNK -+ DT_SOCK = 12, -+# define DT_SOCK DT_SOCK -+ DT_WHT = 14 -+# define DT_WHT DT_WHT -+ }; -+ -+/* Convert between stat structure types and directory types. */ -+# define IFTODT(mode) (((mode) & 0170000) >> 12) -+# define DTTOIF(dirtype) ((dirtype) << 12) -+#endif -+ - #endif diff --git a/package/base/dietlibc/gcc34.patch b/package/base/dietlibc/gcc34.patch deleted file mode 100644 index 720b100be..000000000 --- a/package/base/dietlibc/gcc34.patch +++ /dev/null @@ -1,122 +0,0 @@ - -Some fixes for compilation with gcc-3.4. - - - Rene Rebe - -diff -ur dietlibc-0.25-orig/lib/alloc.c dietlibc-0.25/lib/alloc.c ---- dietlibc-0.25-orig/lib/alloc.c 2004-01-27 15:24:11.000000000 +0100 -+++ dietlibc-0.25/lib/alloc.c 2004-05-05 03:14:54.000000000 +0200 -@@ -44,14 +44,13 @@ - - /* a simple mmap :) */ - -+static void* - #ifdef __i386__ - /* regparm exists only on i386 */ --static void *do_mmap(size_t size) __attribute__((regparm(1))); --static size_t get_index(size_t _size) __attribute__((regparm(1))); --static void* __small_malloc(size_t _size) __attribute__((regparm(1))); -+__attribute__((regparm(1))) - #endif -- --static void *do_mmap(size_t size) { -+do_mmap(size_t size) -+{ - return mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, (size_t)0); - } - -@@ -70,7 +69,13 @@ - - static inline int __ind_shift() { return (MEM_BLOCK_SIZE==4096)?4:5; } - --static size_t get_index(size_t _size) { -+static size_t -+#ifdef __i386__ -+/* regparm exists only on i386 */ -+__attribute__((regparm(1))) -+#endif -+get_index(size_t _size) -+{ - register size_t idx=0; - if (_size) { - register size_t size=((_size-1)&(MEM_BLOCK_SIZE-1))>>__ind_shift(); -@@ -80,9 +85,13 @@ - } - - /* small mem */ --static void __small_free(void*_ptr,size_t _size) __attribute__((regparm(2))); -- --static void __small_free(void*_ptr,size_t _size) { -+static void -+#ifdef __i386__ -+/* regparm exists only on i386 */ -+__attribute__((regparm(1))) -+#endif -+__small_free(void*_ptr,size_t _size) -+{ - __alloc_t* ptr=BLOCK_START(_ptr); - size_t size=_size; - size_t idx=get_index(size); -@@ -93,7 +102,13 @@ - __small_mem[idx]=ptr; - } - --static void* __small_malloc(size_t _size) { -+static void* -+#ifdef __i386__ -+/* regparm exists only on i386 */ -+__attribute__((regparm(1))) -+#endif -+__small_malloc(size_t _size) -+{ - __alloc_t *ptr; - size_t size=_size; - size_t idx; -diff -ur dietlibc-0.25-orig/libpthread/pthread_internal.c dietlibc-0.25/libpthread/pthread_internal.c ---- dietlibc-0.25-orig/libpthread/pthread_internal.c 2003-09-29 16:00:59.000000000 +0200 -+++ dietlibc-0.25/libpthread/pthread_internal.c 2004-05-05 03:18:08.000000000 +0200 -@@ -49,10 +49,11 @@ - static inline unsigned long hash_tid(int tid) { return (tid&(NR_BUCKETS-1)); } - - /* O(1) */ -+static void - #if defined(__i386__) --static void __thread_add_tid_(_pthread_descr*root,_pthread_descr thread) __attribute__((regparm(2))); -+__attribute__((regparm(2))) - #endif --static void __thread_add_tid_(_pthread_descr*root,_pthread_descr thread) { -+__thread_add_tid_(_pthread_descr*root,_pthread_descr thread) { - _pthread_descr tmp=*root; - thread->prev=root; - thread->next=tmp; -@@ -75,13 +76,9 @@ - - /* find thread by thread-id O(n) (LOCK struct if found) */ - /* O(n*) linear to the number of thread in the same bucket */ --#if defined(__i386__) --static _pthread_descr __thread_find_(int pid) __attribute__((regparm(1))); --_pthread_descr __thread_find(int pid) { return __thread_find_(pid); } --#else --_pthread_descr __thread_find(int pid) __attribute__((alias("__thread_find_"))); --#endif --static _pthread_descr __thread_find_(int pid) { -+ -+static _pthread_descr -+__thread_find_(int pid) { - _pthread_descr cur; - if (__thread_started==PTHREAD_ONCE_INIT) { /* uninitialised */ - LOCK(&_main_thread); -@@ -96,6 +93,13 @@ - return cur; - } - -+#if defined(__i386__) -+_pthread_descr -+__thread_find(int pid) { return __thread_find_(pid); } -+#else -+_pthread_descr __thread_find(int pid) __attribute__((alias("__thread_find_"))); -+#endif -+ - /* get thread-self descriptor O(1)/O(n*) */ - _pthread_descr __thread_self(void) { - /* O(1) "search" */ diff --git a/package/base/dietlibc/pkg_patch/pkg_sed.patch b/package/base/dietlibc/pkg_patch/pkg_sed.patch index fff885292..05d96da0b 100644 --- a/package/base/dietlibc/pkg_patch/pkg_sed.patch +++ b/package/base/dietlibc/pkg_patch/pkg_sed.patch @@ -1,26 +1,16 @@ -# --- ROCK-COPYRIGHT-NOTE-BEGIN --- -# -# This copyright note is auto-generated by ./scripts/Create-CopyPatch. -# Please add additional copyright information _after_ the line containing -# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by -# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! -# -# ROCK Linux: rock-src/package/base/dietlibc/pkg_patch/pkg_sed.patch -# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf -# -# This patch file is dual-licensed. It is available under the license the -# patched project is licensed under, as long as it is an OpenSource license -# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms -# of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# --- ROCK-COPYRIGHT-NOTE-END --- - ---- ./lib/Makefile.in~ Tue Mar 18 17:56:06 2003 -+++ ./lib/Makefile.in Sat Apr 19 19:39:31 2003 -@@ -170,7 +170,7 @@ - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +--- ./lib/Makefile.in.orig 2004-08-12 21:39:45.757782264 +0200 ++++ ./lib/Makefile.in 2004-08-12 21:42:39.214412848 +0200 +@@ -41,7 +41,7 @@ + subdir = lib + DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/regex_.h $(srcdir)/stdbool_.h \ +- alloca.c getline.c memchr.c memcmp.c memmove.c mkstemp.c \ ++ alloca.c memchr.c memcmp.c memmove.c mkstemp.c \ + obstack.c obstack.h regex.c strerror.c strverscmp.c + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/config/codeset.m4 \ +@@ -68,7 +68,7 @@ + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/getline.Po \ @@ -28,16 +18,7 @@ @AMDEP_TRUE@ $(DEPDIR)/memchr.Po $(DEPDIR)/memcmp.Po \ @AMDEP_TRUE@ $(DEPDIR)/memmove.Po $(DEPDIR)/mkstemp.Po \ @AMDEP_TRUE@ $(DEPDIR)/obstack.Po $(DEPDIR)/regex.Po \ -@@ -185,7 +185,7 @@ - HEADERS = $(noinst_HEADERS) - - DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in alloca.c \ -- getline.c memchr.c memcmp.c memmove.c mkstemp.c obstack.c \ -+ memchr.c memcmp.c memmove.c mkstemp.c obstack.c \ - obstack.h regex.c strerror.c strverscmp.c - SOURCES = $(libsed_a_SOURCES) - -@@ -215,7 +215,6 @@ +@@ -259,7 +259,6 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ diff --git a/package/base/dietlibc/realpath-fix-thanks-fefe.patch b/package/base/dietlibc/realpath-fix-thanks-fefe.patch deleted file mode 100644 index 2e7cc2e51..000000000 --- a/package/base/dietlibc/realpath-fix-thanks-fefe.patch +++ /dev/null @@ -1,129 +0,0 @@ ---- ./libshell/realpath.c 27 Jan 2004 21:50:42 -0000 1.9 -+++ ./libshell/realpath.c 10 May 2004 16:44:14 -0000 1.10 -@@ -1,14 +1,3 @@ --/* realpath - determine the absolute pathname of a file -- -- Copyright (C) 2003 Thomas M. Ogrisegg -- -- This realpath has still space for improvements: -- e.g., if the initial path does not start with '/' it should -- be checked whether the first path component(s) is/are symlinks. -- This would save lots of filesystem lookups, but also greatly -- increases complexity. --*/ -- - #include - #include - #include -@@ -16,75 +5,44 @@ - #include - #include - #include -+#include - --#define CD(x) (x=='/'||!x) -- --char * --realpath (const char *file, char *dst) --{ -- unsigned char buffer[PATH_MAX]; -- size_t i, off; -- -- if (!file || !dst) { errno = EINVAL; return (NULL); } -- if (!*file) { errno = ENOENT; return (NULL); } -- -- if (*file != '/') { -- if (!getcwd (buffer, sizeof (buffer))) return (NULL); -- off = strlen (buffer); -- while (file[0] == '.' && file[1] == '.' && file[2] == '/') { -- if (off) off--; -- while (off && buffer[off] != '/') off--; -- file += 3; -- } -- buffer[off++] = '/'; -- i = strlen (file); -- if (i+off >= PATH_MAX) return (NULL); -- memcpy (buffer+off, file, i+1); -- file = buffer; -+static char* myrealpath(const char* file, char* dest, int count) { -+/* assume dest has PATH_MAX space */ -+ char buf[PATH_MAX+1]; -+ char* c; -+ int i; -+ -+ if (count<0) { errno=EMLINK; return 0; } -+ if (chdir(file)==0) -+ /* hurray! The easy case: it's a directory! */ -+ return getcwd(dest,PATH_MAX); -+ -+ c=strrchr(file,'/'); -+ if (c) { -+ if (c-file>PATH_MAX) return 0; -+ memcpy(buf,file,c-file); -+ buf[c-file]=0; -+ if (chdir(buf)==-1) return 0; -+ file=c+1; - } -- -- off = i = 0; -- -- while (file[i]) { -- if (file[i] == '.' && file[i-1] == '/' && -- ((file[i+1] == '.'&&CD(file[i+2])) || CD(file[i+1]))) { -- if (file[i+1] == '/') { i+=2; continue; } -- if (file[i+1] == '.') { -- if (off > 2) off -= 2; -- while (off && dst[off] != '/') off--; -- i++; -- } -- i++; -- continue; -- } -- -- if (file[i] == '/' && off < PATH_MAX) { -- unsigned char buf[PATH_MAX]; -- int ret; -- -- if (file[i+1] == '/') { i+=2; continue; } -- -- if (off) { -- if (dst[off-1] == '/') { i++; continue; } -- --last_test: -- dst[off] = 0; -- if (-1 != (ret = readlink (dst, buf, sizeof (buf)))) { -- struct stat st; -- buf[ret] = 0; -- if (-1 == stat (buf, &st)) return (NULL); -- if (ret+(PATH_MAX-i) > PATH_MAX) return (NULL); -- strcpy (buf+ret, file+i); -- return (realpath (buf, dst)); -- } else -- if (errno == EACCES || errno == ENOENT) return (NULL); -- -- if (!file[i]) return (dst); -- } -- } -- dst[off++] = file[i++]; -+ if (readlink(file,buf,PATH_MAX)==0) -+ return myrealpath(buf,dest,count-1); -+ if (getcwd(dest,PATH_MAX)==0) return 0; -+ i=strlen(dest); dest[i]='/'; ++i; -+ for (; i 2 && dst[off-1] == '/') off--; -- goto last_test; -+char* realpath(const char* file, char* dest) { -+ int fd=open(".",O_RDONLY); /* save directory */ -+ char* res=myrealpath(file,dest,31); -+ fchdir(fd); -+ close(fd); -+ return res; - } -+