Browse Source

fake:


			
			
				rocklinux
			
			
		
fake 20 years ago
parent
commit
ea3cce92bf
7 changed files with 23 additions and 402 deletions
  1. +0
    -53
      package/base/dietlibc/diethome.patch
  2. +7
    -6
      package/base/dietlibc/dietlibc.conf
  3. +2
    -2
      package/base/dietlibc/dietlibc.desc
  4. +0
    -57
      package/base/dietlibc/dirent_h.patch
  5. +0
    -122
      package/base/dietlibc/gcc34.patch
  6. +14
    -33
      package/base/dietlibc/pkg_patch/pkg_sed.patch
  7. +0
    -129
      package/base/dietlibc/realpath-fix-thanks-fefe.patch

+ 0
- 53
package/base/dietlibc/diethome.patch

@ -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");

+ 7
- 6
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/`"

+ 2
- 2
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/

+ 0
- 57
package/base/dietlibc/dirent_h.patch

@ -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

+ 0
- 122
package/base/dietlibc/gcc34.patch

@ -1,122 +0,0 @@
Some fixes for compilation with gcc-3.4.
- Rene Rebe <rene@rocklinux.org>
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" */

+ 14
- 33
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@

+ 0
- 129
package/base/dietlibc/realpath-fix-thanks-fefe.patch

@ -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 <tom-dietlibc@fnord.at>
-
- 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 <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
@@ -16,75 +5,44 @@
#include <errno.h>
#include <unistd.h>
#include <string.h>
+#include <fcntl.h>
-#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<PATH_MAX-1; ++i) {
+ if (!(dest[i]=*file)) break;
+ ++file;
}
+ dest[i]=0;
+ return dest;
+}
- if (off > 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;
}
+

Loading…
Cancel
Save