Tiny C Compiler:

- Temporarily unrecoverable errors with autoloading libraries.
Rollback to working state: r8558 

git-svn-id: svn://kolibrios.org@8678 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2021-04-23 20:54:03 +00:00
parent b84cfc1204
commit 6317b7f33c
23 changed files with 20 additions and 48 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ http_free fun equ http_free
fun_str equ 'free' fun_str equ 'free'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ http_get fun equ http_get
fun_str equ 'get' fun_str equ 'get'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ http_head fun equ http_head
fun_str equ 'head' fun_str equ 'head'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ http_post fun equ http_post
fun_str equ 'post' fun_str equ 'post'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ http_receive fun equ http_receive
fun_str equ 'receive' fun_str equ 'receive'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ http_send fun equ http_send
fun_str equ 'send' fun_str equ 'send'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ InputBox fun equ InputBox
fun_str equ 'InputBox' fun_str equ 'InputBox'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ charsFit fun equ charsFit
fun_str equ 'charsFit' fun_str equ 'charsFit'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ countUTF8Z fun equ countUTF8Z
fun_str equ 'cntUTF-8' fun_str equ 'cntUTF-8'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ drawText fun equ drawText
fun_str equ 'drawText' fun_str equ 'drawText'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -1,8 +1,7 @@
fasm __lib__.asm fasm __lib__.asm
fasm charsFit.asm fasm mb_create.asm
fasm cntUTF-8.asm fasm mb_reinit.asm
fasm drawText.asm fasm mb_setfunctions.asm
fasm strWidth.asm kos32-ar -ru libmsgbox.a *.o
kos32-ar -ru librasterworks.a *.o
del *.o del *.o
pause pause

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ strWidth fun equ strWidth
fun_str equ 'strWidth' fun_str equ 'strWidth'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ msgbox_create fun equ msgbox_create
fun_str equ 'mb_create' fun_str equ 'mb_create'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ msgbox_reinit fun equ msgbox_reinit
fun_str equ 'mb_reinit' fun_str equ 'mb_reinit'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ msgbox_setfunctions fun equ msgbox_setfunctions
fun_str equ 'mb_setfunctions' fun_str equ 'mb_setfunctions'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -5,7 +5,7 @@ include "__lib__.inc"
fun equ sample_symbol fun equ sample_symbol
fun_str equ 'sample_symbol' fun_str equ 'sample_symbol'
section '.imp.@.' section '.text'
fun_name db fun_str, 0 fun_name db fun_str, 0

View File

@ -41,7 +41,6 @@ typedef struct {
meos_section_info* code_sections; meos_section_info* code_sections;
meos_section_info* data_sections; meos_section_info* data_sections;
meos_section_info* bss_sections; meos_section_info* bss_sections;
meos_section_info* imp_sections; // Pointers to imported libraries and functions
} me_info; } me_info;
int tcc_output_dbgme(const char *filename, me_info* me); int tcc_output_dbgme(const char *filename, me_info* me);
@ -65,11 +64,6 @@ meos_section_info* findsection(me_info* me,int num)
if (si->sec_num==num) if (si->sec_num==num)
return si; return si;
} }
for (si=me->imp_sections;si;si=si->next)
{
if (si->sec_num==num)
return si;
}
return (meos_section_info*)0; return (meos_section_info*)0;
} }
@ -168,16 +162,6 @@ void assign_addresses(me_info* me)
me->bss_sections=si; me->bss_sections=si;
continue; continue;
} }
if (strcmp(".imp.@.",s->name)==0)
{
si=tcc_malloc(sizeof(meos_section_info));
si->data=s->data;
si->data_size=s->data_offset;
si->next=me->imp_sections;
si->sec_num=i;
me->imp_sections=si;
continue;
}
} }
int addr; int addr;
addr=sizeof(IMAGE_MEOS_FILE_HEADER); addr=sizeof(IMAGE_MEOS_FILE_HEADER);
@ -191,11 +175,6 @@ void assign_addresses(me_info* me)
si->sh_addr=addr; si->sh_addr=addr;
addr+=si->data_size; addr+=si->data_size;
} }
for (si=me->imp_sections;si;si=si->next)
{
si->sh_addr=addr;
addr+=si->data_size;
}
me->header.image_size=addr; me->header.image_size=addr;
for (si=me->bss_sections;si;si=si->next) for (si=me->bss_sections;si;si=si->next)
{ {
@ -290,13 +269,6 @@ int tcc_output_me(TCCState* s1,const char *filename)
fwrite(si->data,1,si->data_size,f); fwrite(si->data,1,si->data_size,f);
for (si=me.data_sections;si;si=si->next) for (si=me.data_sections;si;si=si->next)
fwrite(si->data,1,si->data_size,f); fwrite(si->data,1,si->data_size,f);
// IMPORTANT: Write ".imp.@." sections at the very end!
// BSS sections don't count, they should not be in the file at all
// Cause MENUET header filled assuming that file size does not include BSS
// We just emit it for smaller entrophia, sometimes
// it makes the kex file being packed better
for (si=me.imp_sections;si;si=si->next)
fwrite(si->data,1,si->data_size,f);
if (!s1->nobss) if (!s1->nobss)
{ {
for (si=me.bss_sections;si;si=si->next) for (si=me.bss_sections;si;si=si->next)
@ -327,6 +299,7 @@ static inline int get_current_folder(char* buf, int bufsize){
return val; return val;
} }
char *getcwd(char *buf, size_t size) char *getcwd(char *buf, size_t size)
{ {
int rc = get_current_folder(buf, size); int rc = get_current_folder(buf, size);