From 549ba491fa1d73f9099ecdc898ea229270a94829 Mon Sep 17 00:00:00 2001 From: turbocat Date: Tue, 9 Mar 2021 09:09:11 +0000 Subject: [PATCH] kolibri-libc: - Added mkexp binary - Deleted exports.c - Fixed mkexp and added to Makefile git-svn-id: svn://kolibrios.org@8640 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/kolibri-libc/linuxtools/mkexp | Bin 0 -> 15828 bytes contrib/kolibri-libc/linuxtools/mkexp.c | 11 +- contrib/kolibri-libc/source/Makefile | 8 +- contrib/kolibri-libc/source/exports/exports.c | 130 ------------------ 4 files changed, 12 insertions(+), 137 deletions(-) create mode 100755 contrib/kolibri-libc/linuxtools/mkexp delete mode 100644 contrib/kolibri-libc/source/exports/exports.c diff --git a/contrib/kolibri-libc/linuxtools/mkexp b/contrib/kolibri-libc/linuxtools/mkexp new file mode 100755 index 0000000000000000000000000000000000000000..845c1957669b907d4c3e44be8108250105de4803 GIT binary patch literal 15828 zcmeHOeQ;FO6~Frd#1J3~br#=&0%SMx$S&|>z!qNwOr{Rmk|9QE?i3-&)C<&08%m3ZpdiC!Os^nq@)J%W z$oBGQy+WM5(ctxP*a&93=@X`61o{!^$wRgj|01K3+!2TZnfP4DWVnk&(NlPBu8 zKo9fJ5&g4U&CuK1SAx38^ba8x$D(bEW1&T{XguBRO(ncb4P7~OjP1Hjw}?;Q`DAF- z*FReS)5CwBwQX->!@bki-O2LwPam`)(VqP!QI>+Km$6iYf~3s*(HGx2$h4hav;hU_ z88$o<=>-$;$_e<+33!7I&qsQV4b$HrZCFA2avP@p)(Lp_1kAo$MEg?~fKMR#d{xS>IK4kUH8GZ3W{fMACjjC82sKr|+3z&pK6 ztZUq`X05u^yTp6lXu4)JwPZAP!)U4+?QY$uhP0&C9!=?5vUTIySR$^q2HIk*yuC9K zH!D{S(@6~(94E$$8)IXt94k&--DZlhazJwrq!s7X710YgYkJMR@@Vuzj;x1GJVRo) z_>PG$k=P}kHgTE6PVr-466b3X4Vw0{?RnI8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 "ksys_coff_etable_t EXPORTS[] = {\n"); // Generate char symbol[256]; while(fscanf(input, "%s", symbol) != EOF) { - strcat(buf, "\t{"); - strcat(buf, symbol); - strcat(buf, ", \""); - strcat(buf, symbol); - strcat(buf, "\"},\n"); + char temp[256]; + sprintf(temp, "{\"%s\", %s},\n", symbol, symbol); + strcat(buf, temp); } - strcat(buf, "\t0\n};"); + strcat(buf, "NULL,\n};"); fclose(input); // Output generated diff --git a/contrib/kolibri-libc/source/Makefile b/contrib/kolibri-libc/source/Makefile index 66ad741407..f7d5917c60 100644 --- a/contrib/kolibri-libc/source/Makefile +++ b/contrib/kolibri-libc/source/Makefile @@ -1,5 +1,6 @@ AR = ar -rcs CLINK = ../linuxtools/clink +MKEXP = ../linuxtools/mkexp KPACK = kpack INCLUDE = include @@ -27,7 +28,7 @@ RM = rm -rf MKDIR_P = mkdir -p endif -all: $(cfiles) $(asmfiles) $(LIB_DIR) $(LIBC.A) +all: mk_export $(cfiles) $(asmfiles) $(LIB_DIR) $(LIBC.A) fasm crt/crt0.asm $(LIB_DIR)/crt0.o $(LIBC.A): $(cfiles) $(asmfiles) @@ -45,11 +46,16 @@ clean: $(RM) $(cfiles) $(asmfiles) $(RM) $(LIBNAME) +mk_export: + $(MKEXP) ../loader/symbols.txt exports/exports.c + + shared: $(cfiles) $(asmfiles) $(CLINK) $^ $(KPACK) a.out.obj mv a.out.obj $(LIBC.OBJ) + test: make -C ../test -f Makefile.tcc kex ../test/test diff --git a/contrib/kolibri-libc/source/exports/exports.c b/contrib/kolibri-libc/source/exports/exports.c deleted file mode 100644 index 4b5579da7a..0000000000 --- a/contrib/kolibri-libc/source/exports/exports.c +++ /dev/null @@ -1,130 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -ksys_coff_etable_t EXPORTS[] = { - {"abs", abs}, - {"acos", acos}, - {"acosh", acosh}, - {"asin", asin}, - {"asinh", asinh}, - {"atan", atan}, - {"atan2", atan2}, - {"atanh", atanh}, - {"atoi", atoi}, - {"atol", atol}, - {"atoll", atoll}, - {"calloc", calloc}, - {"ceil", ceil}, - {"clearerr", clearerr}, - {"closedir", closedir}, - {"cos", cos}, - {"cosh", cosh}, - {"debug_printf", debug_printf}, - {"difftime", difftime}, - {"div", div}, - {"exit", exit}, - {"exp", exp}, - {"fabs", fabs}, - {"fclose", fclose}, - {"feof", feof}, - {"ferror", ferror}, - {"fflush", fflush}, - {"fgetc", fgetc}, - {"fgetpos", fgetpos}, - {"fgets", fgets}, - {"floor", floor}, - {"fmod", fmod}, - {"fopen", fopen}, - {"fputc", fputc}, - {"fputs", fputs}, - {"fread", fread}, - {"free", free}, - {"freopen", freopen}, - {"frexp", frexp}, - {"fseek", fseek}, - {"fsetpos", fsetpos}, - {"ftell", ftell}, - {"fwrite", fwrite}, - {"getchar", getchar}, - {"gets", gets}, - {"hypot", hypot}, - {"itoa", itoa}, - {"labs", labs}, - {"ldexp", ldexp}, - {"ldiv", ldiv}, - {"llabs", llabs}, - {"lldiv", lldiv}, - {"localtime", localtime}, - {"log", log}, - {"malloc", malloc}, - {"memccpy", memccpy}, - {"memchr", memchr}, - {"memcmp", memcmp}, - {"memcpy", memcpy}, - {"memmove", memmove}, - {"memset", memset}, - {"mktime", mktime}, - {"modf", modf}, - {"modfl", modfl}, - {"opendir", opendir}, - {"perror", perror}, - {"pow", pow}, - {"pow10", pow10}, - {"pow2", pow2}, - {"printf", printf}, - {"puts", puts}, - {"readdir", readdir}, - {"realloc", realloc}, - {"remove", remove}, - {"rename", rename}, - {"rewind", rewind}, - {"rewinddir", rewinddir}, - {"seekdir", seekdir}, - {"shell_printf", shell_printf}, - {"shell_puts", shell_puts}, - {"shell_putc", shell_putc}, - {"shell_getc", shell_getc}, - {"shell_gets", shell_gets}, - {"shell_cls", shell_cls}, - {"shell_exit", shell_exit}, - {"setbuf", setbuf}, - {"setvbuf", setvbuf}, - {"sin", sin}, - {"sinh", sinh}, - {"snprintf", snprintf}, - {"sprintf", sprintf}, - {"sqrt", sqrt}, - {"strcat", strcat}, - {"strchr", strchr}, - {"strcmp", strcmp}, - {"strcoll", strcoll}, - {"strcpy", strcpy}, - {"strcspn", strcspn}, - {"strerror", strerror}, - {"strlen", strlen}, - {"strncat", strncat}, - {"strncmp", strncmp}, - {"strncpy", strncpy}, - {"strpbrk", strpbrk}, - {"strrchr", strrchr}, - {"strrev", strrev}, - {"strspn", strspn}, - {"strstr", strstr}, - {"strtok", strtok}, - {"strxfrm", strxfrm}, - {"tan", tan}, - {"tanh", tanh}, - {"telldir", telldir}, - {"time", time}, - {"tmpfile", tmpfile}, - {"tmpnam", tmpnam}, - {"vprintf", vprintf}, - {"vsnprintf", vsnprintf}, - 0 -};