aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/ucp/controller/ssh:
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-03-19 21:20:38 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-03-19 21:20:38 +0100
commit220d388cac09883d554b9640976a082d8ebc5f9d (patch)
tree5f124b917bcb83904c673359159155797afac4d9 /phpBB/phpbb/ucp/controller/ssh:
parent0d04f53f374db12a1a285992a9c789a836848b3e (diff)
downloadforums-220d388cac09883d554b9640976a082d8ebc5f9d.tar
forums-220d388cac09883d554b9640976a082d8ebc5f9d.tar.gz
forums-220d388cac09883d554b9640976a082d8ebc5f9d.tar.bz2
forums-220d388cac09883d554b9640976a082d8ebc5f9d.tar.xz
forums-220d388cac09883d554b9640976a082d8ebc5f9d.zip
[ticket/15997] Use higher than default timeout for webdriver connections
PHPBB3-15997
Diffstat (limited to 'phpBB/phpbb/ucp/controller/ssh:')
0 files changed, 0 insertions, 0 deletions
ss='ctrl'>
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-06-04 18:31:57 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-06-04 18:31:57 +0000
commit09e967c2d732783b2579e4e120cd9b608404cb00 (patch)
tree8d2783a6a7e33608c6012efd6a88b8f5694df81d /mdk-stage1/dietlibc
parent18fcff49d3c836697d3b75a3d01d31c700e69974 (diff)
downloaddrakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.gz
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.bz2
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.xz
drakx-09e967c2d732783b2579e4e120cd9b608404cb00.zip
Merge from R9_0-AMD64, most notably:
- AMD64 support to insmod-busybox, minilibc, et al. - Sync with insmod-modutils 2.4.19 something but everyone should use dietlibc nowadays - Factor out compilation and prefix with $(DIET) for dietlibc builds - 64-bit & varargs fixes
Diffstat (limited to 'mdk-stage1/dietlibc')
-rw-r--r--mdk-stage1/dietlibc/.cvsignore16
-rw-r--r--mdk-stage1/dietlibc/AUTHOR2
-rw-r--r--mdk-stage1/dietlibc/Makefile351
-rw-r--r--mdk-stage1/dietlibc/README14
-rw-r--r--mdk-stage1/dietlibc/alpha/Makefile.add2
-rw-r--r--mdk-stage1/dietlibc/alpha/__longjmp.S9
-rw-r--r--mdk-stage1/dietlibc/alpha/clone.S2
-rw-r--r--mdk-stage1/dietlibc/alpha/setjmp.S31
-rw-r--r--mdk-stage1/dietlibc/alpha/start.S20
-rw-r--r--mdk-stage1/dietlibc/alpha/unified.S12
-rw-r--r--mdk-stage1/dietlibc/diet.c317
-rw-r--r--mdk-stage1/dietlibc/dietdirent.h4
-rw-r--r--mdk-stage1/dietlibc/dietfeatures.h92
-rw-r--r--mdk-stage1/dietlibc/dietstdio.h84
-rw-r--r--mdk-stage1/dietlibc/i386/Makefile.add7
-rw-r--r--mdk-stage1/dietlibc/i386/__longjmp.S1
-rw-r--r--mdk-stage1/dietlibc/i386/__testandset.S1
-rw-r--r--mdk-stage1/dietlibc/i386/clone.S29
-rw-r--r--mdk-stage1/dietlibc/i386/setjmp.S55
-rw-r--r--mdk-stage1/dietlibc/i386/start.S69
-rw-r--r--mdk-stage1/dietlibc/i386/unified.S35
-rw-r--r--mdk-stage1/dietlibc/include/alloca.h13
-rw-r--r--mdk-stage1/dietlibc/include/arpa/inet.h1
-rw-r--r--mdk-stage1/dietlibc/include/arpa/nameser.h36
-rw-r--r--mdk-stage1/dietlibc/include/assert.h17
-rw-r--r--mdk-stage1/dietlibc/include/daemon.h2
-rw-r--r--mdk-stage1/dietlibc/include/dirent.h42
-rw-r--r--mdk-stage1/dietlibc/include/dlfcn.h3
-rw-r--r--mdk-stage1/dietlibc/include/elf.h781
-rw-r--r--mdk-stage1/dietlibc/include/endian.h45
-rw-r--r--mdk-stage1/dietlibc/include/errno.h543
-rw-r--r--mdk-stage1/dietlibc/include/fcntl.h550
-rw-r--r--mdk-stage1/dietlibc/include/features.h9
-rw-r--r--mdk-stage1/dietlibc/include/fnmatch.h2
-rw-r--r--mdk-stage1/dietlibc/include/ftw.h16
-rw-r--r--mdk-stage1/dietlibc/include/getopt.h6
-rw-r--r--mdk-stage1/dietlibc/include/glob.h2
-rw-r--r--mdk-stage1/dietlibc/include/grp.h10
-rw-r--r--mdk-stage1/dietlibc/include/inttypes.h247
-rw-r--r--mdk-stage1/dietlibc/include/limits.h51
-rw-r--r--mdk-stage1/dietlibc/include/locale.h86
-rw-r--r--mdk-stage1/dietlibc/include/math.h35
-rw-r--r--mdk-stage1/dietlibc/include/net/if.h93
-rw-r--r--mdk-stage1/dietlibc/include/net/if_arp.h109
-rw-r--r--mdk-stage1/dietlibc/include/net/route.h52
-rw-r--r--mdk-stage1/dietlibc/include/netdb.h64
-rw-r--r--mdk-stage1/dietlibc/include/netinet/in.h399
-rw-r--r--mdk-stage1/dietlibc/include/netinet/ip.h117
-rw-r--r--mdk-stage1/dietlibc/include/paths.h7
-rw-r--r--mdk-stage1/dietlibc/include/pthread.h37
-rw-r--r--mdk-stage1/dietlibc/include/pwd.h15
-rw-r--r--mdk-stage1/dietlibc/include/regex.h6
-rw-r--r--mdk-stage1/dietlibc/include/resolv.h125
-rw-r--r--mdk-stage1/dietlibc/include/rpc/auth.h23
-rw-r--r--mdk-stage1/dietlibc/include/rpc/auth_des.h8
-rw-r--r--mdk-stage1/dietlibc/include/rpc/auth_unix.h4
-rw-r--r--mdk-stage1/dietlibc/include/rpc/clnt.h112
-rw-r--r--mdk-stage1/dietlibc/include/rpc/key_prot.h74
-rw-r--r--mdk-stage1/dietlibc/include/rpc/netdb.h4
-rw-r--r--mdk-stage1/dietlibc/include/rpc/pmap_clnt.h38
-rw-r--r--mdk-stage1/dietlibc/include/rpc/pmap_prot.h22
-rw-r--r--mdk-stage1/dietlibc/include/rpc/pmap_rmt.h10
-rw-r--r--mdk-stage1/dietlibc/include/rpc/rpc.h2
-rw-r--r--mdk-stage1/dietlibc/include/rpc/rpc_msg.h24
-rw-r--r--mdk-stage1/dietlibc/include/rpc/svc.h22
-rw-r--r--mdk-stage1/dietlibc/include/rpc/types.h16
-rw-r--r--mdk-stage1/dietlibc/include/rpc/xdr.h78
-rw-r--r--mdk-stage1/dietlibc/include/sched.h13
-rw-r--r--mdk-stage1/dietlibc/include/setjmp.h152
-rw-r--r--mdk-stage1/dietlibc/include/shadow.h8
-rw-r--r--mdk-stage1/dietlibc/include/signal.h487
-rw-r--r--mdk-stage1/dietlibc/include/stdint.h26
-rw-r--r--mdk-stage1/dietlibc/include/stdio.h106
-rw-r--r--mdk-stage1/dietlibc/include/stdlib.h75
-rw-r--r--mdk-stage1/dietlibc/include/string.h53
-rw-r--r--mdk-stage1/dietlibc/include/strings.h25
-rw-r--r--mdk-stage1/dietlibc/include/sys/cdefs.h35
-rw-r--r--mdk-stage1/dietlibc/include/sys/file.h11
-rw-r--r--mdk-stage1/dietlibc/include/sys/io.h47
-rw-r--r--mdk-stage1/dietlibc/include/sys/ioctl.h26
-rw-r--r--mdk-stage1/dietlibc/include/sys/ipc.h45
-rw-r--r--mdk-stage1/dietlibc/include/sys/kd.h179
-rw-r--r--mdk-stage1/dietlibc/include/sys/mman.h165
-rw-r--r--mdk-stage1/dietlibc/include/sys/mount.h74
-rw-r--r--mdk-stage1/dietlibc/include/sys/msg.h48
-rw-r--r--mdk-stage1/dietlibc/include/sys/mtio.h336
-rw-r--r--mdk-stage1/dietlibc/include/sys/param.h22
-rw-r--r--mdk-stage1/dietlibc/include/sys/poll.h40
-rw-r--r--mdk-stage1/dietlibc/include/sys/ptrace.h840
-rw-r--r--mdk-stage1/dietlibc/include/sys/reboot.h21
-rw-r--r--mdk-stage1/dietlibc/include/sys/resource.h53
-rw-r--r--mdk-stage1/dietlibc/include/sys/select.h22
-rw-r--r--mdk-stage1/dietlibc/include/sys/sem.h74
-rw-r--r--mdk-stage1/dietlibc/include/sys/sendfile.h8
-rw-r--r--mdk-stage1/dietlibc/include/sys/shm.h66
-rw-r--r--mdk-stage1/dietlibc/include/sys/socket.h492
-rw-r--r--mdk-stage1/dietlibc/include/sys/stat.h494
-rw-r--r--mdk-stage1/dietlibc/include/sys/sysinfo.h20
-rw-r--r--mdk-stage1/dietlibc/include/sys/syslog.h2
-rw-r--r--mdk-stage1/dietlibc/include/sys/time.h50
-rw-r--r--mdk-stage1/dietlibc/include/sys/times.h12
-rw-r--r--mdk-stage1/dietlibc/include/sys/types.h136
-rw-r--r--mdk-stage1/dietlibc/include/sys/uio.h2
-rw-r--r--mdk-stage1/dietlibc/include/sys/un.h7
-rw-r--r--mdk-stage1/dietlibc/include/sys/vfs.h26
-rw-r--r--mdk-stage1/dietlibc/include/sys/wait.h10
-rw-r--r--mdk-stage1/dietlibc/include/termios.h373
-rw-r--r--mdk-stage1/dietlibc/include/time.h20
-rw-r--r--mdk-stage1/dietlibc/include/unistd.h113
-rw-r--r--mdk-stage1/dietlibc/include/utmp.h23
-rw-r--r--mdk-stage1/dietlibc/lib/__dtostr.c190
-rw-r--r--mdk-stage1/dietlibc/lib/__fstat64.c7
-rw-r--r--mdk-stage1/dietlibc/lib/__getcwd.c1
-rw-r--r--mdk-stage1/dietlibc/lib/__isnan.c7
-rw-r--r--mdk-stage1/dietlibc/lib/__lltostr.c4
-rw-r--r--mdk-stage1/dietlibc/lib/__lstat64.c7
-rw-r--r--mdk-stage1/dietlibc/lib/__ltostr.c5
-rw-r--r--mdk-stage1/dietlibc/lib/__stat64.c7
-rw-r--r--mdk-stage1/dietlibc/lib/__stat64_cvt.c2
-rw-r--r--mdk-stage1/dietlibc/lib/_brk.c13
-rw-r--r--mdk-stage1/dietlibc/lib/abort.c10
-rw-r--r--mdk-stage1/dietlibc/lib/abs.c10
-rw-r--r--mdk-stage1/dietlibc/lib/accept.c8
-rw-r--r--mdk-stage1/dietlibc/lib/alloc.c372
-rw-r--r--mdk-stage1/dietlibc/lib/assert_fail.c11
-rw-r--r--mdk-stage1/dietlibc/lib/atexit.c32
-rw-r--r--mdk-stage1/dietlibc/lib/atoi.c21
-rw-r--r--mdk-stage1/dietlibc/lib/atol.c25
-rw-r--r--mdk-stage1/dietlibc/lib/bind.c11
-rw-r--r--mdk-stage1/dietlibc/lib/bsearch.c30
-rw-r--r--mdk-stage1/dietlibc/lib/cfmakeraw.c3
-rw-r--r--mdk-stage1/dietlibc/lib/closedir.c3
-rw-r--r--mdk-stage1/dietlibc/lib/connect.c7
-rw-r--r--mdk-stage1/dietlibc/lib/creat.c4
-rw-r--r--mdk-stage1/dietlibc/lib/errno_location.c2
-rw-r--r--mdk-stage1/dietlibc/lib/exec_lib.c7
-rw-r--r--mdk-stage1/dietlibc/lib/execl.c3
-rw-r--r--mdk-stage1/dietlibc/lib/execlp.c6
-rw-r--r--mdk-stage1/dietlibc/lib/execv.c4
-rw-r--r--mdk-stage1/dietlibc/lib/execvp.c23
-rw-r--r--mdk-stage1/dietlibc/lib/ftw.c77
-rw-r--r--mdk-stage1/dietlibc/lib/getdomainname.c3
-rw-r--r--mdk-stage1/dietlibc/lib/getenv.c3
-rw-r--r--mdk-stage1/dietlibc/lib/gethostname.c3
-rw-r--r--mdk-stage1/dietlibc/lib/getopt.c155
-rw-r--r--mdk-stage1/dietlibc/lib/getpeername.c13
-rw-r--r--mdk-stage1/dietlibc/lib/getsockname.c11
-rw-r--r--mdk-stage1/dietlibc/lib/getsockopt.c11
-rw-r--r--mdk-stage1/dietlibc/lib/htonl.c1
-rw-r--r--mdk-stage1/dietlibc/lib/htons.c1
-rw-r--r--mdk-stage1/dietlibc/lib/if_indextoname.c3
-rw-r--r--mdk-stage1/dietlibc/lib/if_nametoindex.c5
-rw-r--r--mdk-stage1/dietlibc/lib/isalnum.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isalpha.c7
-rw-r--r--mdk-stage1/dietlibc/lib/isascii.c6
-rw-r--r--mdk-stage1/dietlibc/lib/isatty.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isblank.c4
-rw-r--r--mdk-stage1/dietlibc/lib/iscntrl.c7
-rw-r--r--mdk-stage1/dietlibc/lib/isdigit.c7
-rw-r--r--mdk-stage1/dietlibc/lib/isgraph.c7
-rw-r--r--mdk-stage1/dietlibc/lib/islower.c7
-rw-r--r--mdk-stage1/dietlibc/lib/isprint.c7
-rw-r--r--mdk-stage1/dietlibc/lib/ispunct.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isspace.c7
-rw-r--r--mdk-stage1/dietlibc/lib/isupper.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isxdigit.c9
-rw-r--r--mdk-stage1/dietlibc/lib/listen.c11
-rw-r--r--mdk-stage1/dietlibc/lib/lockf.c1
-rw-r--r--mdk-stage1/dietlibc/lib/longjmp.c57
-rw-r--r--mdk-stage1/dietlibc/lib/lseek64.c10
-rw-r--r--mdk-stage1/dietlibc/lib/memccpy.c1
-rw-r--r--mdk-stage1/dietlibc/lib/memchr.c12
-rw-r--r--mdk-stage1/dietlibc/lib/memcmp.c2
-rw-r--r--mdk-stage1/dietlibc/lib/memcpy.c2
-rw-r--r--mdk-stage1/dietlibc/lib/memmove.c1
-rw-r--r--mdk-stage1/dietlibc/lib/memset.c4
-rw-r--r--mdk-stage1/dietlibc/lib/mkfifo.c4
-rw-r--r--mdk-stage1/dietlibc/lib/msgctl.c3
-rw-r--r--mdk-stage1/dietlibc/lib/msgget.c3
-rw-r--r--mdk-stage1/dietlibc/lib/msgrcv.c8
-rw-r--r--mdk-stage1/dietlibc/lib/msgsnd.c3
-rw-r--r--mdk-stage1/dietlibc/lib/open64.c9
-rw-r--r--mdk-stage1/dietlibc/lib/opendir.c26
-rw-r--r--mdk-stage1/dietlibc/lib/perror.c32
-rw-r--r--mdk-stage1/dietlibc/lib/pread.c1
-rw-r--r--mdk-stage1/dietlibc/lib/pread64.c3
-rw-r--r--mdk-stage1/dietlibc/lib/putenv.c19
-rw-r--r--mdk-stage1/dietlibc/lib/qsort.c22
-rw-r--r--mdk-stage1/dietlibc/lib/raise.c3
-rw-r--r--mdk-stage1/dietlibc/lib/rand.c7
-rw-r--r--mdk-stage1/dietlibc/lib/readdir.c2
-rw-r--r--mdk-stage1/dietlibc/lib/reboot.c6
-rw-r--r--mdk-stage1/dietlibc/lib/recv.c8
-rw-r--r--mdk-stage1/dietlibc/lib/recvfrom.c8
-rw-r--r--mdk-stage1/dietlibc/lib/recvmsg.c8
-rw-r--r--mdk-stage1/dietlibc/lib/remove.c2
-rw-r--r--mdk-stage1/dietlibc/lib/sbrk.c11
-rw-r--r--mdk-stage1/dietlibc/lib/semctl.c13
-rw-r--r--mdk-stage1/dietlibc/lib/semget.c3
-rw-r--r--mdk-stage1/dietlibc/lib/semop.c3
-rw-r--r--mdk-stage1/dietlibc/lib/send.c8
-rw-r--r--mdk-stage1/dietlibc/lib/sendmsg.c8
-rw-r--r--mdk-stage1/dietlibc/lib/sendto.c10
-rw-r--r--mdk-stage1/dietlibc/lib/setsockopt.c11
-rw-r--r--mdk-stage1/dietlibc/lib/shmat.c5
-rw-r--r--mdk-stage1/dietlibc/lib/shmctl.c3
-rw-r--r--mdk-stage1/dietlibc/lib/shmdt.c3
-rw-r--r--mdk-stage1/dietlibc/lib/shmget.c3
-rw-r--r--mdk-stage1/dietlibc/lib/shutdown.c8
-rw-r--r--mdk-stage1/dietlibc/lib/sigaddset.c28
-rw-r--r--mdk-stage1/dietlibc/lib/sigdelset.c28
-rw-r--r--mdk-stage1/dietlibc/lib/sigemptyset.c12
-rw-r--r--mdk-stage1/dietlibc/lib/sigfillset.c16
-rw-r--r--mdk-stage1/dietlibc/lib/sigismember.c29
-rw-r--r--mdk-stage1/dietlibc/lib/sigjmp.c35
-rw-r--r--mdk-stage1/dietlibc/lib/sleep.c2
-rw-r--r--mdk-stage1/dietlibc/lib/snprintf.c3
-rw-r--r--mdk-stage1/dietlibc/lib/socket.c11
-rw-r--r--mdk-stage1/dietlibc/lib/sprintf.c10
-rw-r--r--mdk-stage1/dietlibc/lib/sscanf.c3
-rw-r--r--mdk-stage1/dietlibc/lib/strcasecmp.c29
-rw-r--r--mdk-stage1/dietlibc/lib/strchr.c1
-rw-r--r--mdk-stage1/dietlibc/lib/strcmp.c2
-rw-r--r--mdk-stage1/dietlibc/lib/strcpy.c7
-rw-r--r--mdk-stage1/dietlibc/lib/strerror.c22
-rw-r--r--mdk-stage1/dietlibc/lib/strlen.c2
-rw-r--r--mdk-stage1/dietlibc/lib/strncasecmp.c34
-rw-r--r--mdk-stage1/dietlibc/lib/strncat.c7
-rw-r--r--mdk-stage1/dietlibc/lib/strncmp.c13
-rw-r--r--mdk-stage1/dietlibc/lib/strncpy.c9
-rw-r--r--mdk-stage1/dietlibc/lib/strsep.c4
-rw-r--r--mdk-stage1/dietlibc/lib/strstr.c8
-rw-r--r--mdk-stage1/dietlibc/lib/strtod.c104
-rw-r--r--mdk-stage1/dietlibc/lib/strtok.c2
-rw-r--r--mdk-stage1/dietlibc/lib/strtol.c17
-rw-r--r--mdk-stage1/dietlibc/lib/strtoll.c5
-rw-r--r--mdk-stage1/dietlibc/lib/strtoul.c32
-rw-r--r--mdk-stage1/dietlibc/lib/strtoull.c1
-rw-r--r--mdk-stage1/dietlibc/lib/sys_siglist.c209
-rw-r--r--mdk-stage1/dietlibc/lib/tcdrain.c1
-rw-r--r--mdk-stage1/dietlibc/lib/tcflush.c24
-rw-r--r--mdk-stage1/dietlibc/lib/tcgetpgrp.c7
-rw-r--r--mdk-stage1/dietlibc/lib/tcsetattr.c46
-rw-r--r--mdk-stage1/dietlibc/lib/tcsetpgrp.c1
-rw-r--r--mdk-stage1/dietlibc/lib/tolower.c6
-rw-r--r--mdk-stage1/dietlibc/lib/toupper.c6
-rw-r--r--mdk-stage1/dietlibc/lib/ttyname.c21
-rw-r--r--mdk-stage1/dietlibc/lib/usleep.c6
-rw-r--r--mdk-stage1/dietlibc/lib/vfork.c6
-rw-r--r--mdk-stage1/dietlibc/lib/vsnprintf.c255
-rw-r--r--mdk-stage1/dietlibc/lib/vsprintf.c10
-rw-r--r--mdk-stage1/dietlibc/lib/vsscanf.c311
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft.c132
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft2.c264
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrgid.c13
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrnam.c13
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyaddr.c37
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyaddr_r.c67
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname.c39
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname2.c40
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname2_r.c35
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname_r.c54
-rw-r--r--mdk-stage1/dietlibc/libcruft/getlogin.c3
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpagesize.c1
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpass.c24
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwnam.c15
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwuid.c12
-rw-r--r--mdk-stage1/dietlibc/libcruft/getspnam.c15
-rw-r--r--mdk-stage1/dietlibc/libcruft/herrno_location.c9
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_aton.c2
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_ntoa.c2
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_ntop.c12
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_pton.c17
-rw-r--r--mdk-stage1/dietlibc/libcruft/initgroups.c3
-rw-r--r--mdk-stage1/dietlibc/libcruft/mkstemp.c14
-rw-r--r--mdk-stage1/dietlibc/libcruft/res_init.c6
-rw-r--r--mdk-stage1/dietlibc/libcrypt/crypt.c31
-rw-r--r--mdk-stage1/dietlibc/libdl/Makefile32
-rw-r--r--mdk-stage1/dietlibc/libdl/README82
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_int.h138
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_jump.S53
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_open.c228
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_search.c81
-rw-r--r--mdk-stage1/dietlibc/libdl/dlclose.c40
-rw-r--r--mdk-stage1/dietlibc/libdl/dlerror.c57
-rw-r--r--mdk-stage1/dietlibc/libdl/dlopen.c31
-rw-r--r--mdk-stage1/dietlibc/libdl/dlsym.c93
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-iscntrl.c3
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-isgraph.c5
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-islower.c3
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-isprint.c4
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-isupper.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/CHANGES6
-rw-r--r--mdk-stage1/dietlibc/libpthread/Makefile7
-rw-r--r--mdk-stage1/dietlibc/libpthread/README10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_atfork.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_init.c1
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setdetachstate.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setinheritsched.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setschedparam.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setscope.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setstacksize.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cancel.c6
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_broadcast.c9
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_destroy.c4
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_init.c1
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_signal.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_timedwait.c51
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_wait.c26
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_create.c27
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_detach.c11
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_join.c21
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_key_create.c7
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_key_delete.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_destroy.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_init.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_lock.c21
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_trylock.c9
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_unlock.c9
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutexattr_setkind_np.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setcancelstate.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setspecific.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_spinlock.c12
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_alloc.c18
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_fcntl.c1
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_logging.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_open.c1
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_tcdrain.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_waitpid.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_testcancel.c2
-rw-r--r--mdk-stage1/dietlibc/libpthread/thread_internal.h23
-rw-r--r--mdk-stage1/dietlibc/libregex/rx.c128
-rw-r--r--mdk-stage1/dietlibc/librpc/auth_none.c12
-rw-r--r--mdk-stage1/dietlibc/librpc/auth_unix.c17
-rw-r--r--mdk-stage1/dietlibc/librpc/authunix_prot.c2
-rw-r--r--mdk-stage1/dietlibc/librpc/bindresvport.c4
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_generic.c10
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_raw.c17
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_simple.c10
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_tcp.c48
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_udp.c51
-rw-r--r--mdk-stage1/dietlibc/librpc/get_myaddress.c2
-rw-r--r--mdk-stage1/dietlibc/librpc/getrpcent.c9
-rw-r--r--mdk-stage1/dietlibc/librpc/getrpcport.c6
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_clnt.c17
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_getmaps.c5
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_getport.c16
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_prot2.c4
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_rmt.c111
-rw-r--r--mdk-stage1/dietlibc/librpc/rpc_callmsg.c12
-rw-r--r--mdk-stage1/dietlibc/librpc/rpc_prot.c4
-rw-r--r--mdk-stage1/dietlibc/librpc/svc.c39
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_auth_unix.c6
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_raw.c6
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_run.c2
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_simple.c6
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_tcp.c58
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_udp.c86
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr.c36
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_array.c38
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_mem.c36
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_rec.c138
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_reference.c14
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_stdio.c26
-rw-r--r--mdk-stage1/dietlibc/libshell/fnmatch.c34
-rw-r--r--mdk-stage1/dietlibc/libshell/glob.c84
-rw-r--r--mdk-stage1/dietlibc/libshell/realpath.c18
-rw-r--r--mdk-stage1/dietlibc/libstdio/fclose.c8
-rw-r--r--mdk-stage1/dietlibc/libstdio/fdglue.c34
-rw-r--r--mdk-stage1/dietlibc/libstdio/fdopen.c18
-rw-r--r--mdk-stage1/dietlibc/libstdio/feof.c2
-rw-r--r--mdk-stage1/dietlibc/libstdio/fflush.c34
-rw-r--r--mdk-stage1/dietlibc/libstdio/fgets.c4
-rw-r--r--mdk-stage1/dietlibc/libstdio/fopen.c8
-rw-r--r--mdk-stage1/dietlibc/libstdio/fprintf.c18
-rw-r--r--mdk-stage1/dietlibc/libstdio/fread.c55
-rw-r--r--mdk-stage1/dietlibc/libstdio/fseek.c7
-rw-r--r--mdk-stage1/dietlibc/libstdio/ftell.c2
-rw-r--r--mdk-stage1/dietlibc/libstdio/fwrite.c28
-rw-r--r--mdk-stage1/dietlibc/libstdio/printf.c20
-rw-r--r--mdk-stage1/dietlibc/libstdio/setvbuf.c32
-rw-r--r--mdk-stage1/dietlibc/libstdio/stderr.c25
-rw-r--r--mdk-stage1/dietlibc/libstdio/stdin.c26
-rw-r--r--mdk-stage1/dietlibc/libstdio/stdout.c25
-rw-r--r--mdk-stage1/dietlibc/libstdio/ungetc.c7
-rw-r--r--mdk-stage1/dietlibc/libugly/asctime_r.c2
-rw-r--r--mdk-stage1/dietlibc/libugly/asprintf.c9
-rw-r--r--mdk-stage1/dietlibc/libugly/getmntent.c11
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotoent.c130
-rw-r--r--mdk-stage1/dietlibc/libugly/gmtime_r.c6
-rw-r--r--mdk-stage1/dietlibc/libugly/isleap.c2
-rw-r--r--mdk-stage1/dietlibc/libugly/localtime_r.c8
-rw-r--r--mdk-stage1/dietlibc/libugly/logging.c38
-rw-r--r--mdk-stage1/dietlibc/libugly/mktime.c68
-rw-r--r--mdk-stage1/dietlibc/libugly/popen.c28
-rw-r--r--mdk-stage1/dietlibc/libugly/setenv.c12
-rw-r--r--mdk-stage1/dietlibc/libugly/strftime.c284
-rw-r--r--mdk-stage1/dietlibc/libugly/strsignal.c92
-rw-r--r--mdk-stage1/dietlibc/libugly/system.c36
-rw-r--r--mdk-stage1/dietlibc/libugly/time_table_spd.c5
-rw-r--r--mdk-stage1/dietlibc/libugly/tzfile.c37
-rw-r--r--mdk-stage1/dietlibc/ppc/__testandset.S9
-rw-r--r--mdk-stage1/dietlibc/ppc/mmap.c11
-rw-r--r--mdk-stage1/dietlibc/ppc/start.S32
-rw-r--r--mdk-stage1/dietlibc/ppc/unified.S37
-rw-r--r--mdk-stage1/dietlibc/sparc/Makefile.add1
-rw-r--r--mdk-stage1/dietlibc/sparc/__longjmp.S1
-rw-r--r--mdk-stage1/dietlibc/sparc/clone.S5
-rw-r--r--mdk-stage1/dietlibc/sparc/fork.S2
-rw-r--r--mdk-stage1/dietlibc/sparc/mmap.c4
-rw-r--r--mdk-stage1/dietlibc/sparc/pipe.S2
-rw-r--r--mdk-stage1/dietlibc/sparc/setjmp.S28
-rw-r--r--mdk-stage1/dietlibc/sparc/shmat.c2
-rw-r--r--mdk-stage1/dietlibc/sparc/start.S58
-rw-r--r--mdk-stage1/dietlibc/sparc/udiv.S102
-rw-r--r--mdk-stage1/dietlibc/sparc/umul.S6
-rw-r--r--mdk-stage1/dietlibc/sparc/unified.S10
-rw-r--r--mdk-stage1/dietlibc/sparc/urem.S102
-rw-r--r--mdk-stage1/dietlibc/syscalls.h151
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/__pread.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/_llseek.S4
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fstat64.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getdents64.S1
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getresuid.S4
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ioperm.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ipc.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/lstat64.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/nice.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/pause.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sendfile.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setresgid.S4
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setresuid.S4
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/socketcall.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/stat64.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/stime.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/syslog.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/time.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/umount2.S2
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/waitpid.S2
441 files changed, 13021 insertions, 4795 deletions
diff --git a/mdk-stage1/dietlibc/.cvsignore b/mdk-stage1/dietlibc/.cvsignore
index 7c88cb004..f0be42e21 100644
--- a/mdk-stage1/dietlibc/.cvsignore
+++ b/mdk-stage1/dietlibc/.cvsignore
@@ -10,3 +10,19 @@ bin-i386
bin-mips
bin-ppc
bin-sparc
+bin-mipsel
+bin-parisc
+bin-s390
+bin-sparc64
+pic-alpha
+pic-arm
+pic-i386
+pic-mips
+pic-ppc
+pic-sparc
+pic-mipsel
+pic-parisc
+pic-s390
+pic-sparc64
+bin-ia64
+bin-x86_64
diff --git a/mdk-stage1/dietlibc/AUTHOR b/mdk-stage1/dietlibc/AUTHOR
index 6d8ab1a05..3f6a44e6d 100644
--- a/mdk-stage1/dietlibc/AUTHOR
+++ b/mdk-stage1/dietlibc/AUTHOR
@@ -1 +1,3 @@
Felix von Leitner <felix-dietlibc@fefe.de>
+
+Please see the file THANKS for additional authors and contributors.
diff --git a/mdk-stage1/dietlibc/Makefile b/mdk-stage1/dietlibc/Makefile
index b6e7b2783..0fe32e61b 100644
--- a/mdk-stage1/dietlibc/Makefile
+++ b/mdk-stage1/dietlibc/Makefile
@@ -1,13 +1,101 @@
-ARCH=$(shell uname -m | sed 's/i[4-9]86/i386/')
+INSTALL=install
+prefix?=/usr
+# Set the following to install to a different root
+#DESTDIR=/tmp/fefix
+# Use "make DEBUG=1" to compile a debug version.
+
+MYARCH:=$(shell uname -m | sed -e 's/i[4-9]86/i386/' -e 's/armv[3-6][lb]/arm/' -e 's/ppc64/ppc/')
+
+# This extra-ugly cruft is here so make will not run uname and sed each
+# time it looks at $(OBJDIR). This alone sped up running make when
+# nothing has to be done from 1 sec to 0.12 sec on a 900 MHz Athlon.
+# We don't use ARCH:=$(MYARCH) so we can detect unknown architectures.
+ifeq ($(MYARCH),i386)
+ARCH=i386
+else
+ifeq ($(MYARCH),mips)
+ARCH=mips
+else
+ifeq ($(MYARCH),alpha)
+ARCH=alpha
+else
+ifeq ($(MYARCH),ppc)
+ARCH=ppc
+else
+ifeq ($(MYARCH),arm)
+ARCH=arm
+else
+ifeq ($(MYARCH),sparc)
+ARCH=sparc
+else
+ifeq ($(MYARCH),sparc64)
+ARCH=sparc64
+else
+ifeq ($(MYARCH),s390)
+ARCH=s390
+else
+ifeq ($(MYARCH),mipsel)
+ARCH=mipsel
+else
+ifeq ($(MYARCH),parisc)
+ARCH=parisc
+else
+ifeq ($(MYARCH),parisc64)
+ARCH=parisc
+MYARCH=parisc
+else
+ifeq ($(MYARCH),x86_64)
+ARCH=x86_64
+else
+ifeq ($(MYARCH),ia64)
+ARCH=ia64
+else
+$(error unknown architecture, please fix Makefile)
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+
+# ARCH=$(MYARCH)
+
+LIBDIR=${prefix}/lib
+ifeq ($(ARCH),x86_64)
+LIBDIR=${prefix}/lib64
+endif
+BINDIR=${prefix}/bin
+MAN1DIR=${prefix}/share/man/man1
+INSTALLHOME=$(LIBDIR)/dietlibc
OBJDIR=bin-$(ARCH)
+ILIBDIR=$(INSTALLHOME)/lib-$(ARCH)
-all: $(OBJDIR) $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a $(OBJDIR)/librpc.a $(OBJDIR)/diet
+HOME=$(shell pwd)
-CFLAGS=-pipe
+WHAT= $(OBJDIR) $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o \
+ $(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a \
+ $(OBJDIR)/libcompat.a $(OBJDIR)/libm.a \
+ $(OBJDIR)/librpc.a $(OBJDIR)/libpthread.a \
+ $(OBJDIR)/diet $(OBJDIR)/diet-i
+
+all: $(WHAT)
+
+profiling: $(OBJDIR)/libgmon.a $(OBJDIR)/pstart.o
+
+CFLAGS=-pipe -nostdinc
CROSS=
-VPATH=lib:libstdio:libugly:libcruft:libcrypt:libshell:liblatin1:librpc:libregex:syscalls.c
+CC=gcc
+
+VPATH=lib:libstdio:libugly:libcruft:libcrypt:libshell:liblatin1:libcompat:libdl:librpc:libregex:libm:profiling
SYSCALLOBJ=$(patsubst syscalls.s/%.S,$(OBJDIR)/%.o,$(wildcard syscalls.s/*.S))
@@ -17,13 +105,23 @@ LIBSTDIOOBJ=$(patsubst libstdio/%.c,$(OBJDIR)/%.o,$(wildcard libstdio/*.c))
LIBCRUFTOBJ=$(patsubst libcruft/%.c,$(OBJDIR)/%.o,$(wildcard libcruft/*.c))
LIBCRYPTOBJ=$(patsubst libcrypt/%.c,$(OBJDIR)/%.o,$(wildcard libcrypt/*.c))
LIBSHELLOBJ=$(patsubst libshell/%.c,$(OBJDIR)/%.o,$(wildcard libshell/*.c))
+LIBCOMPATOBJ=$(patsubst libcompat/%.c,$(OBJDIR)/%.o,$(wildcard libcompat/*.c)) $(OBJDIR)/syscall.o
+LIBMATH=$(patsubst libm/%.c,%.o,$(wildcard libm/*.c))
LIBRPCOBJ=$(patsubst librpc/%.c,$(OBJDIR)/%.o,$(wildcard librpc/*.c))
LIBREGEXOBJ=$(patsubst libregex/%.c,$(OBJDIR)/%.o,$(wildcard libregex/*.c))
+LIBDLOBJ=$(patsubst libdl/%.c,$(OBJDIR)/%.o,$(wildcard libdl/*.c)) $(OBJDIR)/_dl_jump.o
+
+LIBPTHREAD_OBJS=$(patsubst libpthread/%.c,$(OBJDIR)/%.o,$(shell ./threadsafe.sh)) $(OBJDIR)/__testandset.o
+
+LIBGMON_OBJS=$(OBJDIR)/__mcount.o $(OBJDIR)/monitor.o $(OBJDIR)/profil.o
+
include $(ARCH)/Makefile.add
-ifeq ($(CFLAGS),-pipe)
+LIBMATHOBJ=$(patsubst %,$(OBJDIR)/%,$(LIBMATH))
+
+ifeq ($(CFLAGS),-pipe -nostdinc)
CFLAGS+=-O -fomit-frame-pointer
endif
@@ -31,28 +129,39 @@ ifneq ($(DEBUG),)
CFLAGS = -g
COMMENT = :
endif
-CFLAGS += -Wall -Wno-switch
+CFLAGS += -Wall -W -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wredundant-decls -Wno-unused
PWD=$(shell pwd)
.SUFFIXES:
.SUFFIXES: .S .c
-$(OBJDIR):
+# added real dynamic dietlibc.so
+PICODIR = pic-$(ARCH)
+
+$(OBJDIR) $(PICODIR):
mkdir $@
% :: %,v
-$(OBJDIR)/%.o: %.S
+$(OBJDIR)/pstart.o: start.S
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -DPROFILING -c $< -o $@
+
+$(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h
$(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $< -o $@
+$(OBJDIR)/pthread_%.o: libpthread/pthread_%.c
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $< -o $@
+ $(COMMENT) -$(CROSS)strip -x -R .comment -R .note $@
+
$(OBJDIR)/%.o: %.c
$(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $< -o $@
- $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
+ $(COMMENT) -$(CROSS)strip -x -R .comment -R .note $@
-DIETLIBC_OBJ = $(SYSCALLOBJ) $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
+DIETLIBC_OBJ = $(OBJDIR)/unified.o \
+$(SYSCALLOBJ) $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
$(LIBCRUFTOBJ) $(LIBCRYPTOBJ) $(LIBSHELLOBJ) $(LIBREGEXOBJ) \
-$(OBJDIR)/__longjmp.o $(OBJDIR)/setjmp.o $(OBJDIR)/unified.o \
+$(OBJDIR)/__longjmp.o $(OBJDIR)/setjmp.o \
$(OBJDIR)/mmap.o $(OBJDIR)/clone.o
$(OBJDIR)/dietlibc.a: $(DIETLIBC_OBJ) $(OBJDIR)/start.o
@@ -65,67 +174,179 @@ LIBLATIN1_OBJS=$(patsubst liblatin1/%.c,$(OBJDIR)/%.o,$(wildcard liblatin1/*.c))
$(OBJDIR)/liblatin1.a: $(LIBLATIN1_OBJS)
$(CROSS)ar cru $@ $^
+$(OBJDIR)/libgmon.a: $(LIBGMON_OBJS)
+ $(CROSS)ar cru $@ $^
+
+$(OBJDIR)/libpthread.a: $(LIBPTHREAD_OBJS) dietfeatures.h
+ $(CROSS)ar cru $@ $(LIBPTHREAD_OBJS)
+
+$(OBJDIR)/libcompat.a: $(LIBCOMPATOBJ)
+ $(CROSS)ar cru $@ $(LIBCOMPATOBJ)
+
+$(OBJDIR)/libm.a: $(LIBMATHOBJ)
+ $(CROSS)ar cru $@ $(LIBMATHOBJ)
+
$(OBJDIR)/libdietc.so: $(OBJDIR)/dietlibc.a
$(CROSS)ld -whole-archive -shared -o $@ $^
+dyn: dyn_lib
+
+# added dynamic linker
+$(OBJDIR)/libdl.a: $(LIBDLOBJ)
+ $(CROSS)ar cru $@ $(LIBDLOBJ)
+
+dyn_lib: $(PICODIR) $(PICODIR)/libc.so $(PICODIR)/dstart.o \
+ $(PICODIR)/dyn_so_start.o $(PICODIR)/dyn_start.o $(PICODIR)/dyn_stop.o \
+ $(PICODIR)/libpthread.so $(PICODIR)/libdl.so $(PICODIR)/libcompat.so \
+ $(PICODIR)/diet-dyn $(PICODIR)/diet-dyn-i
+
+$(PICODIR)/%.o: %.S $(ARCH)/syscalls.h
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
+
+$(PICODIR)/pthread_%.o: libpthread/pthread_%.c
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
+ $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
+
+$(PICODIR)/%.o: %.c
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
+ $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
+
+$(PICODIR)/dstart.o: start.S
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
+
+$(PICODIR)/dyn_so_start.o: dyn_start.c
+ $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -D__DYN_LIB_SHARED -c $< -o $@
+ $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
+
+DYN_LIBC_PIC = $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
+$(LIBCRUFTOBJ) $(LIBCRYPTOBJ) $(LIBSHELLOBJ) $(LIBREGEXOBJ)
+
+DYN_LIBC_OBJ = $(PICODIR)/dyn_syscalls.o $(PICODIR)/errlist.o \
+ $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(DYN_LIBC_PIC))
+
+DYN_PTHREAD_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBPTHREAD_OBJS))
+
+DYN_LIBDL_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBDLOBJ))
+
+DYN_LIBCOMPAT_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBCOMPATOBJ))
+
+$(PICODIR)/libc.so: $(PICODIR) $(DYN_LIBC_OBJ)
+ $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_LIBC_OBJ) -lgcc -Wl,-soname=libc.so
+
+$(PICODIR)/libpthread.so: $(DYN_PTHREAD_OBJS) dietfeatures.h
+ $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_PTHREAD_OBJS) -L$(PICODIR) -lc -Wl,-soname=libpthread.so
+
+$(PICODIR)/libdl.so: libdl/_dl_main.c dietfeatures.h
+ $(CROSS)$(CC) -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -nostdlib -shared -o $@ $(CFLAGS) -I. -Iinclude libdl/_dl_main.c -Wl,-soname=libdl.so
+
+#$(PICODIR)/libdl.so: $(DYN_LIBDL_OBJS) dietfeatures.h
+# $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_LIBDL_OBJS) -L$(PICODIR) -ldietc -Wl,-soname=libdl.so
+
+$(PICODIR)/libcompat.so: $(DYN_LIBCOMPAT_OBJS) dietfeatures.h
+ $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_LIBCOMPAT_OBJS) -L$(PICODIR) -lc -Wl,-soname=libcompat.so
+
+
+
$(SYSCALLOBJ): syscalls.h
-$(OBJDIR)/diet: diet.c $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a
- $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(PWD)\"
+VERSION=dietlibc-$(shell head -1 CHANGES|sed 's/://')
+CURNAME=$(notdir $(shell pwd))
+
+$(OBJDIR)/diet: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
+ $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -DVERSION=\"$(VERSION)\" -lgcc
+ $(CROSS)strip -R .comment -R .note $@
+
+$(OBJDIR)/diet-i: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
+ $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(INSTALLHOME)\" -DVERSION=\"$(VERSION)\" -DINSTALLVERSION -lgcc
$(CROSS)strip -R .comment -R .note $@
+$(PICODIR)/diet-dyn: $(PICODIR)/start.o $(PICODIR)/dyn_start.o diet.c
+ $(CROSS)$(CC) -Iinclude $(CFLAGS) -fPIC -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -D__DYN_LIB -DVERSION=\"$(VERSION)\" -L$(PICODIR) -lc -lgcc $(PICODIR)/dyn_stop.o -Wl,-dynamic-linker=$(HOME)/$(PICODIR)/libdl.so
+ $(CROSS)strip -R .command -R .note $@
+
+$(PICODIR)/diet-dyn-i: $(PICODIR)/start.o $(PICODIR)/dyn_start.o diet.c
+ $(CROSS)$(CC) -Iinclude $(CFLAGS) -fPIC -nostdlib -o $@ $^ -DDIETHOME=\"$(prefix)\" -D__DYN_LIB -DVERSION=\"$(VERSION)\" -L$(PICODIR) -lc -lgcc $(PICODIR)/dyn_stop.o -Wl,-dynamic-linker=$(ILIBDIR)/libdl.so -DINSTALLVERSION
+ $(CROSS)strip -R .command -R .note $@
+
$(OBJDIR)/djb: $(OBJDIR)/compile $(OBJDIR)/load
$(OBJDIR)/compile:
- echo 'exec gcc $(CFLAGS) -I$(PWD)/$(OBJDIR)/include -c $${1+"$$@"}' > $@
+ echo 'exec' $(CC) '$(CFLAGS) -I$(PWD)/$(OBJDIR)/include -c $${1+"$$@"}' > $@
chmod 755 $@
$(OBJDIR)/load:
- echo 'main="$$1"; shift; exec gcc -nostdlib -o "$$main" $(PWD)/$(OBJDIR)/start.o "$$main".o $${1+"$$@"} $(PWD)/$(OBJDIR)/dietlibc.a -lgcc' > $@
+ echo 'main="$$1"; shift; exec' $(CC) '-nostdlib -o "$$main" $(PWD)/$(OBJDIR)/start.o "$$main".o $${1+"$$@"} $(PWD)/$(OBJDIR)/dietlibc.a -lgcc' > $@
chmod 755 $@
clean:
rm -f *.o *.a t t1 compile load exports mapfile libdietc.so
- rm -rf bin-*
+ rm -rf bin-* pic-*
+ $(MAKE) -C libdl clean
-tar: clean
- rm -f armv4l
- ln -sf arm armv4l
- cd ..; tar cvvf dietlibc.tar.bz2 dietlibc --use=bzip2 --exclude CVS
+tar: clean rename
+ cd ..; tar cvvf $(VERSION).tar.bz2 $(VERSION) --use=bzip2 --exclude CVS
+
+rename:
+ if test $(CURNAME) != $(VERSION); then cd .. && mv $(CURNAME) $(VERSION); fi
$(OBJDIR)/exports: $(OBJDIR)/dietlibc.a
nm -g $(OBJDIR)/dietlibc.a | grep -w T | awk '{ print $$3 }' | sort -u > $(OBJDIR)/exports
.PHONY: t t1
t:
- $(CROSS)$(CC) -g $(CFLAGS) -fno-builtin -nostdlib -Iinclude -o t t.c $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a -lgcc -Wl,-Map,mapfile
+ $(CROSS)$(CC) -g $(CFLAGS) -fno-builtin -nostdlib -Iinclude -o t t.c $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dietlibc.a -lgcc $(OBJDIR)/dyn_stop.o -Wl,-Map,mapfile
t1:
$(CROSS)$(CC) -g -o t1 t.c
-install: $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a $(OBJDIR)/diet
- cp $(OBJDIR)/start.o $(INSTALLPREFIX)$(prefix)/lib/dietstart.o
- cp $(OBJDIR)/dietlibc.a $(INSTALLPREFIX)$(prefix)/lib/libdietc.a
- cp $(OBJDIR)/liblatin1.a $(INSTALLPREFIX)$(prefix)/lib/libdietlatin1.a
- cp $(OBJDIR)/diet $(INSTALLPREFIX)$(prefix)/bin/diet
-
-.PHONY: sparc ppc mips arm alpha i386
-
-arm sparc ppc alpha i386:
- $(MAKE) ARCH=$@ CROSS=$@-linux- all t bin-$@/libdietc.so
-
-mips:
- $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all t bin-$@/libdietc.so
+install: $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a $(OBJDIR)/librpc.a $(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a $(OBJDIR)/diet-i
+ $(INSTALL) -d $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
+ $(INSTALL) $(OBJDIR)/start.o $(DESTDIR)$(ILIBDIR)/start.o
+ $(INSTALL) -m 644 $(OBJDIR)/libm.a $(OBJDIR)/libpthread.a $(OBJDIR)/librpc.a \
+$(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a $(DESTDIR)$(ILIBDIR)
+ $(INSTALL) -m 644 $(OBJDIR)/dietlibc.a $(DESTDIR)$(ILIBDIR)/libc.a
+ifeq ($(MYARCH),$(ARCH))
+ $(INSTALL) $(OBJDIR)/diet-i $(DESTDIR)$(BINDIR)/diet
+ -$(INSTALL) $(PICODIR)/diet-dyn-i $(DESTDIR)$(BINDIR)/diet-dyn
+endif
+ -$(INSTALL) $(OBJDIR)/pstart.o $(OBJDIR)/libgmon.a $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o $(DESTDIR)$(ILIBDIR)
+ -$(INSTALL) $(PICODIR)/libc.so $(DESTDIR)$(ILIBDIR)/libc.so
+ -$(INSTALL) $(PICODIR)/libpthread.so $(DESTDIR)$(ILIBDIR)/libpthread.so
+ -$(INSTALL) $(PICODIR)/libdl.so $(DESTDIR)$(ILIBDIR)/libdl.so
+ -$(INSTALL) $(PICODIR)/libcompat.so $(DESTDIR)$(ILIBDIR)/libcompat.so
+ -$(INSTALL) $(PICODIR)/dyn_start.o $(DESTDIR)$(ILIBDIR)/dyn_dstart.o
+ -$(INSTALL) $(PICODIR)/dyn_stop.o $(DESTDIR)$(ILIBDIR)/dyn_dstop.o
+ -$(INSTALL) $(PICODIR)/dstart.o $(PICODIR)/dyn_so_start.o $(DESTDIR)$(ILIBDIR)
+ $(INSTALL) -m 644 diet.1 $(DESTDIR)$(MAN1DIR)/diet.1
+ if test -f $(PICODIR)/libc.so -a ! -f $(DESTDIR)/etc/diet.ld.conf; then echo "$(ILIBDIR)" > $(DESTDIR)/etc/diet.ld.conf; fi
+ for i in `find include -name \*.h`; do install -m 644 -D $$i $(DESTDIR)$(INSTALLHOME)/$$i; done
+
+.PHONY: sparc ppc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
+.PHONY: x86_64 ia64
+
+arm sparc ppc alpha i386 mips parisc s390 sparc64 x86_64 ia64:
+ $(MAKE) ARCH=$@ CROSS=$@-linux- all
+
+# Cross compile for little endian MIPS
+mipsel:
+ $(MAKE) ARCH=$@ CROSS=mips-linux- all
+
+mips-gnu:
+ $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all
+
+# Some people named their cross compiler toolchain powerpc-linux-gcc
+powerpc:
+ $(MAKE) ARCH=ppc CROSS=powerpc-linux- all
cross:
- $(MAKE) arm sparc ppc alpha i386 mips
+ $(MAKE) arm sparc ppc alpha i386 mips sparc64
# these depend on dietfeatures.h for large file backward compatibility
-$(OBJDIR)/__fstat64.o $(OBJDIR)/__lstat64.o $(OBJDIR)/__stat64.o: dietfeatures.h
+$(OBJDIR)/__fstat64.o $(OBJDIR)/__lstat64.o $(OBJDIR)/__stat64.o $(OBJDIR)/lseek64.o $(OBJDIR)/readdir64.o $(OBJDIR)/stat64.o $(OBJDIR)/lstat64.o $(OBJDIR)/fstat64.o $(OBJDIR)/truncate64.o $(OBJDIR)/__truncate64.o $(OBJDIR)/ftruncate64.o $(OBJDIR)/__ftruncate64.o $(PICODIR)/dyn_syscalls.o $(PICODIR)/__truncate64.o $(PICODIR)/__ftruncate64.o $(PICODIR)/__stat64.o $(PICODIR)/__lstat64.o $(PICODIR)/__fstat64.o: dietfeatures.h
# these depend on dietfeatures.h for thread support
-$(OBJDIR)/alloc.o $(OBJDIR)/perror.o $(OBJDIR)/logging.o $(OBJDIR)/unified.o: dietfeatures.h
+$(OBJDIR)/alloc.o $(OBJDIR)/perror.o $(OBJDIR)/logging.o $(OBJDIR)/unified.o $(OBJDIR)/clone.o $(OBJDIR)/set_errno.o: dietfeatures.h
# these depend on dietfeatures.h for linker warnings
$(OBJDIR)/assert_fail.o $(OBJDIR)/sprintf.o $(OBJDIR)/vsnprintf.o $(OBJDIR)/___div.o $(OBJDIR)/fflush.o $(OBJDIR)/setvbuf.o $(OBJDIR)/system.o $(OBJDIR)/sendfile.o $(OBJDIR)/setenv.o: dietfeatures.h
@@ -137,10 +358,56 @@ fclose.o $(OBJDIR)/fdglue.o $(OBJDIR)/fflush.o $(OBJDIR)/fgetc.o $(OBJDIR)/fputc
strcasecmp.o $(OBJDIR)/strcat.o $(OBJDIR)/strchr.o $(OBJDIR)/strcmp.o $(OBJDIR)/strcpy.o $(OBJDIR)/strlen.o $(OBJDIR)/strncasecmp.o $(OBJDIR)/strncat.o $(OBJDIR)/strrchr.o: dietfeatures.h
# these depend on dietfeatures.h for /proc
-$(OBJDIR)/tty.o: dietfeatures.h
-
-# these depend on dietfeatures.h for ungetc support ;-)
-$(OBJDIR)/ungetc.o: dietfeatures.h
+$(OBJDIR)/ttyname.o $(OBJDIR)/sysconf_cpus.o: dietfeatures.h
# these depend on dietfeatures.h for WANT_TZFILE_PARSER
-$(OBJDIR)/localtime_r.o: dietfeatures.h
+$(OBJDIR)/localtime_r.o $(OBJDIR)/strftime.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_SMALL_STDIO_BUFS
+$(LIBSTDIOOBJ): dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_FULL_RESOLV_CONF
+$(OBJDIR)/dnscruft.o $(OBJDIR)/dnscruft2.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_THREAD_SAFE and errno
+$(LIBRPCOBJ) $(OBJDIR)/logging.o $(OBJDIR)/alloc.o $(OBJDIR)/cfsetospeed.o $(OBJDIR)/cfsetispeed.o \
+$(OBJDIR)/execl.o $(OBJDIR)/execlp.o $(OBJDIR)/execv.o $(OBJDIR)/execvp.o $(OBJDIR)/isatty.o \
+$(OBJDIR)/lockf.o $(OBJDIR)/perror.o $(OBJDIR)/remove.o $(OBJDIR)/set_errno.o $(OBJDIR)/sigemptyset.o \
+$(OBJDIR)/tcsetattr.o $(OBJDIR)/dnscruft2.o $(OBJDIR)/dnscruft.o $(OBJDIR)/entlib.o \
+$(OBJDIR)/gethostbyaddr.o $(OBJDIR)/gethostbyaddr_r.o $(OBJDIR)/gethostbyname.o \
+$(OBJDIR)/gethostbyname_r.o $(OBJDIR)/gethostbyname2.o $(OBJDIR)/gethostbyname2_r.o \
+$(OBJDIR)/inet_pton.o $(OBJDIR)/mkstemp.o $(OBJDIR)/mktemp.o $(OBJDIR)/tempnam.o \
+$(OBJDIR)/glob.o $(OBJDIR)/realpath.o $(OBJDIR)/fdglue.o $(OBJDIR)/fdglue2.o \
+$(OBJDIR)/getaddrinfo.o $(OBJDIR)/getnameinfo.o $(OBJDIR)/getprotoent.o \
+$(OBJDIR)/getservent.o $(OBJDIR)/iconv.o $(OBJDIR)/iconv_open.o \
+$(OBJDIR)/netent.o $(OBJDIR)/system.o $(OBJDIR)/stdin.o $(OBJDIR)/stdout.o \
+$(OBJDIR)/stderr.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_CRYPT_MD5
+$(OBJDIR)/crypt.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_FREAD_OPTIMIZATION
+$(OBJDIR)/fread.o $(OBJDIR)/fwrite.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_DYNAMIC
+$(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o: dietfeatures.h
+
+$(OBJDIR)/unified.o: dietuglyweaks.h
+
+$(OBJDIR)/adjtimex.o: include/sys/timex.h
+
+$(OBJDIR)/fgetc_unlocked.o $(OBJDIR)/fread.o $(OBJDIR)/ungetc.o: dietstdio.h
+
+# these depend on dietfeatures.h for WANT_LINKER_WARNINGS
+$(OBJDIR)/setlinebuf.o $(OBJDIR)/bzero.o $(OBJDIR)/setegid.o \
+$(OBJDIR)/seteuid.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_FULL_POSIX_COMPAT
+$(OBJDIR)/strncpy.o: dietfeatures.h
+$(OBJDIR)/strxfrm.o: dietfeatures.h
+
+# these depend on dietfeatures.h for WANT_INET_ADDR_DNS
+$(OBJDIR)/gethostbyname_r.o: dietfeatures.h
+
+
+# CFLAGS+=-W -Wshadow -Wid-clash-31 -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wwrite-strings
diff --git a/mdk-stage1/dietlibc/README b/mdk-stage1/dietlibc/README
index ce9838832..2a1fa332c 100644
--- a/mdk-stage1/dietlibc/README
+++ b/mdk-stage1/dietlibc/README
@@ -1,3 +1,8 @@
+ The system library is a challenge to all those using the computer to
+ write their own faster and better routines or to bow to the superior
+ strength and skill of a true master.
+ --http://www.inner.net/users/cmetz/program-like-a-klingon
+
diet libc to statically link programs that don't need all the bloat
from glibc.
@@ -7,10 +12,7 @@ To compile:
$ make
-make should compile the diet libc itself without warnings. In addition
-to the diet libc, the default make target includes t, which is a test
-program and probably contains code which produces warnings. You can
-safely ignore them.
+make should compile the diet libc itself.
When make is done, it will have created dietlibc.a in bin-i386 (or
bin-ppc, bin-alpha, bin-sparc, bin-ppc or bin-arm, depending on your
@@ -41,3 +43,7 @@ The embedded utils are small replacements for common utilities like mv,
chown, ls, and even a small tar that can extract tar files. The binary
repository contains a few utilities I linked against the diet libc, for
example gzip, bzip2 and fdisk.
+
+
+The license for the diet libc is the GNU General Public License, version
+2 (as included in the file COPYING).
diff --git a/mdk-stage1/dietlibc/alpha/Makefile.add b/mdk-stage1/dietlibc/alpha/Makefile.add
index 10ff0faef..68b10b43c 100644
--- a/mdk-stage1/dietlibc/alpha/Makefile.add
+++ b/mdk-stage1/dietlibc/alpha/Makefile.add
@@ -2,4 +2,4 @@
CFLAGS+=-Os -Iinclude -fomit-frame-pointer -fstrict-aliasing
VPATH:=alpha:syscalls.s:$(VPATH)
-LIBOBJ+=$(patsubst %,$(OBJDIR)/%,divq.o divl.o remq.o reml.o seteuid.o __time.o)
+LIBOBJ+=$(patsubst %,$(OBJDIR)/%,divq.o divl.o remq.o reml.o __time.o __alarm.o)
diff --git a/mdk-stage1/dietlibc/alpha/__longjmp.S b/mdk-stage1/dietlibc/alpha/__longjmp.S
index d86d76717..31e374d0f 100644
--- a/mdk-stage1/dietlibc/alpha/__longjmp.S
+++ b/mdk-stage1/dietlibc/alpha/__longjmp.S
@@ -1,11 +1,10 @@
-#ifdef __alpha__
-
#include <setjmp.h>
.text
.align 2
.global __longjmp
+.type __longjmp,@function
__longjmp:
mov $17, $0 /* a1 -> v0 */
@@ -18,7 +17,7 @@ __longjmp:
ldq $26, (JB_PC*8) ($16) /* ra */
ldq $fp, (JB_FP*8) ($16) /* fp */
- ldq $1, (JB_SP*8) ($16) /* sp */
+ ldq $sp, (JB_SP*8) ($16) /* sp */
ldt $f2, (JB_F2*8) ($16) /* f2 */
ldt $f3, (JB_F3*8) ($16) /* f3 */
@@ -30,9 +29,5 @@ __longjmp:
ldt $f9, (JB_F9*8) ($16) /* f9 */
cmoveq $0, 0x1, $0
- mov $1, $sp
ret $31, ($26), 1
-
-
-#endif
diff --git a/mdk-stage1/dietlibc/alpha/clone.S b/mdk-stage1/dietlibc/alpha/clone.S
index b7e32d707..28e61a8bc 100644
--- a/mdk-stage1/dietlibc/alpha/clone.S
+++ b/mdk-stage1/dietlibc/alpha/clone.S
@@ -1,5 +1,5 @@
#include "syscalls.h"
-#include <asm/errno.h>
+#include <errno.h>
.text
.align 2
diff --git a/mdk-stage1/dietlibc/alpha/setjmp.S b/mdk-stage1/dietlibc/alpha/setjmp.S
index 3768056be..04bfd3d94 100644
--- a/mdk-stage1/dietlibc/alpha/setjmp.S
+++ b/mdk-stage1/dietlibc/alpha/setjmp.S
@@ -1,15 +1,16 @@
#include <setjmp.h>
.text
+.weak setjmp
+.type setjmp,@function
+setjmp:
+.weak __setjmp
+.type __setjmp,@function
+__setjmp:
+ mov 0, $17
.global __sigsetjmp
+.type __sigsetjmp,@function
__sigsetjmp:
- ldgp $gp, 0($gp)
-
- mov $sp, $1
- lda $sp, -16($sp)
-
- stq $26, 0($sp) /* save ra */
-
stq $9, (JB_S0*8) ($16) /* s0 */
stq $10, (JB_S1*8) ($16) /* s1 */
stq $11, (JB_S2*8) ($16) /* s2 */
@@ -19,7 +20,7 @@ __sigsetjmp:
stq $26, (JB_PC*8) ($16) /* ra */
stq $fp, (JB_FP*8) ($16) /* fp */
- stq $1, (JB_SP*8) ($16) /* sp */
+ stq $sp, (JB_SP*8) ($16) /* sp */
stt $f2, (JB_F2*8) ($16) /* f2 */
stt $f3, (JB_F3*8) ($16) /* f3 */
@@ -30,17 +31,5 @@ __sigsetjmp:
stt $f8, (JB_F8*8) ($16) /* f8 */
stt $f9, (JB_F9*8) ($16) /* f9 */
- br $26, __sigjmp_save /* call __sigjmp_save */
+ br $31, __sigjmp_save /* jmp __sigjmp_save */
- ldq $26, 0($sp) /* restore ra */
-
- lda $sp, 16($sp)
- ret $31, ($26), 1 /* back to caller */
-
-.weak setjmp
-setjmp:
-.weak __setjmp
-__setjmp:
- ldgp $gp, 0($gp)
- mov 0, $17
- br __sigsetjmp
diff --git a/mdk-stage1/dietlibc/alpha/start.S b/mdk-stage1/dietlibc/alpha/start.S
index 00b8e950d..850ce2420 100644
--- a/mdk-stage1/dietlibc/alpha/start.S
+++ b/mdk-stage1/dietlibc/alpha/start.S
@@ -1,7 +1,3 @@
-#include "start.h"
-
-#ifdef __alpha__
-
.text
.align 2
.set noreorder
@@ -17,19 +13,21 @@ _start:
ldgp $gp, 0($gp)
/* prepare to call main */
- ldl $16, 0($sp) /* argc */
+ ldl $16, 0($sp) /* argc / a0 */
- lda $17, 8($sp) /* argv */
+ lda $17, 8($sp) /* argv / a1 */
- addq $16, 1, $18 /* argp */
+ addq $16, 1, $18 /* argp / a2 */
s8addq $18, $17, $18 /* (8*(argc+1))+argv -> argp */
stq $18, environ
- mov $0, $21 /* mov v0(dynload) to a5 */
-
+#ifdef WANT_DYNAMIC
+/* in v0 ($0) is the ld.so _fini pointer */
+ mov $0, $19 /* mov v0(dynload) to a3 */
+ jsr $26, dyn_start
+#else
jsr $26, main
+#endif
mov $0, $16
jsr $26, exit /* YES, CALL! for threads and atexit ! (+4 byte) */
-
-#endif
diff --git a/mdk-stage1/dietlibc/alpha/unified.S b/mdk-stage1/dietlibc/alpha/unified.S
index 02a1c9bcd..506bf7387 100644
--- a/mdk-stage1/dietlibc/alpha/unified.S
+++ b/mdk-stage1/dietlibc/alpha/unified.S
@@ -1,15 +1,25 @@
#include <dietfeatures.h>
+#include "syscalls.h"
+.weak exit
+exit:
+.global _exit
+_exit:
+ lda $0, __NR_exit
.global __unified_syscall
__unified_syscall:
callsys
bne $19, .Lerror
+
+/* here we go and "reuse" the return for weak-void functions */
+#include "dietuglyweaks.h"
+
ret $31, ($26), 0x01
.Lerror:
.global error_unified_syscall
error_unified_syscall:
-#ifdef WANT_THREAD_SAVE
+#ifdef WANT_THREAD_SAFE
lda $sp, -16($sp) /* alloc 2 qwords on stack */
stq $26, 0($sp) /* save ra to stack */
stq $0, 8($sp) /* save v0 to stack */
diff --git a/mdk-stage1/dietlibc/diet.c b/mdk-stage1/dietlibc/diet.c
index 1de6befc8..c3a053ac8 100644
--- a/mdk-stage1/dietlibc/diet.c
+++ b/mdk-stage1/dietlibc/diet.c
@@ -1,7 +1,11 @@
#include <string.h>
#include <unistd.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <write12.h>
+
+#include "dietfeatures.h"
/* goal:
* when invoked as
@@ -15,90 +19,341 @@
* "sparc-linux-gcc -nostdlib -static -o t t.o /path/to/dietlibc/bin-sparc/start.o /path/to/dietlibc/bin-sparc/dietlibc.a"
*/
-void error(const char *message) {
- write(2,message,strlen(message));
+static void error(const char *message) {
+ __write2(message);
exit(1);
}
+static const char* Os[] = {
+ "i386","-Os","-mpreferred-stack-boundary=2",
+ "-malign-functions=0","-malign-jumps=0",
+ "-malign-loops=0","-fomit-frame-pointer",0,
+ "x86_64","-Os","-fno-omit-frame-pointer",0,
+ "sparc","-Os","-mcpu=supersparc",0,
+ "sparc64","-Os","-m64",0,
+ "alpha","-Os","-fomit-frame-pointer",0,
+ "arm","-Os","-fomit-frame-pointer",0,
+ "mips","-Os","-fomit-frame-pointer","-mno-abicalls","-G","8","-fno-pic",0,
+ "ppc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
+ "s390","-Os","-fomit-frame-pointer",0,
+ "sh","-Os","-fomit-frame-pointer",0,
+ "ia64","-Os","-fno-omit-frame-pointer",0,
+ "x86_64","-Os","-fstrict-aliasing","-momit-leaf-frame-pointer","-mfance-math-387",0,
+ 0};
+
int main(int argc,char *argv[]) {
- int link=0;
+ int _link=0;
int compile=0;
+ int preprocess=0;
+ int verbose=0;
+ int profile=0;
char diethome[]=DIETHOME;
- char platform[1000]=DIETHOME "/bin-";
- char *nostdlib="-nostdlib";
- char *libgcc="-lgcc";
- char dashL[1000]="-L";
+ char platform[1000];
+#ifdef __DYN_LIB
+ int shared=0;
+#endif
+ char* shortplatform=0;
+#ifdef WANT_SAFEGUARD
+ char safeguard1[]="-include";
+ char safeguard2[]=DIETHOME "/include/dietref.h";
+#endif
+ const char *nostdlib="-nostdlib";
+ const char *libgcc="-lgcc";
+ char dashL[1000];
+ char dashstatic[]="-static";
int i;
+ int mangleopts=0;
+ char manglebuf[1024];
+
+#ifdef INSTALLVERSION
+ strcpy(platform,DIETHOME "/lib-");
+#else
+#ifndef __DYN_LIB
+ strcpy(platform,DIETHOME "/bin-");
+#else
+ strcpy(platform,DIETHOME "/pic-");
+#endif
+#endif
+ strcpy(dashL,"-L");
if (argc<2) {
- error("usage: diet [gcc command line]\n"
- "e.g. diet gcc -c t.c\n"
+usage:
+ if (verbose) {
+ __write2(
+#ifdef __DYN_LIB
+ "dyn-"
+#endif
+ "diet version " VERSION
+#ifndef INSTALLVERSION
+ " (non-install version in source tree)"
+#endif
+ "\n\n");
+ }
+ error("usage: diet [-v] [-Os] gcc command line\n"
+ "e.g. diet -Os gcc -c t.c\n"
"or diet sparc-linux-gcc -o foo foo.c bar.o\n");
}
+ if (!strcmp(argv[1],"-v")) {
+ ++argv; --argc;
+ verbose=1;
+ }
+ if (argv[1] && !strcmp(argv[1],"-Os")) {
+ ++argv; --argc;
+ mangleopts=1;
+ }
+ if (!argv[1]) goto usage;
{
char *tmp=strchr(argv[1],0)-2;
- char *tmp2;
+ char *tmp2,*tmp3;
char *cc=argv[1];
if (tmp<cc) goto donttouch;
- if ((tmp2=strchr(cc,'-'))) { /* cross compiling? */
+ if ((tmp2=strstr(cc,"linux-"))) { /* cross compiling? */
int len=strlen(platform);
+ --tmp2;
+ tmp3=strchr(cc,'-');
+ if (tmp3<tmp2) tmp2=tmp3;
if (tmp2-cc>90) error("platform name too long!\n");
- memmove(platform+len,argv[1],tmp2-cc);
+ shortplatform=platform+len;
+ memmove(shortplatform,argv[1],(size_t)(tmp2-cc));
platform[tmp2-cc+len]=0;
-/* printf("found platform %s\n",platform); */
+ if (shortplatform[0]=='i' && shortplatform[2]=='8' && shortplatform[3]=='6') shortplatform[1]='3';
} else {
#ifdef __sparc__
- strcat(platform,"sparc");
+#ifdef __arch64__
+ shortplatform="sparc64";
+#else
+ shortplatform="sparc";
#endif
-#ifdef __ppc__
- strcat(platform,"ppc");
+#endif
+#ifdef __powerpc__
+ shortplatform="ppc";
#endif
#ifdef __i386__
- strcat(platform,"i386");
+ shortplatform="i386";
#endif
#ifdef __alpha__
- strcat(platform,"alpha");
+ shortplatform="alpha";
#endif
#ifdef __arm__
- strcat(platform,"arm");
+ shortplatform="arm";
#endif
#ifdef __mips__
- strcat(platform,"mips");
+ shortplatform="mips";
+#endif
+#ifdef __s390__
+ shortplatform="s390";
+#endif
+#ifdef __sh__
+ shortplatform="sh";
+#endif
+#ifdef __hppa__
+ shortplatform="parisc";
+#endif
+#ifdef __x86_64__
+ shortplatform="x86_64";
+#endif
+#ifdef __ia64__
+ shortplatform="ia64";
#endif
+ {
+ char *tmp=platform+strlen(platform);
+ strcpy(tmp,shortplatform);
+ shortplatform=tmp;
+ }
+ }
+ /* MIPS needs special handling. If argv contains -EL, change
+ * platform name to mipsel */
+ if (!strcmp(shortplatform,"mips")) {
+ int i;
+ for (i=1; i<argc; ++i)
+ if (!strcmp(argv[i],"-EL"))
+ strcpy(shortplatform,"mipsel");
}
strcat(dashL,platform);
if (!strcmp(tmp,"cc")) {
char **newargv;
char **dest;
char *a,*b,*c;
+#ifdef WANT_DYNAMIC
+ char *d,*e,*f;
+#endif
/* we need to add -I... if the command line contains -c, -S or -E */
- for (i=2; i<argc; ++i)
- if (!strcmp(argv[i],"-c") || !strcmp(argv[i],"-S") || !strcmp(argv[i],"-E"))
+ for (i=2; i<argc; ++i) {
+ if (argv[i][0]=='-' && argv[i][1]=='M')
+ goto pp;
+ if (!strcmp(argv[i],"-pg"))
+ profile=1;
+ if (!strcmp(argv[i],"-c") || !strcmp(argv[i],"-S"))
compile=1;
+ if (!strcmp(argv[i],"-E"))
+pp:
+ preprocess=compile=1;
+ }
/* we need to add -nostdlib if we are not compiling*/
- link=!compile;
+ _link=!compile;
+#ifdef __DYN_LIB
+ if (_link) {
+ for (i=2; i<argc; ++i)
+ if (!strcmp(argv[i],"-shared")) {
+ shared=1;
+ _link=0;
+ }
+ }
+#endif
#if 0
for (i=2; i<argc; ++i)
if (!strcmp(argv[i],"-o"))
- if (!compile) link=1;
+ if (!compile) _link=1;
#endif
- newargv=alloca(sizeof(char*)*(argc+6));
+ newargv=alloca(sizeof(char*)*(argc+100));
a=alloca(strlen(diethome)+20);
b=alloca(strlen(platform)+20);
c=alloca(strlen(platform)+20);
strcpy(a,"-I"); strcat(a,diethome); strcat(a,"/include");
- strcpy(b,platform); strcat(b,"/start.o");
+#ifndef __DYN_LIB
+ strcpy(b,platform);
+ if (profile) strcat(b,"/pstart.o"); else strcat(b,"/start.o");
+#ifdef INSTALLVERSION
+ strcpy(c,platform); strcat(c,"/libc.a");
+#else
strcpy(c,platform); strcat(c,"/dietlibc.a");
+#endif
+#else
+ strcpy(b,platform); strcat(b,"/dstart.o");
+ strcpy(c,"-lc");
+#endif
+
+#ifdef WANT_DYNAMIC
+ d=alloca(strlen(platform)+20);
+ e=alloca(strlen(platform)+20);
+#ifdef __DYN_LIB
+ strcpy(d,platform);
+ strcpy(e,platform);
+ if (shared)
+ strcat(d,"/dyn_so_start.o");
+#ifdef INSTALLVERSION
+ else
+ strcat(d,"/dyn_dstart.o");
+ strcat(e,"/dyn_dstop.o");
+#else
+ else
+ strcat(d,"/dyn_start.o");
+ strcat(e,"/dyn_stop.o");
+#endif
+#else
+ strcpy(d,platform); strcat(d,"/dyn_start.o");
+ strcpy(e,platform); strcat(e,"/dyn_stop.o");
+#endif
+#endif
dest=newargv;
*dest++=argv[1];
- if (link) { *dest++=nostdlib; *dest++=dashL; }
- if (compile || link) *dest++=a;
- for (i=2; i<argc; ++i)
+#ifndef __DYN_LIB
+ if (_link) { *dest++=(char*)nostdlib; *dest++=dashstatic; *dest++=dashL; }
+#else
+ /* avoid R_*_COPY relocations */
+ *dest++="-fPIC";
+ if (_link || shared) { *dest++=(char*)nostdlib; *dest++=dashL; }
+#endif
+#ifdef WANT_SAFEGUARD
+ if (compile && !preprocess) {
+ *dest++=safeguard1;
+ *dest++=safeguard2;
+ }
+#endif
+ if (_link) { *dest++=b; }
+#ifdef WANT_DYNAMIC
+ if (_link) { *dest++=d; }
+#endif
+ for (i=2; i<argc; ++i) {
+ if (mangleopts)
+ if (argv[i][0]=='-' && (argv[i][1]=='O' || argv[i][1]=='f' || argv[i][1]=='m')) {
+ if (strcmp(argv[i],"-fpic") && strcmp(argv[i],"-fno-pic"))
+ continue;
+ }
*dest++=argv[i];
- if (link) { *dest++=b; *dest++=c; *dest++=libgcc; }
+ }
+#ifndef __DYN_LIB
+ if (compile || _link) *dest++=a;
+#else
+ if (compile || _link || shared) *dest++=a;
+#endif
+ *dest++="-D__dietlibc__";
+ if (mangleopts) {
+ const char **o=Os;
+
+ {
+ int fd;
+ char* tmp=getenv("HOME");
+ if (tmp) {
+ if (strlen(tmp)+strlen(cc)<900) {
+ strcpy(manglebuf,tmp);
+ strcat(manglebuf,"/.diet/");
+ strcat(manglebuf,cc);
+ if ((fd=open(manglebuf,O_RDONLY))>=0) {
+ int len=read(fd,manglebuf,1023);
+ if (len>0) {
+ int i;
+ manglebuf[len]=0;
+ *dest++=manglebuf;
+ for (i=1; i<len; ++i) {
+ if (manglebuf[i]==' ' || manglebuf[i]=='\n') {
+ manglebuf[i]=0;
+ if (i+1<len)
+ *dest++=manglebuf+i+1;
+ }
+ }
+ goto incorporated;
+ }
+ }
+ }
+ }
+ }
+ for (o=Os;*o;++o) {
+ if (!strcmp(*o,shortplatform)) {
+ ++o;
+ while (*o) {
+ *dest++=(char*)*o;
+ ++o;
+ }
+ break;
+ } else
+ while (*o) ++o;
+ }
+ }
+incorporated:
+ if (_link) {
+ if (profile) *dest++="-lgmon";
+ if (!strcmp(shortplatform,"sparc") || !strcmp(shortplatform,"sparc64")) {
+ *dest++=(char*)libgcc; *dest++=c;
+ } else {
+ *dest++=c; *dest++=(char*)libgcc;
+ }
+ }
+#ifdef WANT_DYNAMIC
+ if (_link) { *dest++=e; }
+#endif
+#ifdef __DYN_LIB
+ if (shared){ *dest++=c; }
+ f=alloca(strlen(platform)+100);
+ if (_link) {
+ strcpy(f,"-Wl,-dynamic-linker=");
+ strcat(f,platform);
+// strcat(f,"/diet-linux.so");
+ strcat(f,"/libdl.so");
+ *dest++=f;
+ }
+#endif
*dest=0;
+ if (verbose) {
+ int i;
+ for (i=0; newargv[i]; i++) {
+ __write2(newargv[i]);
+ __write2(" ");
+ }
+ __write2("\n");
+ }
execvp(newargv[0],newargv);
goto error;
} else if (!strcmp(tmp,"ld")) {
@@ -107,6 +362,6 @@ int main(int argc,char *argv[]) {
donttouch:
execvp(argv[1],argv+1);
error:
- error("execvp failed!\n");
+ error("execvp() failed!\n");
return 1;
}
diff --git a/mdk-stage1/dietlibc/dietdirent.h b/mdk-stage1/dietlibc/dietdirent.h
index d732cf7dc..dbd7206a6 100644
--- a/mdk-stage1/dietlibc/dietdirent.h
+++ b/mdk-stage1/dietlibc/dietdirent.h
@@ -1,6 +1,8 @@
+#include <sys/shm.h>
+
struct __dirstream {
int fd;
- char buf[1024];
+ char buf[PAGE_SIZE-(sizeof (int)*3)];
unsigned int num;
unsigned int cur;
}; /* stream data from opendir() */
diff --git a/mdk-stage1/dietlibc/dietfeatures.h b/mdk-stage1/dietlibc/dietfeatures.h
index e1de38577..a7b84d5b9 100644
--- a/mdk-stage1/dietlibc/dietfeatures.h
+++ b/mdk-stage1/dietlibc/dietfeatures.h
@@ -3,40 +3,106 @@
/* feel free to comment some of these out to reduce code size */
-//#define WANT_FLOATING_POINT_IN_PRINTF
-//#define WANT_FLOATING_POINT_IN_SCANF
+/* #define WANT_FLOATING_POINT_IN_PRINTF */
+/* #define WANT_FLOATING_POINT_IN_SCANF */
#define WANT_CHARACTER_CLASSES_IN_SCANF
#define WANT_NULL_PRINTF
+/* #define WANT_LONGLONG_PRINTF */
+/* #define WANT_LONGLONG_SCANF */
-#define SLASH_PROC_OK
+/* 128 or 2048 bytes buffer size? */
+/* #define WANT_SMALL_STDIO_BUFS */
+
+/* want fread to read() directly if size of data is larger than buffer?
+ * This costs a few bytes but is worth it if the application is already
+ * buffering. */
+#define WANT_FREAD_OPTIMIZATION
-// #define WANT_BUFFERED_STDIO
+/* this is only for meaningful for ttyname and sysconf_cpus so far */
+#define SLASH_PROC_OK
/* use errno_location instead of errno */
-// #define WANT_THREAD_SAFE
+/* #define WANT_THREAD_SAFE */
-/* make the startcode, etc. dynamic aware */
-/* #undef WANT_DYNAMIC */
+/* make the startcode, etc. dynamic aware ({con,de}structors) */
+/* #define WANT_DYNAMIC */
/* do you want smaller or faster string routines? */
/* #define WANT_FASTER_STRING_ROUTINES */
-/* do you want ungetc? makes fgetc more complex */
-#define WANT_UNGETC
+/* define this to have strncpy zero-fill and not just zero-terminate the
+ * string */
+/* #define WANT_FULL_POSIX_COMPAT */
-// #define WANT_LINKER_WARNINGS
+/* read the comment in lib/strncat.c for an explanation */
+/* #define WANT_NON_COMPLIANT_STRNCAT */
+
+/* #define WANT_LINKER_WARNINGS */
/* you need to define this if you want to run your programs with large
- * file support on kernel 2.2 or 2.4 */
-// #define WANT_LARGEFILE_BACKCOMPAT
+ * file support on kernel 2.2 or 2.0 */
+/* #define WANT_LARGEFILE_BACKCOMPAT */
/* do you want localtime(3) to read /etc/localtime?
* Needed for daylight saving time etc. */
-// #define WANT_TZFILE_PARSER
+/* #define WANT_TZFILE_PARSER */
+
+/* do you want the DNS routines to parse and use "domain" and "search"
+ * lines from /etc/resolv.conf? Normally not used on boot floppies and
+ * embedded environments. */
+#define WANT_FULL_RESOLV_CONF
+
+/* do you want IPv6 transport support in the DNS resolver? */
+/* #define WANT_IPV6_DNS */
+
+/* do you want gethostbyname and friends to consult /etc/hosts? */
+#define WANT_ETC_HOSTS
+
+/* do you want gethostbyname to understand dotted decimal IP numbers
+ * directly and not try to resolve them? */
+#define WANT_INET_ADDR_DNS
+
+/* do you want math functions high precision rather than fast/small? */
+/* #define WANT_HIGH_PRECISION_MATH */
+
+/* do you want support for matherr? */
+/* #define WANT_MATHERR */
+
+/* do you want crypt(3) to use MD5 if the salt starts with "$1$"? */
+/* #define WANT_CRYPT_MD5 */
+
+/* do you want diet to include a safeguard dependency to make linking
+ * against glibc fail? This may fail with older binutils. */
+#define WANT_SAFEGUARD
+
+/* dy you want that malloc(0) return a pointer to a "zero-length" object
+ * that is realloc-able; means realloc(..,size) gives a NEW object (like a
+ * call to malloc(size)).
+ * WARNING: this violates C99 */
+/* #define WANT_MALLOC_ZERO */
+
/* stop uncommenting here ;-) */
#ifndef WANT_FASTER_STRING_ROUTINES
#define WANT_SMALL_STRING_ROUTINES
#endif
+#ifdef WANT_THREAD_SAFE
+#ifndef __ASSEMBLER__
+#define errno (*__errno_location())
+#define _REENTRANT
+#endif
+#endif
+
+#ifdef __DYN_LIB
+/* with shared libraries you MUST have a dynamic aware startcode */
+#ifndef WANT_DYNAMIC
+#define WANT_DYNAMIC
+#endif
+/* saveguard crashes with shared objects ... */
+#ifdef WANT_SAFEGUARD
+#undef WANT_SAFEGUARD
+#endif
+#endif
+
#endif
diff --git a/mdk-stage1/dietlibc/dietstdio.h b/mdk-stage1/dietlibc/dietstdio.h
index a1cbeba83..2e0e93601 100644
--- a/mdk-stage1/dietlibc/dietstdio.h
+++ b/mdk-stage1/dietlibc/dietstdio.h
@@ -1,81 +1,77 @@
-/* diet stdio -- no buffering ;-} */
+/* diet stdio */
-#include "dietfeatures.h"
+#include <sys/cdefs.h>
#include <sys/types.h>
-#ifdef WANT_THREAD_SAVE
+#include "dietfeatures.h"
+#ifdef WANT_THREAD_SAFE
#include <pthread.h>
#endif
+#include <stdarg.h>
+#ifdef WANT_SMALL_STDIO_BUFS
#define BUFSIZE 128
+#else
+#define BUFSIZE 2048
+#endif
-typedef struct __file {
+struct __stdio_file {
int fd;
int flags;
-#ifdef WANT_BUFFERED_STDIO
unsigned int bs; /* read: bytes in buffer */
unsigned int bm; /* position in buffer */
- char buf[BUFSIZE];
- struct __file *next; /* for fflush */
-#endif
+ unsigned int buflen; /* length of buf */
+ char *buf;
+ struct __stdio_file *next; /* for fflush */
pid_t popen_kludge;
-#ifdef WANT_UNGETC
- char ungetbuf;
+ unsigned char ungetbuf;
char ungotten;
-#endif
-#ifdef WANT_THREAD_SAVE
+#ifdef WANT_THREAD_SAFE
pthread_mutex_t m;
#endif
-} FILE;
-
-extern FILE *__stdio_root;
+};
#define ERRORINDICATOR 1
#define EOFINDICATOR 2
#define BUFINPUT 4
#define BUFLINEWISE 8
#define NOBUF 16
-#define UNSEEKABLE 32
+#define STATICBUF 32
+#define FDPIPE 64
#define _IONBF 0
#define _IOLBF 1
#define _IOFBF 2
+#include <stdio.h>
+
/* internal function to flush buffer.
* However, if next is BUFINPUT and the buffer is an input buffer, it
* will not be flushed. Vice versa for output */
extern int __fflush4(FILE *stream,int next);
+extern int __buffered_outs(const char *s,size_t len);
-FILE *fopen (const char *path, const char *mode);
-FILE *fdopen (int fildes, const char *mode);
-FILE *freopen (const char *path, const char *mode, FILE *stream);
-
-int fgetc(FILE *stream);
-char *fgets(char *s, int size, FILE *stream);
-int getc(FILE *stream);
-int getchar(void);
-char *gets(char *s);
-int ungetc(int c, FILE *stream);
+/* ..scanf */
+struct arg_scanf {
+ void *data;
+ int (*getch)(void*);
+ int (*putch)(int,void*);
+};
-int fputc(int c, FILE *stream);
-int fputs(const char *s, FILE *stream);
-int putc(int c, FILE *stream);
-int putchar(int c);
-int puts(const char *s);
+int __v_scanf(struct arg_scanf* fn, const unsigned char *format, va_list arg_ptr);
-long fseek( FILE *stream, long offset, int whence);
-long ftell( FILE *stream);
-void rewind( FILE *stream);
-int fgetpos( FILE *stream, fpos_t *pos);
-int fsetpos( FILE *stream, fpos_t *pos);
+struct arg_printf {
+ void *data;
+ int (*put)(void*,size_t,void*);
+};
-size_t fread( void *ptr, size_t size, size_t nmemb, FILE *stream);
+int __v_printf(struct arg_printf* fn, const unsigned char *format, va_list arg_ptr);
-size_t fwrite( const void *ptr, size_t size, size_t nmemb, FILE *stream);
-
-int fflush(FILE *stream);
-
-int fclose(FILE *stream);
+extern FILE *__stdio_root;
-extern FILE *stdout, *stderr, *stdin;
+int __fflush_stdin(void);
+int __fflush_stdout(void);
+int __fflush_stderr(void);
-#define EOF (int)(-1)
+FILE* __stdio_init_file(int fd,int closeonerror);
+int __stdio_parse_mode(const char *mode);
+void __stdio_flushall(void);
diff --git a/mdk-stage1/dietlibc/i386/Makefile.add b/mdk-stage1/dietlibc/i386/Makefile.add
index b685cc360..83b18ae29 100644
--- a/mdk-stage1/dietlibc/i386/Makefile.add
+++ b/mdk-stage1/dietlibc/i386/Makefile.add
@@ -1,3 +1,8 @@
-CFLAGS+=-march=i386 -mcpu=i386 -Os -fomit-frame-pointer
+M:=$(shell ./findcflags.sh $(CC))
+LIBOBJ+=$(OBJDIR)/__ten.o $(OBJDIR)/md5asm.o $(OBJDIR)/mmap64.o
+LIBMATH+=acos.o asin.o atan.o atan2.o ceil.o cos.o exp.o exp10.o exp2.o expm1.o fabs.o floor.o hypot.o log.o log10.o log2.o sin.o sqrt.o tan.o copysign.o sincos.o __half.o ldexp.o pow.o ilogb.o cbrt.o log1p.o sqrtl.o fmod.o libm2.o
+#CFLAGS+=-march=i386 -Os -fomit-frame-pointer -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mpreferred-stack-boundary=2
+CFLAGS+=$(M)
VPATH:=i386:syscalls.s:$(VPATH)
+LIBGMON_OBJS+=$(OBJDIR)/mcount.o
diff --git a/mdk-stage1/dietlibc/i386/__longjmp.S b/mdk-stage1/dietlibc/i386/__longjmp.S
index 098275037..a09191f0b 100644
--- a/mdk-stage1/dietlibc/i386/__longjmp.S
+++ b/mdk-stage1/dietlibc/i386/__longjmp.S
@@ -2,6 +2,7 @@
.text
.global __longjmp
+.type __longjmp,@function
__longjmp:
movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
movl 8(%esp), %eax /* Second argument is return value. */
diff --git a/mdk-stage1/dietlibc/i386/__testandset.S b/mdk-stage1/dietlibc/i386/__testandset.S
index af7b4d5a0..29b02d57a 100644
--- a/mdk-stage1/dietlibc/i386/__testandset.S
+++ b/mdk-stage1/dietlibc/i386/__testandset.S
@@ -1,5 +1,6 @@
.text
.global __testandset
+.type __testandset,@function
__testandset:
xorl %eax, %eax
movl 0x4(%esp),%edx
diff --git a/mdk-stage1/dietlibc/i386/clone.S b/mdk-stage1/dietlibc/i386/clone.S
index ac02eb468..ea43bc2e2 100644
--- a/mdk-stage1/dietlibc/i386/clone.S
+++ b/mdk-stage1/dietlibc/i386/clone.S
@@ -1,17 +1,21 @@
-#include <asm/unistd.h>
+#include "syscalls.h"
+#include <errno.h>
+#include "PIC.h"
.text
+.type clone,@function
.weak clone
clone:
+.type __clone,@function
.global __clone
__clone:
+ mov $-EINVAL, %eax
+
movl 4(%esp), %ecx /* have non null thread_funcion */
- testl %ecx, %ecx
- je .Lclone_error
+ jecxz .Lclone_error
movl 8(%esp), %ecx /* have non null child_stack pointer */
- testl %ecx, %ecx
- je .Lclone_error
+ jecxz .Lclone_error
/* put the parameter on thread stack */
subl $8, %ecx
@@ -31,9 +35,7 @@ __clone:
testl %eax, %eax
jl .Lclone_error
- je .Lstart_thread
- ret
-
+ jne .Lreturn
.Lstart_thread:
xorl %ebp,%ebp
call *%ebx
@@ -43,9 +45,16 @@ __clone:
.Lclone_error:
negl %eax
pushl %eax
+#ifdef PIC
+ pushl %ebx
+ PIC_INIT
+ call __errno_location@PLT
+ popl %ebx
+#else
call __errno_location
+#endif
popl %ecx
movl %ecx, (%eax)
- xorl %eax, %eax
- decl %eax
+ orl $-1, %eax
+.Lreturn:
ret
diff --git a/mdk-stage1/dietlibc/i386/setjmp.S b/mdk-stage1/dietlibc/i386/setjmp.S
index 9bfecf565..09b266c61 100644
--- a/mdk-stage1/dietlibc/i386/setjmp.S
+++ b/mdk-stage1/dietlibc/i386/setjmp.S
@@ -1,61 +1,40 @@
#include <setjmp.h>
-/* setjmp for i386.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-.section .rodata
.text
.weak setjmp
+.type setjmp,@function
setjmp:
.globl __setjmp
+.type __setjmp,@function
__setjmp:
- popl %eax /* Pop return address. */
- popl %ecx /* Pop jmp_buf. */
- pushl $0 /* Push zero argument. */
- pushl %ecx /* Push jmp_buf. */
- pushl %eax /* Push back return address. */
+ popl %eax
+ popl %ecx
+ pushl $0
+ pushl %ecx
+ pushl %eax
.globl __sigsetjmp
+.type __sigsetjmp,@function
__sigsetjmp:
- movl 4(%esp), %eax /* User's jmp_buf in %eax. */
+ movl 4(%esp), %eax
+
/* Save registers. */
movl %ebx, (JB_BX*4)(%eax)
movl %esi, (JB_SI*4)(%eax)
movl %edi, (JB_DI*4)(%eax)
movl %ebp, (JB_BP*4)(%eax)
- leal 4(%esp), %ecx /* Save SP as it will be after we return. */
- movl %ecx, (JB_SP*4)(%eax)
+ leal 4(%esp), %edx /* Save SP as it will be after we return. */
movl 0(%esp), %ecx /* Save PC we are returning to now. */
+ movl %edx, (JB_SP*4)(%eax)
movl %ecx, (JB_PC*4)(%eax)
/* Make a tail call to __sigjmp_save; it takes the same args. */
#ifdef PIC
- /* We cannot use the PLT, because it requires that %ebx be set, but
- we can't save and restore our caller's value. Instead, we do an
- indirect jump through the GOT, using for the temporary register
- %ecx, which is call-clobbered. */
- call L(here)
-L(here):
- popl %ecx
- addl $_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ecx
- movl C_SYMBOL_NAME(__sigjmp_save@GOT)(%ecx), %ecx
- jmp *%ecx
+ call 1f
+ addl $_GLOBAL_OFFSET_TABLE_, %ecx
+ jmp *__sigjmp_save@GOT(%ecx)
+1: movl (%esp), %ecx
+ ret
#else
jmp __sigjmp_save
#endif
diff --git a/mdk-stage1/dietlibc/i386/start.S b/mdk-stage1/dietlibc/i386/start.S
index 167bb779c..1a825fc2a 100644
--- a/mdk-stage1/dietlibc/i386/start.S
+++ b/mdk-stage1/dietlibc/i386/start.S
@@ -1,42 +1,51 @@
-#include "start.h"
+#include "dietfeatures.h"
+#include "PIC.h"
-#ifdef __i386__
.text
-.globl _start
+.global _start
_start:
-#if 0
- popl %ecx
- movl %esp, %esi
- leal 4(%esp,%ecx,4),%eax
+#if 1
+ popl %ecx /* %ecx = argc */
+ movl %esp,%esi /* %esi = argv */
+ pushl %ecx
#else
- movl (%esp),%ecx /* %ecx = argc */
- leal 4(%esp),%esi /* %esi = argv */
-
- leal 4(%esi,%ecx,4),%eax /* eax = 4*ecx+4 = envp */
+ movl (%esp),%ecx /* %ecx = argc */
+ leal 4(%esp),%esi /* %esi = argv */
#endif
- pushl %eax
- pushl %esi
- pushl %ecx
- movl %eax,environ
+ leal 4(%esi,%ecx,4),%eax /* %eax = envp = (4*ecx)+%esi+4 */
#ifdef WANT_DYNAMIC
-/* in %edx we have the dynamic _fini ( register this if non null ) */
- test %edx, %edx
- je .Linit
+/* in %edx we have the ld.so dynamic _fini ( register this if non null ) */
push %edx
- call atexit
- pop %edx
-.Linit:
- call _init
- push $_fini
- call atexit
- pop %edx
#endif
- call main
- pushl %eax
- call exit
-.Lfefe:
- .size _start,.Lfefe-_start
+ pushl %eax
+ pushl %esi
+ pushl %ecx
+ PIC_INIT /* non-PIC: this is an empty line */
+ PUT_VAR %eax, environ, %ecx /* non-PIC: movl %eax,environ */
+
+#ifdef PROFILING
+ pushl $_etext
+ pushl $.text
+ call monitor
+ addl $0x8, %esp
+#endif
+
+#ifdef WANT_DYNAMIC
+ call _dyn_start
+#else
+ call main
+#endif
+
+#ifdef PROFILING
+ pushl %eax
+ call _stop_monitor
+ popl %eax
#endif
+ pushl %eax
+ call exit
+ hlt /* die now ! will ya ... */
+.Lstart:
+ .size _start,.Lstart-_start
diff --git a/mdk-stage1/dietlibc/i386/unified.S b/mdk-stage1/dietlibc/i386/unified.S
index f182bdb4b..989bf37b5 100644
--- a/mdk-stage1/dietlibc/i386/unified.S
+++ b/mdk-stage1/dietlibc/i386/unified.S
@@ -1,13 +1,33 @@
+
#include <dietfeatures.h>
.text
+.global __unified_syscall_256
+.type __unified_syscall_256,@function
+__unified_syscall_256:
+ movzwl %ax,%eax
+ jmp .L1
+.L2:
+.size __unified_syscall_256,.L2-__unified_syscall_256
+.weak exit
+exit:
+.global _exit
+.type _exit,@function
+_exit:
+ movb $1,%al
.global __unified_syscall
+.type __unified_syscall,@function
__unified_syscall:
+.size _exit,__unified_syscall-_exit
movzbl %al, %eax
+.L1:
push %edi
push %esi
push %ebx
movl %esp,%edi
+ /* we use movl instead of pop because otherwise a signal would
+ destroy the stack frame and crash the program, although it
+ would save a few bytes. */
movl 0x10(%edi),%ebx
movl 0x14(%edi),%ecx
movl 0x18(%edi),%edx
@@ -16,19 +36,24 @@ __unified_syscall:
int $0x80
cmp $-124,%eax
jbe .Lnoerror
-#ifdef WANT_THREAD_SAVE
+ neg %eax
+#ifdef WANT_THREAD_SAFE
movl %eax,%ebx
call __errno_location
- neg %ebx
movl %ebx,(%eax)
+ orl $-1,%eax
#else
- neg %eax
mov %eax,errno
+ sbb %eax,%eax # eax = eax - eax - CY = -1
#endif
- xor %eax,%eax
- dec %eax
.Lnoerror:
pop %ebx
pop %esi
pop %edi
+
+/* here we go and "reuse" the return for weak-void functions */
+#include "dietuglyweaks.h"
+
ret
+.L3:
+.size __unified_syscall,.L3-__unified_syscall
diff --git a/mdk-stage1/dietlibc/include/alloca.h b/mdk-stage1/dietlibc/include/alloca.h
index e69de29bb..41f92354f 100644
--- a/mdk-stage1/dietlibc/include/alloca.h
+++ b/mdk-stage1/dietlibc/include/alloca.h
@@ -0,0 +1,13 @@
+#ifndef _ALLOCA_H
+#define _ALLOCA_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#ifdef __GNUC__
+#define alloca(x) __builtin_alloca(x)
+#else
+void *alloca(size_t size) __THROW;
+#endif
+
+#endif
diff --git a/mdk-stage1/dietlibc/include/arpa/inet.h b/mdk-stage1/dietlibc/include/arpa/inet.h
index 6d5a6dc35..bb278d399 100644
--- a/mdk-stage1/dietlibc/include/arpa/inet.h
+++ b/mdk-stage1/dietlibc/include/arpa/inet.h
@@ -9,6 +9,7 @@ int inet_aton(const char *cp, struct in_addr *inp) __THROW;
unsigned long int inet_addr(const char *cp) __THROW;
unsigned long int inet_network(const char *cp) __THROW;
char *inet_ntoa(struct in_addr in) __THROW;
+char *inet_ntoa_r(struct in_addr in,char* buf) __THROW;
struct in_addr inet_makeaddr(int net, int host) __THROW;
unsigned long int inet_lnaof(struct in_addr in) __THROW;
unsigned long int inet_netof(struct in_addr in) __THROW;
diff --git a/mdk-stage1/dietlibc/include/arpa/nameser.h b/mdk-stage1/dietlibc/include/arpa/nameser.h
index 1ee048d66..9327006b0 100644
--- a/mdk-stage1/dietlibc/include/arpa/nameser.h
+++ b/mdk-stage1/dietlibc/include/arpa/nameser.h
@@ -89,6 +89,42 @@ typedef enum __ns_class {
ns_c_max = 65536
} ns_class;
+/*
+ * Currently defined opcodes.
+ */
+typedef enum __ns_opcode {
+ ns_o_query = 0, /* Standard query. */
+ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
+ ns_o_status = 2, /* Name server status query (unsupported). */
+ /* Opcode 3 is undefined/reserved. */
+ ns_o_notify = 4, /* Zone change notification. */
+ ns_o_update = 5, /* Zone update message. */
+ ns_o_max = 6
+} ns_opcode;
+
+/*
+ * Currently defined response codes.
+ */
+typedef enum __ns_rcode {
+ ns_r_noerror = 0, /* No error occurred. */
+ ns_r_formerr = 1, /* Format error. */
+ ns_r_servfail = 2, /* Server failure. */
+ ns_r_nxdomain = 3, /* Name error. */
+ ns_r_notimpl = 4, /* Unimplemented. */
+ ns_r_refused = 5, /* Operation refused. */
+ /* these are for BIND_UPDATE */
+ ns_r_yxdomain = 6, /* Name exists */
+ ns_r_yxrrset = 7, /* RRset exists */
+ ns_r_nxrrset = 8, /* RRset does not exist */
+ ns_r_notauth = 9, /* Not authoritative for zone */
+ ns_r_notzone = 10, /* Zone of record different from zone section */
+ ns_r_max = 11,
+ /* The following are TSIG extended errors */
+ ns_r_badsig = 16,
+ ns_r_badkey = 17,
+ ns_r_badtime = 18
+} ns_rcode;
+
typedef struct {
unsigned id :16; /* query identification number */
#if BYTE_ORDER == BIG_ENDIAN
diff --git a/mdk-stage1/dietlibc/include/assert.h b/mdk-stage1/dietlibc/include/assert.h
index bb573d0f2..a8ce3ce87 100644
--- a/mdk-stage1/dietlibc/include/assert.h
+++ b/mdk-stage1/dietlibc/include/assert.h
@@ -4,24 +4,35 @@
#include <sys/cdefs.h>
/* This prints an "Assertion failed" message and aborts. */
-extern void __assert_fail (__const char *__assertion, __const char *__file,
- unsigned int __line, __const char *__function)
+extern void __assert_fail (const char *__assertion, const char *__file,
+ unsigned int __line, const char *__function)
__THROW __attribute__ ((__noreturn__));
#ifdef __PRETTY_FUNCTION__
#define __ASSERT_FUNCTION __PRETTY_FUNCTION__
#else
-#define __ASSERT_FUNCTION __func__
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __ASSERT_FUNCTION __func__
+# else
+# define __ASSERT_FUNCTION ((const char *) 0)
+# endif
#endif
#undef assert
#ifdef NDEBUG
#define assert(expr)
#else
+#ifdef expect
+# define assert(expr) \
+ ((void) (expect((long)(expr),0) ? 0 : \
+ (__assert_fail (#expr, \
+ __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
+#else
# define assert(expr) \
((void) ((expr) ? 0 : \
(__assert_fail (#expr, \
__FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
#endif
+#endif
#endif
diff --git a/mdk-stage1/dietlibc/include/daemon.h b/mdk-stage1/dietlibc/include/daemon.h
index 9049f367d..e2413d42b 100644
--- a/mdk-stage1/dietlibc/include/daemon.h
+++ b/mdk-stage1/dietlibc/include/daemon.h
@@ -1,6 +1,6 @@
#ifndef _DAEMON_H
#define _DAEMON_H
-extern int daemon (int nochdir,int noclose);
+#include <unistd.h>
#endif
diff --git a/mdk-stage1/dietlibc/include/dirent.h b/mdk-stage1/dietlibc/include/dirent.h
index b0ad4f5ec..ad8b3a41a 100644
--- a/mdk-stage1/dietlibc/include/dirent.h
+++ b/mdk-stage1/dietlibc/include/dirent.h
@@ -3,15 +3,30 @@
#include <sys/cdefs.h>
#include <sys/types.h>
+#include <limits.h>
-#include <linux/dirent.h>
+struct dirent {
+ long d_ino;
+ off_t d_off;
+ unsigned short d_reclen;
+ char d_name[256]; /* We must not include limits.h! */
+};
+
+#ifndef __STRICT_ANSI__
+struct dirent64 {
+ uint64_t d_ino;
+ int64_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+};
+#endif
#define d_fileno d_ino /* Backwards compatibility. */
#undef _DIRENT_HAVE_D_NAMLEN
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
-#define _DIRENT_HAVE_D_TYPE
typedef struct __dirstream DIR;
@@ -23,4 +38,27 @@ void rewinddir (DIR *__dirp) __THROW;
void seekdir (DIR *__dirp, long int __pos) __THROW;
long int telldir (DIR *__dirp) __THROW;
+int scandir(const char *dir, struct dirent ***namelist,
+ int (*selection)(const struct dirent *),
+ int (*compar)(const struct dirent **, const struct dirent **)) __THROW;
+int scandir64(const char *dir, struct dirent64 ***namelist,
+ int (*selection)(const struct dirent64 *),
+ int (*compar)(const struct dirent64 **, const struct dirent64 **)) __THROW;
+
+int alphasort(const struct dirent **a, const struct dirent **b) __THROW __attribute__((const));
+int alphasort64(const struct dirent64 **a, const struct dirent64 **b) __THROW __attribute__((const));
+
+#define MAXNAMLEN NAME_MAX
+
+#ifdef _BSD_SOURCE
+extern int dirfd(DIR *dirp) __THROW;
+#endif
+
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#define dirent dirent64
+#define readdir readdir64
+#define scandir scandir64
+#define alphasort alphasort64
+#endif
+
#endif
diff --git a/mdk-stage1/dietlibc/include/dlfcn.h b/mdk-stage1/dietlibc/include/dlfcn.h
index b96f8f615..0ddcafdba 100644
--- a/mdk-stage1/dietlibc/include/dlfcn.h
+++ b/mdk-stage1/dietlibc/include/dlfcn.h
@@ -7,6 +7,9 @@
#define RTLD_LOCAL 0x00000
#define RTLD_GLOBAL 0x10000