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
1551 end = NULL;1551 end = NULL;
1552 if (link_option(option, "Bsymbolic", &p)) {1552 if (link_option(option, "Bsymbolic", &p)) {
1553 s->symbolic = TRUE;1553 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
1558 } else if (link_option(option, "fini=", &p)) {1554 } else if (link_option(option, "fini=", &p)) {
1559 s->fini_symbol = p;1555 s->fini_symbol = p;
1560 if (s->warn_unsupported)1556 if (s->warn_unsupported)
1561 warning("ignoring -fini %s", p);1557 warning("ignoring -fini %s", p);
1562
1563 } else if (link_option(option, "image-base=", &p)) {1558 } else if (link_option(option, "image-base=", &p)) {
1564 s->text_addr = strtoul(p, &end, 16);1559 s->text_addr = strtoul(p, &end, 16);
1565 s->has_text_addr = 1;1560 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
1567 s->init_symbol = p;1562 s->init_symbol = p;
1568 if (s->warn_unsupported)1563 if (s->warn_unsupported)
1569 warning("ignoring -init %s", p);1564 warning("ignoring -init %s", p);
1570
1571 } else if (link_option(option, "oformat=", &p)) {1565 } else if (link_option(option, "oformat=", &p)) {
1572#if defined(TCC_TARGET_PE)1566#if defined(TCC_TARGET_PE)
1573 if (strstart(p, "pe-", NULL)) {1567 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
1599 s->soname = p;1593 s->soname = p;
1600 multi = 0;1594 multi = 0;
1601#ifdef TCC_TARGET_PE1595#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);
1602 } else if (link_option(option, "subsystem=", &p)) {1600 } else if (link_option(option, "subsystem=", &p)) {
1603#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)1601#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)
1604 if (!strcmp(p, "native")) {1602 if (!strcmp(p, "native")) {
tcc.h+1−0
@@ -565,6 +565,7 @@ struct TCCState { · 564 unmodified lines
565 /* PE info */565 /* PE info */
566 int pe_subsystem;566 int pe_subsystem;
567 unsigned long pe_file_align;567 unsigned long pe_file_align;
568 unsigned long pe_stack_size;
568 struct pe_uw {569 struct pe_uw {
569 Section *pdata;570 Section *pdata;
570 int sym_1, sym_2, offs_1;571 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
686 pe_header.filehdr.NumberOfSections = pe->sec_count;686 pe_header.filehdr.NumberOfSections = pe->sec_count;
687 pe_header.opthdr.SizeOfHeaders = pe->sizeofheaders;687 pe_header.opthdr.SizeOfHeaders = pe->sizeofheaders;
688 pe_header.opthdr.ImageBase = pe->imagebase;688 pe_header.opthdr.ImageBase = pe->imagebase;
689 if (pe->s1->pe_stack_size)
690 pe_header.opthdr.SizeOfStackReserve = pe->s1->pe_stack_size;
689 if (PE_DLL == pe->type)691 if (PE_DLL == pe->type)
690 pe_header.filehdr.Characteristics = CHARACTERISTICS_DLL;692 pe_header.filehdr.Characteristics = CHARACTERISTICS_DLL;
691 else if (PE_GUI != pe->type)693 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