@ -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"); |
@ -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 |
@ -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" */ |
@ -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;
|
|||
} |
|||
+
|