diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-05-14 04:19:43 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-05-14 04:19:43 +0000 |
commit | e9efa23ae121c8976e5dc2bbcf29e029b5087e76 (patch) | |
tree | 55c9bdfec6626bdcb4fa81548a6177b28d8ee223 | |
parent | 64bc6412188b141c010ac3b8e813b837dd991e80 (diff) |
Patch from "D. Jeff Dionne / VE3DJF" <jeff@rt-control.com>
to allow uC-libc to compile under x86.
-Erik
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | include/errno.h | 1 | ||||
-rw-r--r-- | include/sys/bitypes.h | 4 | ||||
-rw-r--r-- | include/sys/cdefs.h | 5 | ||||
-rw-r--r-- | include/sys/socket.h | 1 | ||||
-rw-r--r-- | include/sys/wait.h | 1 | ||||
-rw-r--r-- | include/syscall.h | 8 | ||||
-rw-r--r-- | include/unistd.h | 8 | ||||
-rw-r--r-- | libc/inet/Makefile | 8 | ||||
-rw-r--r-- | libc/inet/rpc/Makefile | 6 | ||||
-rw-r--r-- | libc/misc/time/Makefile | 8 | ||||
-rw-r--r-- | libc/pwd_grp/Makefile | 8 | ||||
-rw-r--r-- | libc/stdio/Makefile | 8 | ||||
-rw-r--r-- | libc/stdlib/Makefile | 8 | ||||
-rw-r--r-- | libc/stdlib/malloc/Makefile | 8 | ||||
-rw-r--r-- | libc/string/Makefile | 8 | ||||
-rw-r--r-- | libc/termios/Makefile | 8 |
17 files changed, 60 insertions, 51 deletions
@@ -1,17 +1,18 @@ DIRS = headers error gtermcap misc stdio2 time getent regexp string termios sysdeps \ malloc-simple net rpc -all: libc.a crt0.o +all: libc.a +# crt0.o libc.a: $(DIRS) dummy - m68k-pic-coff-ranlib $@ + $(CROSS)ranlib $@ -crt0.o: crt +#crt0.o: crt headers: dummy - if [ ! -L "include/asm" ]; then ln -s ../../linux/include/asm include/asm ; fi - if [ ! -L "include/net" ]; then ln -s ../../linux/include/net include/net ; fi - if [ ! -L "include/linux" ]; then ln -s ../../linux/include/linux include/linux ; fi + if [ ! -L "include/asm" ]; then ln -s /usr/src/linux/include/asm include/asm ; fi + if [ ! -L "include/net" ]; then ln -s /usr/src/linux/include/net include/net ; fi + if [ ! -L "include/linux" ]; then ln -s /usr/src/linux/include/linux include/linux ; fi error: dummy make -C error diff --git a/include/errno.h b/include/errno.h index 871c95bef..498db0fbf 100644 --- a/include/errno.h +++ b/include/errno.h @@ -13,6 +13,7 @@ extern int _sys_nerr; extern char *_sys_errlist[]; #endif + extern int errno; __BEGIN_DECLS diff --git a/include/sys/bitypes.h b/include/sys/bitypes.h index e2ac0ab45..ec7781a9d 100644 --- a/include/sys/bitypes.h +++ b/include/sys/bitypes.h @@ -83,12 +83,12 @@ typedef unsigned short u_int16_t; typedef int int32_t; typedef unsigned int u_int32_t; - +#if 0 # if __GNUC__ >= 2 && !defined(__STRICT_ANSI__) typedef long long int64_t; typedef unsigned long long u_int64_t; # endif - +#endif #endif /* __BIT_TYPES_DEFINED__ */ /* #endif __USE_BSD */ diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 0afc8830f..4acb72b70 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -10,7 +10,6 @@ /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * -typedef long double __long_double_t; #else @@ -19,10 +18,6 @@ typedef long double __long_double_t; #define __ptr_t char * -#ifndef __HAS_NO_FLOATS__ -typedef double __long_double_t; -#endif - #endif /* No C++ */ diff --git a/include/sys/socket.h b/include/sys/socket.h index 5dcef2d1b..3a898ee13 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -2,6 +2,7 @@ #define _SYS_SOCKET_H #include <features.h> +#include <errno.h> #include <sys/types.h> #include <linux/socket.h> diff --git a/include/sys/wait.h b/include/sys/wait.h index 95f1b2eab..14c237307 100644 --- a/include/sys/wait.h +++ b/include/sys/wait.h @@ -24,6 +24,7 @@ Cambridge, MA 02139, USA. */ #define _SYS_WAIT_H 1 #include <features.h> +#include <errno.h> __BEGIN_DECLS diff --git a/include/syscall.h b/include/syscall.h index fa08654a3..332b7dd4a 100644 --- a/include/syscall.h +++ b/include/syscall.h @@ -1,6 +1,12 @@ +#if 0 #include <errno.h> - +#endif #define __check_errno(__res) ((__res) >= 0) +#ifdef __mc68000__ #include <m68k/syscall.h> +#else +#include <i386/syscall.h> +#endif + #include <sys/syscall.h> diff --git a/include/unistd.h b/include/unistd.h index 6c39b42c5..ef67fafc4 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -6,8 +6,9 @@ #define __UNISTD_H #include <errno.h> +#ifdef __mc68000__ #include <asm/unistd.h> - +#endif #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 @@ -72,6 +73,8 @@ __res; \ }) #endif +#ifdef __mc68000__ + #define vfork() ({ \ register unsigned long __res __asm__ ("%d0") = __NR_fork; \ __asm__ __volatile__ ("trap #0" \ @@ -86,9 +89,10 @@ if (__res >= (unsigned long)-4096) { \ }) + #define fork fork_not_available_use_vfork #define clone clone_not_available_use__clone - +#endif #ifndef SEEK_SET #define SEEK_SET 0 diff --git a/libc/inet/Makefile b/libc/inet/Makefile index 28565cecd..0b8797488 100644 --- a/libc/inet/Makefile +++ b/libc/inet/Makefile @@ -6,11 +6,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -fno-builtin -I../include +CCFLAGS= -O2 $(CPUFLAGS) -fno-builtin -I../include ASRC=addr.c AOBJ=inet_aton.o inet_addr.o inet_ntoa.o diff --git a/libc/inet/rpc/Makefile b/libc/inet/rpc/Makefile index 388434165..8c2229374 100644 --- a/libc/inet/rpc/Makefile +++ b/libc/inet/rpc/Makefile @@ -1,6 +1,6 @@ -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib CFLAGS= -O2 -fomit-frame-pointer -Dlinux -I../include diff --git a/libc/misc/time/Makefile b/libc/misc/time/Makefile index ab47a7e47..e68ee5dc7 100644 --- a/libc/misc/time/Makefile +++ b/libc/misc/time/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -I../include +CCFLAGS= -O2 $(CPUFLAGS) -I../include OBJ=localtime.o gmtime.o asctime.o ctime.o asc_conv.o tm_conv.o mktime.o \ localtime_r.o gmtime_r.o asctime_r.o ctime_r.o diff --git a/libc/pwd_grp/Makefile b/libc/pwd_grp/Makefile index ce5064852..48b2b3aab 100644 --- a/libc/pwd_grp/Makefile +++ b/libc/pwd_grp/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -I../include +CCFLAGS= -O2 $(CPUFLAGS) -I../include CFLAGS=$(ARCH) -ansi $(CCFLAGS) $(DEFS) diff --git a/libc/stdio/Makefile b/libc/stdio/Makefile index badf78c56..72836d9d1 100644 --- a/libc/stdio/Makefile +++ b/libc/stdio/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -I../include +CCFLAGS= -O2 $(CPUFLAGS) -I../include ASRC=stdio.c AOBJ=_stdio_init.o fputc.o fgetc.o fflush.o fgets.o gets.o fputs.o \ diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile index da8053f1d..c45cd2840 100644 --- a/libc/stdlib/Makefile +++ b/libc/stdlib/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -fno-builtin -I../include +CCFLAGS= -O2 $(CPUFLAGS) -fno-builtin -I../include MSRC=aliases.c MOBJ=abs.o remove.o creat.o bcopy.o bzero.o diff --git a/libc/stdlib/malloc/Makefile b/libc/stdlib/malloc/Makefile index 36872c301..26cfb6930 100644 --- a/libc/stdlib/malloc/Makefile +++ b/libc/stdlib/malloc/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -I../include +CCFLAGS= -O2 $(CPUFLAGS) -I../include MSRC=alloc.c diff --git a/libc/string/Makefile b/libc/string/Makefile index af288e6e6..de79004ba 100644 --- a/libc/string/Makefile +++ b/libc/string/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -I../include +CCFLAGS= -O2 $(CPUFLAGS) -I../include SSRC=string.c SOBJ=strlen.o strcat.o strcpy.o strcmp.o strncat.o strncpy.o strncmp.o \ diff --git a/libc/termios/Makefile b/libc/termios/Makefile index 089fdc0c4..d0d64681d 100644 --- a/libc/termios/Makefile +++ b/libc/termios/Makefile @@ -4,11 +4,11 @@ LIBC=../libc.a -CC=m68k-pic-coff-gcc -AR=m68k-pic-coff-ar -RANLIB=m68k-pic-coff-ranlib +CC=$(CROSS)gcc +AR=$(CROSS)ar +RANLIB=$(CROSS)ranlib -CCFLAGS= -O2 -m68000 -msoft-float -I../include +CCFLAGS= -O2 $(CPUFLAGS) -I../include TSRC=termios.c TOBJ=tcsetattr.o tcgetattr.o tcdrain.o tcflow.o tcflush.o tcsendbreak.o \ |