From 64d0960244a219526fc100b17f4ecd26223df496 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 6 Apr 2020 19:13:36 -0400 Subject: zig cc: recognize a few more linker options * `--major-image-version` * `--minor-image-version` * `--stack` --- src/link.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/link.cpp') diff --git a/src/link.cpp b/src/link.cpp index 4ee8915e55..439b76a756 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -1840,7 +1840,8 @@ static void construct_linker_job_elf(LinkJob *lj) { if (g->out_type == OutTypeExe) { lj->args.append("-z"); - lj->args.append("stack-size=16777216"); // default to 16 MiB + size_t stack_size = (g->stack_size_override == 0) ? 16777216 : g->stack_size_override; + lj->args.append(buf_ptr(buf_sprintf("stack-size=%" ZIG_PRI_usize, stack_size))); } if (g->linker_script) { @@ -2479,7 +2480,8 @@ static void construct_linker_job_coff(LinkJob *lj) { if (g->out_type == OutTypeExe) { // TODO compile time stack upper bound detection - lj->args.append("-STACK:16777216"); + size_t stack_size = (g->stack_size_override == 0) ? 16777216 : g->stack_size_override; + lj->args.append(buf_ptr(buf_sprintf("-STACK:%" ZIG_PRI_usize, stack_size))); } coff_append_machine_arg(g, &lj->args); -- cgit v1.2.3 From 9ed00b3829dae0fca3db6c0e501ae006e9e8aad8 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 6 Apr 2020 19:26:31 -0400 Subject: provide ___mb_cur_max_func for i386-windows-gnu --- lib/libc/mingw/misc/___mb_cur_max_func.c | 18 ++++++++++++++++++ src/link.cpp | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lib/libc/mingw/misc/___mb_cur_max_func.c (limited to 'src/link.cpp') diff --git a/lib/libc/mingw/misc/___mb_cur_max_func.c b/lib/libc/mingw/misc/___mb_cur_max_func.c new file mode 100644 index 0000000000..61dcdb7a66 --- /dev/null +++ b/lib/libc/mingw/misc/___mb_cur_max_func.c @@ -0,0 +1,18 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ + +#include <_mingw.h> + +extern int* __MINGW_IMP_SYMBOL(__mb_cur_max); + +int __cdecl ___mb_cur_max_func(void); +int __cdecl ___mb_cur_max_func(void) +{ + return *__MINGW_IMP_SYMBOL(__mb_cur_max); +} + +typedef int __cdecl (*_f___mb_cur_max_func)(void); +_f___mb_cur_max_func __MINGW_IMP_SYMBOL(___mb_cur_max_func) = ___mb_cur_max_func; diff --git a/src/link.cpp b/src/link.cpp index 439b76a756..0c02837630 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -72,7 +72,7 @@ static const char *msvcrt_common_src[] = { static const char *msvcrt_i386_src[] = { "misc" OS_SEP "lc_locale_func.c", - + "misc" OS_SEP "___mb_cur_max_func.c", }; static const char *msvcrt_other_src[] = { -- cgit v1.2.3