/contrib/sdk/sources/newlib/libc.inc |
---|
File deleted |
/contrib/sdk/sources/newlib/mem |
---|
File deleted |
/contrib/sdk/sources/newlib/Makefile |
---|
1,11 → 1,14 |
CC = gcc |
AR = ar rc |
LD = ld |
CC = kos32-gcc |
AR = kos32-ar |
LD = kos32-ld |
CFLAGS = -c -O2 -fomit-frame-pointer -DBUILD_DLL |
LDFLAGS = -nostdlib -shared -s -T libcdll.lds --output-def libc.orig.def --out-implib libc.dll.a --image-base 0 |
LDFLAGS = -shared -s -T libcdll.lds --out-implib libc.dll.a --image-base 0 |
#LDFLAGS+= --output-def libc.orig.def |
ARFLAGS = crs |
LIBC_TOPDIR = . |
LIBC_INCLUDES = $(LIBC_TOPDIR)/include |
15,7 → 18,7 |
INCLUDES:= -I $(LIBC_INCLUDES) |
LIBPATH:= -L ../../lib |
LIBPATH:= -L../../lib -L/home/autobuild/tools/win32/mingw32/lib |
STATIC_SRCS:= \ |
crt/start.S \ |
54,7 → 57,6 |
crt/thread.S \ |
crt/tls.S \ |
crt/setjmp.S \ |
crt/assert.c \ |
crt/cpu_features.c \ |
ctype/ctype_.c \ |
ctype/isascii.c \ |
139,6 → 141,8 |
__call_atexit.c \ |
abort.c \ |
abs.c \ |
assert.c \ |
atexit.c \ |
atof.c \ |
atoi.c \ |
atol.c \ |
375,9 → 379,9 |
$(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile |
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(LIB_OBJS) -lgcc --version-script libc.ver |
sed -e "s/ @[^ ]*//" libc.orig.def > libc.def |
sed -f cmd2.sed libc.def > mem |
sed -f newlib.sed mem > libc.inc |
#sed -e "s/ @[^ ]*//" libc.orig.def > libc.def |
#sed -f cmd2.sed libc.def > mem |
#sed -f newlib.sed mem > libc.inc |
install: libc.dll libc.dll.a libapp.a libdll.a |
mv -f libc.dll ../../bin |
386,16 → 390,16 |
mv -f libdll.a ../../lib |
libapp.a: $(LIBCRT_OBJS) Makefile |
$(AR) libapp.a $(LIBCRT_OBJS) |
$(AR) $(ARFLAGS) libapp.a $(LIBCRT_OBJS) |
libdll.a: $(LIBDLL_OBJS) Makefile |
$(AR) libdll.a $(LIBDLL_OBJS) |
$(AR) $(ARFLAGS) libdll.a $(LIBDLL_OBJS) |
static: $(NAME).a |
$(NAME).a: $(LIB_OBJS) $(SRC_DEP) Makefile |
$(AR) $(NAME).a $(LIB_OBJS) |
$(AR) $(ARFLAGS) $(NAME).a $(LIB_OBJS) |
/contrib/sdk/sources/newlib/Makefile.ebox |
---|
374,7 → 374,7 |
$(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile |
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(LIB_OBJS) -lgcc --version-script libc.ver |
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(LIB_OBJS) --version-script libc.ver |
sed -e "s/ @[^ ]*//" libc.orig.def > libc.def |
sed -f cmd2.sed libc.def > mem |
sed -f newlib.sed mem > libc.inc |
/contrib/sdk/sources/newlib/crt/assert.c |
---|
File deleted |
/contrib/sdk/sources/newlib/crt/crt3.c |
---|
18,7 → 18,7 |
#include <string.h> |
#include <stdio.h> |
/* |
typedef void (*ctp)(); |
static void __do_global_ctors () |
{ |
32,9 → 32,10 |
c++; |
} |
} |
*/ |
void *load_libc(); |
void __main (){}; |
//void __main (){}; |
void* get_entry_point(void *raw); |
/contrib/sdk/sources/newlib/crt/emutls.c |
---|
26,7 → 26,6 |
#include <stdlib.h> |
#include <malloc.h> |
#include <memory.h> |
#include <errno.h> |
#include <gthr.h> |
/contrib/sdk/sources/newlib/crt/pseudo-reloc.c |
---|
19,7 → 19,6 |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdarg.h> |
#include <memory.h> |
extern char __RUNTIME_PSEUDO_RELOC_LIST__; |
extern char __RUNTIME_PSEUDO_RELOC_LIST_END__; |
/contrib/sdk/sources/newlib/libc.def |
---|
2,6 → 2,7 |
_Balloc |
_Bfree |
_Exit DATA |
__assert |
__assert_func |
__ctype_ptr__ DATA |
__emutls_get_address |
13,7 → 14,6 |
__signbitf |
__srget_r |
__swbuf_r |
_assert |
_atoi_r |
_atol_r |
_buf_findstr |
171,6 → 171,7 |
atanf |
atanh |
atanhf |
atexit |
atof |
atoi |
atol |
/contrib/sdk/sources/newlib/libc.orig.def |
---|
2,18 → 2,18 |
_Balloc @1 |
_Bfree @2 |
_Exit @3 DATA |
__assert_func @4 |
__ctype_ptr__ @5 DATA |
__emutls_get_address @6 |
__errno @7 |
__fpclassifyd @8 |
__fpclassifyf @9 |
__mutex_lock @10 |
__signbitd @11 |
__signbitf @12 |
__srget_r @13 |
__swbuf_r @14 |
_assert @15 |
__assert @4 |
__assert_func @5 |
__ctype_ptr__ @6 DATA |
__emutls_get_address @7 |
__errno @8 |
__fpclassifyd @9 |
__fpclassifyf @10 |
__mutex_lock @11 |
__signbitd @12 |
__signbitf @13 |
__srget_r @14 |
__swbuf_r @15 |
_atoi_r @16 |
_atol_r @17 |
_buf_findstr @18 |
171,338 → 171,339 |
atanf @170 |
atanh @171 |
atanhf @172 |
atof @173 |
atoi @174 |
atol @175 |
bsearch @176 |
calloc @177 |
cbrt @178 |
cbrtf @179 |
ceil @180 |
ceilf @181 |
clearerr @182 |
clock @183 |
close @184 |
copysign @185 |
copysignf @186 |
cos @187 |
cosf @188 |
cosh @189 |
coshf @190 |
create_file @191 |
create_image @192 |
create_thread @193 |
ctime @194 |
ctime_r @195 |
debugwrite @196 |
delete_file @197 |
difftime @198 |
diprintf @199 |
div @200 |
dprintf @201 |
drem @202 |
dremf @203 |
entry @204 DATA |
envz_get @205 |
erf @206 |
erfc @207 |
erfcf @208 |
erff @209 |
exit @210 |
exp @211 |
exp10 @212 |
exp10f @213 |
exp2 @214 |
exp2f @215 |
expf @216 |
expm1 @217 |
expm1f @218 |
fabs @219 |
fabsf @220 |
fclose @221 |
fdim @222 |
fdimf @223 |
fdopen @224 |
fflush @225 |
fgetc @226 |
fgets @227 |
fileno @228 |
finite @229 |
finitef @230 |
fiprintf @231 |
fiscanf @232 |
floor @233 |
floorf @234 |
fma @235 |
fmaf @236 |
fmax @237 |
fmaxf @238 |
fmin @239 |
fminf @240 |
fmod @241 |
fmodf @242 |
fopen @243 |
fprintf @244 |
fputc @245 |
fputs @246 |
fputwc @247 |
fread @248 |
free @249 |
freopen @250 |
frexp @251 |
frexpf @252 |
fscanf @253 |
fseek @254 |
fseeko @255 |
fstat @256 |
ftell @257 |
ftello @258 |
fwrite @259 |
gamma @260 |
gamma_r @261 |
gammaf @262 |
gammaf_r @263 |
get_entry_point @264 |
get_fileinfo @265 |
get_proc_address @266 |
getenv @267 |
gettimeofday @268 |
gmtime @269 |
gmtime_r @270 |
hypot @271 |
hypotf @272 |
ilogb @273 |
ilogbf @274 |
infinity @275 |
infinityf @276 |
init_global_reent @277 |
init_loader @278 |
init_reent @279 |
isalnum @280 |
isalpha @281 |
isascii @282 |
isblank @283 |
iscntrl @284 |
isdigit @285 |
isgraph @286 |
isinf @287 |
isinff @288 |
islower @289 |
isnan @290 |
isnanf @291 |
isprint @292 |
ispunct @293 |
isspace @294 |
isupper @295 |
iswalnum @296 |
iswalpha @297 |
iswblank @298 |
iswcntrl @299 |
iswctype @300 |
iswdigit @301 |
iswgraph @302 |
iswlower @303 |
iswprint @304 |
iswpunct @305 |
iswspace @306 |
iswupper @307 |
iswxdigit @308 |
isxdigit @309 |
j0 @310 |
j0f @311 |
j1 @312 |
j1f @313 |
jn @314 |
jnf @315 |
ldexp @316 |
ldexpf @317 |
lgamma @318 |
lgamma_r @319 |
lgammaf @320 |
lgammaf_r @321 |
libc_crt_startup @322 |
link_app @323 |
link_image @324 |
llrint @325 |
llrintf @326 |
llrintl @327 |
llround @328 |
llroundf @329 |
load_library @330 |
loader_env @331 DATA |
localeconv @332 |
localtime @333 |
localtime_r @334 |
log @335 |
log10 @336 |
log10f @337 |
log1p @338 |
log1pf @339 |
log2 @340 |
log2f @341 |
logb @342 |
logbf @343 |
logf @344 |
longjmp @345 |
lrint @346 |
lrintf @347 |
lrintl @348 |
lround @349 |
lroundf @350 |
lseek @351 |
malloc @352 |
matherr @353 |
mbrtowc @354 |
mbtowc @355 |
memalign @356 |
memchr @357 |
memcmp @358 |
memcpy @359 |
memmove @360 |
memset @361 |
mktime @362 |
modf @363 |
modff @364 |
nan @365 |
nanf @366 |
nearbyint @367 |
nearbyintf @368 |
nextafter @369 |
nextafterf @370 |
open @371 |
path_list @372 DATA |
pow @373 |
pow10 @374 |
pow10f @375 |
powf @376 |
printf @377 |
putc @378 |
putchar @379 |
puts @380 |
qsort @381 |
raise @382 |
rand @383 |
rand_r @384 |
read @385 |
read_file @386 |
realloc @387 |
remainder @388 |
remainderf @389 |
remove @390 |
remquo @391 |
remquof @392 |
rename @393 |
rint @394 |
rintf @395 |
rintl @396 |
round @397 |
roundf @398 |
scalb @399 |
scalbf @400 |
scalbln @401 |
scalblnf @402 |
scalbn @403 |
scalbnf @404 |
seed48 @405 |
set_file_size @406 |
setjmp @407 |
setlocale @408 |
setvbuf @409 |
signal @410 |
significand @411 |
significandf @412 |
sin @413 |
sincos @414 |
sincosf @415 |
sinf @416 |
sinh @417 |
sinhf @418 |
siprintf @419 |
sniprintf @420 |
snprintf @421 |
sprintf @422 |
sqrt @423 |
sqrtf @424 |
srand @425 |
srand48 @426 |
sscanf @427 |
stpcpy @428 |
stpncpy @429 |
strcasecmp @430 |
strcasestr @431 |
strcat @432 |
strchr @433 |
strcmp @434 |
strcoll @435 |
strcpy @436 |
strcspn @437 |
strdup @438 |
strerror @439 |
strftime @440 |
strlen @441 |
strncasecmp @442 |
strncat @443 |
strncmp @444 |
strncpy @445 |
strndup @446 |
strnlen @447 |
strpbrk @448 |
strrchr @449 |
strsep @450 |
strspn @451 |
strstr @452 |
strtod @453 |
strtof @454 |
strtok @455 |
strtok_r @456 |
strtol @457 |
strtoll @458 |
strtoul @459 |
strtoull @460 |
strupr @461 |
system @462 |
tan @463 |
tanf @464 |
tanh @465 |
tanhf @466 |
tempnam @467 |
tgamma @468 |
tgammaf @469 |
time @470 |
tls_alloc @471 DATA |
tmpfile @472 |
tmpnam @473 |
toascii @474 |
tolower @475 |
toupper @476 |
towctrans @477 |
towlower @478 |
towupper @479 |
trunc @480 |
truncf @481 |
ungetc @482 |
user_alloc @483 |
validate_pe @484 |
vasniprintf @485 |
vasnprintf @486 |
vdiprintf @487 |
vdprintf @488 |
vfiprintf @489 |
vfiscanf @490 |
vfprintf @491 |
vfscanf @492 |
vscanf @493 |
vsnprintf @494 |
vsprintf @495 |
vsscanf @496 |
wcrtomb @497 |
wctrans @498 |
wctype @499 |
write @500 |
write_file @501 |
y0 @502 |
y0f @503 |
y1 @504 |
y1f @505 |
yn @506 |
ynf @507 |
atexit @173 |
atof @174 |
atoi @175 |
atol @176 |
bsearch @177 |
calloc @178 |
cbrt @179 |
cbrtf @180 |
ceil @181 |
ceilf @182 |
clearerr @183 |
clock @184 |
close @185 |
copysign @186 |
copysignf @187 |
cos @188 |
cosf @189 |
cosh @190 |
coshf @191 |
create_file @192 |
create_image @193 |
create_thread @194 |
ctime @195 |
ctime_r @196 |
debugwrite @197 |
delete_file @198 |
difftime @199 |
diprintf @200 |
div @201 |
dprintf @202 |
drem @203 |
dremf @204 |
entry @205 DATA |
envz_get @206 |
erf @207 |
erfc @208 |
erfcf @209 |
erff @210 |
exit @211 |
exp @212 |
exp10 @213 |
exp10f @214 |
exp2 @215 |
exp2f @216 |
expf @217 |
expm1 @218 |
expm1f @219 |
fabs @220 |
fabsf @221 |
fclose @222 |
fdim @223 |
fdimf @224 |
fdopen @225 |
fflush @226 |
fgetc @227 |
fgets @228 |
fileno @229 |
finite @230 |
finitef @231 |
fiprintf @232 |
fiscanf @233 |
floor @234 |
floorf @235 |
fma @236 |
fmaf @237 |
fmax @238 |
fmaxf @239 |
fmin @240 |
fminf @241 |
fmod @242 |
fmodf @243 |
fopen @244 |
fprintf @245 |
fputc @246 |
fputs @247 |
fputwc @248 |
fread @249 |
free @250 |
freopen @251 |
frexp @252 |
frexpf @253 |
fscanf @254 |
fseek @255 |
fseeko @256 |
fstat @257 |
ftell @258 |
ftello @259 |
fwrite @260 |
gamma @261 |
gamma_r @262 |
gammaf @263 |
gammaf_r @264 |
get_entry_point @265 |
get_fileinfo @266 |
get_proc_address @267 |
getenv @268 |
gettimeofday @269 |
gmtime @270 |
gmtime_r @271 |
hypot @272 |
hypotf @273 |
ilogb @274 |
ilogbf @275 |
infinity @276 |
infinityf @277 |
init_global_reent @278 |
init_loader @279 |
init_reent @280 |
isalnum @281 |
isalpha @282 |
isascii @283 |
isblank @284 |
iscntrl @285 |
isdigit @286 |
isgraph @287 |
isinf @288 |
isinff @289 |
islower @290 |
isnan @291 |
isnanf @292 |
isprint @293 |
ispunct @294 |
isspace @295 |
isupper @296 |
iswalnum @297 |
iswalpha @298 |
iswblank @299 |
iswcntrl @300 |
iswctype @301 |
iswdigit @302 |
iswgraph @303 |
iswlower @304 |
iswprint @305 |
iswpunct @306 |
iswspace @307 |
iswupper @308 |
iswxdigit @309 |
isxdigit @310 |
j0 @311 |
j0f @312 |
j1 @313 |
j1f @314 |
jn @315 |
jnf @316 |
ldexp @317 |
ldexpf @318 |
lgamma @319 |
lgamma_r @320 |
lgammaf @321 |
lgammaf_r @322 |
libc_crt_startup @323 |
link_app @324 |
link_image @325 |
llrint @326 |
llrintf @327 |
llrintl @328 |
llround @329 |
llroundf @330 |
load_library @331 |
loader_env @332 DATA |
localeconv @333 |
localtime @334 |
localtime_r @335 |
log @336 |
log10 @337 |
log10f @338 |
log1p @339 |
log1pf @340 |
log2 @341 |
log2f @342 |
logb @343 |
logbf @344 |
logf @345 |
longjmp @346 |
lrint @347 |
lrintf @348 |
lrintl @349 |
lround @350 |
lroundf @351 |
lseek @352 |
malloc @353 |
matherr @354 |
mbrtowc @355 |
mbtowc @356 |
memalign @357 |
memchr @358 |
memcmp @359 |
memcpy @360 |
memmove @361 |
memset @362 |
mktime @363 |
modf @364 |
modff @365 |
nan @366 |
nanf @367 |
nearbyint @368 |
nearbyintf @369 |
nextafter @370 |
nextafterf @371 |
open @372 |
path_list @373 DATA |
pow @374 |
pow10 @375 |
pow10f @376 |
powf @377 |
printf @378 |
putc @379 |
putchar @380 |
puts @381 |
qsort @382 |
raise @383 |
rand @384 |
rand_r @385 |
read @386 |
read_file @387 |
realloc @388 |
remainder @389 |
remainderf @390 |
remove @391 |
remquo @392 |
remquof @393 |
rename @394 |
rint @395 |
rintf @396 |
rintl @397 |
round @398 |
roundf @399 |
scalb @400 |
scalbf @401 |
scalbln @402 |
scalblnf @403 |
scalbn @404 |
scalbnf @405 |
seed48 @406 |
set_file_size @407 |
setjmp @408 |
setlocale @409 |
setvbuf @410 |
signal @411 |
significand @412 |
significandf @413 |
sin @414 |
sincos @415 |
sincosf @416 |
sinf @417 |
sinh @418 |
sinhf @419 |
siprintf @420 |
sniprintf @421 |
snprintf @422 |
sprintf @423 |
sqrt @424 |
sqrtf @425 |
srand @426 |
srand48 @427 |
sscanf @428 |
stpcpy @429 |
stpncpy @430 |
strcasecmp @431 |
strcasestr @432 |
strcat @433 |
strchr @434 |
strcmp @435 |
strcoll @436 |
strcpy @437 |
strcspn @438 |
strdup @439 |
strerror @440 |
strftime @441 |
strlen @442 |
strncasecmp @443 |
strncat @444 |
strncmp @445 |
strncpy @446 |
strndup @447 |
strnlen @448 |
strpbrk @449 |
strrchr @450 |
strsep @451 |
strspn @452 |
strstr @453 |
strtod @454 |
strtof @455 |
strtok @456 |
strtok_r @457 |
strtol @458 |
strtoll @459 |
strtoul @460 |
strtoull @461 |
strupr @462 |
system @463 |
tan @464 |
tanf @465 |
tanh @466 |
tanhf @467 |
tempnam @468 |
tgamma @469 |
tgammaf @470 |
time @471 |
tls_alloc @472 DATA |
tmpfile @473 |
tmpnam @474 |
toascii @475 |
tolower @476 |
toupper @477 |
towctrans @478 |
towlower @479 |
towupper @480 |
trunc @481 |
truncf @482 |
ungetc @483 |
user_alloc @484 |
validate_pe @485 |
vasniprintf @486 |
vasnprintf @487 |
vdiprintf @488 |
vdprintf @489 |
vfiprintf @490 |
vfiscanf @491 |
vfprintf @492 |
vfscanf @493 |
vscanf @494 |
vsnprintf @495 |
vsprintf @496 |
vsscanf @497 |
wcrtomb @498 |
wctrans @499 |
wctype @500 |
write @501 |
write_file @502 |
y0 @503 |
y0f @504 |
y1 @505 |
y1f @506 |
yn @507 |
ynf @508 |
/contrib/sdk/sources/newlib/stdlib/assert.c |
---|
0,0 → 1,76 |
/* |
FUNCTION |
<<assert>>---macro for debugging diagnostics |
INDEX |
assert |
ANSI_SYNOPSIS |
#include <assert.h> |
void assert(int <[expression]>); |
DESCRIPTION |
Use this macro to embed debuggging diagnostic statements in |
your programs. The argument <[expression]> should be an |
expression which evaluates to true (nonzero) when your program |
is working as you intended. |
When <[expression]> evaluates to false (zero), <<assert>> |
calls <<abort>>, after first printing a message showing what |
failed and where: |
. Assertion failed: <[expression]>, file <[filename]>, line <[lineno]>, function: <[func]> |
If the name of the current function is not known (for example, |
when using a C89 compiler that does not understand __func__), |
the function location is omitted. |
The macro is defined to permit you to turn off all uses of |
<<assert>> at compile time by defining <<NDEBUG>> as a |
preprocessor variable. If you do this, the <<assert>> macro |
expands to |
. (void(0)) |
RETURNS |
<<assert>> does not return a value. |
PORTABILITY |
The <<assert>> macro is required by ANSI, as is the behavior |
when <<NDEBUG>> is defined. |
Supporting OS subroutines required (only if enabled): <<close>>, <<fstat>>, |
<<getpid>>, <<isatty>>, <<kill>>, <<lseek>>, <<read>>, <<sbrk>>, <<write>>. |
*/ |
#include <assert.h> |
#include <stdlib.h> |
#include <stdio.h> |
#ifndef HAVE_ASSERT_FUNC |
/* func can be NULL, in which case no function information is given. */ |
void |
_DEFUN (__assert_func, (file, line, func, failedexpr), |
const char *file _AND |
int line _AND |
const char *func _AND |
const char *failedexpr) |
{ |
fiprintf(stderr, |
"assertion \"%s\" failed: file \"%s\", line %d%s%s\n", |
failedexpr, file, line, |
func ? ", function: " : "", func ? func : ""); |
abort(); |
/* NOTREACHED */ |
} |
#endif /* HAVE_ASSERT_FUNC */ |
void |
_DEFUN (__assert, (file, line, failedexpr), |
const char *file _AND |
int line _AND |
const char *failedexpr) |
{ |
__assert_func (file, line, NULL, failedexpr); |
/* NOTREACHED */ |
} |
/contrib/sdk/sources/newlib/stdlib/atexit.c |
---|
0,0 → 1,66 |
/* |
* Copyright (c) 1990 Regents of the University of California. |
* All rights reserved. |
* |
* %sccs.include.redist.c% |
*/ |
/* |
FUNCTION |
<<atexit>>---request execution of functions at program exit |
INDEX |
atexit |
ANSI_SYNOPSIS |
#include <stdlib.h> |
int atexit (void (*<[function]>)(void)); |
TRAD_SYNOPSIS |
#include <stdlib.h> |
int atexit ((<[function]>) |
void (*<[function]>)(); |
DESCRIPTION |
You can use <<atexit>> to enroll functions in a list of functions that |
will be called when your program terminates normally. The argument is |
a pointer to a user-defined function (which must not require arguments and |
must not return a result). |
The functions are kept in a LIFO stack; that is, the last function |
enrolled by <<atexit>> will be the first to execute when your program |
exits. |
There is no built-in limit to the number of functions you can enroll |
in this list; however, after every group of 32 functions is enrolled, |
<<atexit>> will call <<malloc>> to get space for the next part of the |
list. The initial list of 32 functions is statically allocated, so |
you can always count on at least that many slots available. |
RETURNS |
<<atexit>> returns <<0>> if it succeeds in enrolling your function, |
<<-1>> if it fails (possible only if no space was available for |
<<malloc>> to extend the list of functions). |
PORTABILITY |
<<atexit>> is required by the ANSI standard, which also specifies that |
implementations must support enrolling at least 32 functions. |
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, |
<<lseek>>, <<read>>, <<sbrk>>, <<write>>. |
*/ |
#include <stdlib.h> |
#include "atexit.h" |
/* |
* Register a function to be performed at exit. |
*/ |
int |
_DEFUN (atexit, |
(fn), |
_VOID _EXFNPTR(fn, (_VOID))) |
{ |
return __register_exitproc (__et_atexit, fn, NULL, NULL); |
} |