History

win32: add -Wl,--stack=xxx switch

For example: $ tcc -Wl,--stack=4194309 which means 4 MB. Default is 1 MB.

grischka committed 15 years ago

Commit 45184e01 parent 7b573dc3 files · +7 −6Browse files

Unified · Split

3 files
  1. libtcc.c +4 −6
  2. tcc.h +1 −0
  3. tccpe.c +2 −0
libtcc.c+4−6
@@ -1551,15 +1551,10 @@ PUB_FUNC const char * tcc_set_linker(TCCState *s, char *option, int multi) · 1550 unmodified lines
15511551 end = NULL;
15521552 if (link_option(option, "Bsymbolic", &p)) {
15531553 s->symbolic = TRUE;
1554−#ifdef TCC_TARGET_PE
1555− } else if (link_option(option, "file-alignment=", &p)) {
1556− s->pe_file_align = strtoul(p, &end, 16);
1557−#endif
15581554 } else if (link_option(option, "fini=", &p)) {
15591555 s->fini_symbol = p;
15601556 if (s->warn_unsupported)
15611557 warning("ignoring -fini %s", p);
1562−
15631558 } else if (link_option(option, "image-base=", &p)) {
15641559 s->text_addr = strtoul(p, &end, 16);
15651560 s->has_text_addr = 1;
@@ -1567,7 +1562,6 @@ PUB_FUNC const char * tcc_set_linker(TCCState *s, char *option, int multi) · 1 unmodified line
15671562 s->init_symbol = p;
15681563 if (s->warn_unsupported)
15691564 warning("ignoring -init %s", p);
1570−
15711565 } else if (link_option(option, "oformat=", &p)) {
15721566 #if defined(TCC_TARGET_PE)
15731567 if (strstart(p, "pe-", NULL)) {
@@ -1599,6 +1593,10 @@ PUB_FUNC const char * tcc_set_linker(TCCState *s, char *option, int multi) · 25 unmodified lines
15991593 s->soname = p;
16001594 multi = 0;
16011595 #ifdef TCC_TARGET_PE
1596+ } else if (link_option(option, "file-alignment=", &p)) {
1597+ s->pe_file_align = strtoul(p, &end, 16);
1598+ } else if (link_option(option, "stack=", &p)) {
1599+ s->pe_stack_size = strtoul(p, &end, 10);
16021600 } else if (link_option(option, "subsystem=", &p)) {
16031601 #if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)
16041602 if (!strcmp(p, "native")) {
tcc.h+1−0
@@ -565,6 +565,7 @@ struct TCCState { · 564 unmodified lines
565565 /* PE info */
566566 int pe_subsystem;
567567 unsigned long pe_file_align;
568+ unsigned long pe_stack_size;
568569 struct pe_uw {
569570 Section *pdata;
570571 int sym_1, sym_2, offs_1;
tccpe.c+2−0
@@ -686,6 +686,8 @@ static int pe_write(struct pe_info *pe) · 685 unmodified lines
686686 pe_header.filehdr.NumberOfSections = pe->sec_count;
687687 pe_header.opthdr.SizeOfHeaders = pe->sizeofheaders;
688688 pe_header.opthdr.ImageBase = pe->imagebase;
689+ if (pe->s1->pe_stack_size)
690+ pe_header.opthdr.SizeOfStackReserve = pe->s1->pe_stack_size;
689691 if (PE_DLL == pe->type)
690692 pe_header.filehdr.Characteristics = CHARACTERISTICS_DLL;
691693 else if (PE_GUI != pe->type)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t