Welcome back, klmalloc.
This commit is contained in:
parent
af6ad29235
commit
265542402a
@ -27,7 +27,7 @@ diff -rupN _source/newlib-1.19.0/newlib/configure.host newlib-1.19.0/newlib/conf
|
||||
|
||||
case "${host}" in
|
||||
+ *-*-toaru)
|
||||
+ newlib_cflags="${newlib_cflags} -fPIC -DSIGNAL_PROVIDED -DMISSING_SYSCALL_NAMES"
|
||||
+ newlib_cflags="${newlib_cflags} -fPIC -DSIGNAL_PROVIDED -DMISSING_SYSCALL_NAMES -DMALLOC_PROVIDED"
|
||||
+ ;;
|
||||
*-*-cygwin*)
|
||||
test -z "$cygwin_srcdir" && cygwin_srcdir=`cd ${srcdir}/../winsup/cygwin; pwd`
|
||||
|
@ -4,7 +4,7 @@ AM_CCASFLAGS = $(INCLUDES)
|
||||
|
||||
noinst_LIBRARIES = lib.a
|
||||
|
||||
lib_a_SOURCES = syscalls.c
|
||||
lib_a_SOURCES = syscalls.c klmalloc.c
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
|
@ -52,7 +52,7 @@ LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
lib_a_AR = $(AR) $(ARFLAGS)
|
||||
lib_a_LIBADD =
|
||||
am_lib_a_OBJECTS = lib_a-syscalls.$(OBJEXT)
|
||||
am_lib_a_OBJECTS = lib_a-syscalls.$(OBJEXT) lib_a-klmalloc.$(OBJEXT)
|
||||
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp =
|
||||
@ -170,7 +170,7 @@ AUTOMAKE_OPTIONS = cygnus
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
AM_CCASFLAGS = $(INCLUDES)
|
||||
noinst_LIBRARIES = lib.a
|
||||
lib_a_SOURCES = syscalls.c
|
||||
lib_a_SOURCES = syscalls.c klmalloc.c
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
|
||||
@ -239,6 +239,12 @@ lib_a-syscalls.o: syscalls.c
|
||||
lib_a-syscalls.obj: syscalls.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-syscalls.obj `if test -f 'syscalls.c'; then $(CYGPATH_W) 'syscalls.c'; else $(CYGPATH_W) '$(srcdir)/syscalls.c'; fi`
|
||||
|
||||
lib_a-klmalloc.o: klmalloc.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-klmalloc.o `test -f 'klmalloc.c' || echo '$(srcdir)/'`klmalloc.c
|
||||
|
||||
lib_a-klmalloc.obj: klmalloc.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-klmalloc.obj `if test -f 'klmalloc.c'; then $(CYGPATH_W) 'klmalloc.c'; else $(CYGPATH_W) '$(srcdir)/klmalloc.c'; fi`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
1001
toolchain/patches/newlib/toaru/klmalloc.c
Normal file
1001
toolchain/patches/newlib/toaru/klmalloc.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -23,6 +23,11 @@
|
||||
#include "syscall.h"
|
||||
#include <bits/dirent.h>
|
||||
|
||||
extern void *malloc(size_t size);
|
||||
extern void free(void *ptr);
|
||||
extern void *calloc(size_t nmemb, size_t size);
|
||||
extern void *realloc(void *ptr, size_t size);
|
||||
|
||||
extern void _init();
|
||||
extern void _fini();
|
||||
|
||||
@ -86,6 +91,8 @@ DEFN_SYSCALL3(waitpid, 53, int, int *, int);
|
||||
|
||||
extern char ** environ;
|
||||
|
||||
int ioctl(int fd, int request, void * argp);
|
||||
|
||||
#define DEFAULT_PATH ".:/bin:/usr/bin"
|
||||
|
||||
// --- Process Control ---
|
||||
@ -166,7 +173,7 @@ int kill(int pid, int sig) {
|
||||
}
|
||||
|
||||
sighandler_t signal(int signum, sighandler_t handler) {
|
||||
return syscall_signal(signum, (void *)handler);
|
||||
return (sighandler_t)syscall_signal(signum, (void *)handler);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -247,7 +254,7 @@ int fstat(int file, struct stat *st) {
|
||||
}
|
||||
|
||||
int stat(const char *file, struct stat *st){
|
||||
int ret = syscall_stat((char *)file, (uintptr_t)st);
|
||||
int ret = syscall_stat((char *)file, (void *)st);
|
||||
if (ret >= 0) {
|
||||
return ret;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user