Cool, this was not my mistake, patch TCC again.

Admin, please look what's happened with build server, GCC needs a missing library?

git-svn-id: svn://kolibrios.org@8157 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Magomed Kostoev (mkostoevr) 2020-11-06 20:22:05 +00:00
parent ffcd3a73e0
commit c369f06816
6 changed files with 162 additions and 151 deletions

Binary file not shown.

View File

@ -1,7 +1,7 @@
CC = kos32-gcc CC = kos32-gcc
LD = kos32-ld LD = kos32-ld
SDK_DIR:= $(abspath ../../../contrib/sdk) SDK_DIR:= $(abspath ../../../../../contrib/sdk)
#gcc 4.8 #gcc 4.8
#LDFLAGS = -static -nostdlib -T $(SDK_DIR)/sources/newlib/static.lds #LDFLAGS = -static -nostdlib -T $(SDK_DIR)/sources/newlib/static.lds

View File

@ -2038,7 +2038,8 @@ enum {
TCC_OPTION_MD, TCC_OPTION_MD,
TCC_OPTION_MF, TCC_OPTION_MF,
TCC_OPTION_x, TCC_OPTION_x,
TCC_OPTION_stack TCC_OPTION_stack,
TCC_OPTION_nobss
}; };
#define TCC_OPTION_HAS_ARG 0x0001 #define TCC_OPTION_HAS_ARG 0x0001
@ -2100,6 +2101,7 @@ static const TCCOption tcc_options[] = {
{ "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG }, { "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },
{ "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG }, { "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },
{ "stack", TCC_OPTION_stack, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP}, { "stack", TCC_OPTION_stack, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP},
{ "nobss", TCC_OPTION_nobss, 0 },
{ NULL, 0, 0 }, { NULL, 0, 0 },
}; };
@ -2432,6 +2434,9 @@ ST_FUNC int tcc_parse_args1(TCCState *s, int argc, char **argv)
s->pe_stack_size = strtoul(optarg+1, NULL, 10); s->pe_stack_size = strtoul(optarg+1, NULL, 10);
#endif #endif
break; break;
case TCC_OPTION_nobss:
s->nobss = 1;
break;
default: default:
if (s->warn_unsupported) { if (s->warn_unsupported) {
unsupported_option: unsupported_option:

View File

@ -128,6 +128,8 @@ static void help(void)
" -Bdir use 'dir' as tcc internal library and include path\n" " -Bdir use 'dir' as tcc internal library and include path\n"
" -MD generate target dependencies for make\n" " -MD generate target dependencies for make\n"
" -MF depfile put generated dependencies here\n" " -MF depfile put generated dependencies here\n"
"For KolibriOS only:\n"
" -nobss do not emit BSS section into file\n"
); );
} }

View File

@ -871,6 +871,7 @@ struct TCCState {
int do_bench; /* option -bench */ int do_bench; /* option -bench */
int gen_deps; /* option -MD */ int gen_deps; /* option -MD */
char *deps_outfile; /* option -MF */ char *deps_outfile; /* option -MF */
int nobss; /* option -nobss, omit BSS section (KolibriOS-only) */
ParseArgsState *parse_args_state; ParseArgsState *parse_args_state;
}; };

View File

@ -273,15 +273,18 @@ 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);
if (!s1->nobss)
{
for (si=me.bss_sections;si;si=si->next) for (si=me.bss_sections;si;si=si->next)
{ {
if (si->data == NULL) if (si->data == NULL)
{ {
// printf("\nError! BSS data is NULL! size:%i",(int)si->data_size); // printf("\nError! BSS data is NULL! size:%i",(int)si->data_size);
si->data = calloc(si->data_size, 1); si->data = calloc(si->data_size, 1);
} }
fwrite(si->data, 1, si->data_size, f); fwrite(si->data, 1, si->data_size, f);
} }
}
/* /*
if (me.bss_sections) // Siemargl testin, what we lose if (me.bss_sections) // Siemargl testin, what we lose
{ {