Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9843 → Rev 9842

/programs/develop/ktcc/trunk/libc.obj/source/math/sqrt.s
File deleted
/programs/develop/ktcc/trunk/libc.obj/source/math/tan.s
File deleted
/programs/develop/ktcc/trunk/libc.obj/source/math/tan.asm
0,0 → 1,10
format COFF
section '.text'
 
public _tan as "tan"
 
_tan:
fld qword[esp+4]
fptan
fxch
ret
/programs/develop/ktcc/trunk/libc.obj/source/math/sqrt.asm
0,0 → 1,9
format COFF
section '.text'
 
public _sqrt as "sqrt"
 
_sqrt:
fld qword[esp+4]
fsqrt
ret
/programs/develop/ktcc/trunk/libc.obj/source/Tupfile.lua
3,45 → 3,16
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../../../" or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_gcc.lua")
 
CFLAGS = " -r -nostdinc -nostdlib -DGNUC -D_BUILD_LIBC "
CFLAGS = " -c -nostdinc -DGNUC -D_BUILD_LIBC -Os -fno-common -fno-builtin -fno-leading-underscore -fno-pie"
INCLUDES = " -I../include"
 
GAS_SRC = {
"setjmp/setjmp.s",
"setjmp/longjmp.s",
"math/round.s",
"math/atan.s",
"math/pow2.s",
"math/log10.s",
"math/exp.s",
"math/pow10.s",
"math/log.s",
"math/pow.s",
"math/ceil.s",
"math/cos.s",
"math/sin.s",
"math/asin.s",
"math/modf.s",
"math/floor.s",
"math/fabs.s",
"math/fmod.s",
"math/log2.s",
"math/acos.s",
"math/modfl.s",
"math/atan2.s",
"math/sqrt.s",
"math/tan.s",
"string/memset.s",
"string/memmove.s"
}
OBJS = {"math/tan.obj", "math/sqrt.obj"}
 
OBJS = {}
for _, OBJ in pairs(OBJS) do
tup.rule(string.gsub(OBJ, ".obj", ".asm"), "fasm %f %o ", OBJ)
end
 
tup.append_table(OBJS,
tup.foreach_rule(GAS_SRC, "as --32 %f -o %o", "%B.o")
)
tup.rule("libc.c", "kos32-gcc" .. CFLAGS .. INCLUDES .. " -o %o %f ", "libc_tmp.obj")
 
table.insert(OBJS, "libc.c");
 
tup.rule(OBJS, "kos32-tcc" .. CFLAGS .. INCLUDES .. " -o %o %f " .. " && strip %o --strip-unneeded " , "libc.o")
tup.rule("libc.o", "objconv -fcoff32 %f %o " .. tup.getconfig("KPACK_CMD"), "%B.obj")
table.insert(OBJS, "libc_tmp.obj");
tup.rule(OBJS, "clink -o %o %f" .. " && kos32-strip %o --strip-unneeded " .. tup.getconfig("KPACK_CMD"), "libc.obj");
/programs/develop/ktcc/trunk/libc.obj/source/libc.c
119,6 → 119,37
#include "misc/basename.c"
#include "misc/dirname.c"
 
__asm__(
".include \"math/acos.s\"\n\t"
".include \"math/asin.s\"\n\t"
".include \"math/atan.s\"\n\t"
".include \"math/atan2.s\"\n\t"
".include \"math/ceil.s\"\n\t"
".include \"math/cos.s\"\n\t"
".include \"math/exp.s\"\n\t"
".include \"math/fabs.s\"\n\t"
".include \"math/floor.s\"\n\t"
".include \"math/fmod.s\"\n\t"
".include \"math/log.s\"\n\t"
".include \"math/log2.s\"\n\t"
".include \"math/log10.s\"\n\t"
".include \"math/modf.s\"\n\t"
".include \"math/modfl.s\"\n\t"
".include \"math/pow.s\"\n\t"
".include \"math/pow2.s\"\n\t"
".include \"math/pow10.s\"\n\t"
".include \"math/round.s\"\n\t"
".include \"math/sin.s\"\n\t");
 
__asm__(
".include \"string/memmove.s\"\n\t"
".include \"string/memset.s\"\n\t"
".include \"setjmp/longjmp.s\"\n\t"
".include \"setjmp/setjmp.s\"");
 
#include "libtcc1/libtcc1.c"
#include "stdlib/___chkstk_ms.c"
 
ksys_dll_t EXPORTS[] = {
{ "clearerr", &clearerr },
{ "debug_printf", &debug_printf },
/programs/develop/ktcc/trunk/libc.obj/source/stdlib/assert.c
1,8 → 1,13
#include <stdio.h>
#include <stdlib.h>
 
#pragma GCC push_options
#pragma GCC optimize("O0")
 
void __assert_fail(const char* expr, const char* file, int line, const char* func)
{
fprintf(stdout, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line);
exit(0);
}
}
 
#pragma GCC pop_options
/programs/develop/ktcc/trunk/libc.obj/source/time/asctime.c
7,6 → 7,9
const char* wday_str[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
const char* mon_str[12] = { "Jan", "Feb", "Mar", "Ap", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
 
#pragma GCC push_options
#pragma GCC optimize("O0")
 
#define TIME_STR_MAX 27
 
char* asctime(const struct tm* tm)
27,4 → 30,5
tm->tm_min, tm->tm_sec,
1900 + tm->tm_year);
return time_str;
}
}
#pragma GCC pop_options