authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-03 23:15:45-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-10-03 23:15:45-07:00
log2de53592a1d84a1476f662e20d7339d25d4716fe
treef62adaee50354c29477dc80c58ee4c3d2a7ce7c2
parentab7ea5354101ffaf5c9708ca6398ff7b765b781f

stage1: better value for builtin.link_mode

Now it is Dynamic unless -DZIG_STATIC=on is passed to cmake. This partially addresses #6469.

3 files changed, 5 insertions(+), 1 deletions(-)

CMakeLists.txt+3
...@@ -63,6 +63,9 @@ endif()...@@ -63,6 +63,9 @@ endif()
6363
64if(ZIG_STATIC)64if(ZIG_STATIC)
65 set(ZIG_STATIC_LLVM "on")65 set(ZIG_STATIC_LLVM "on")
66 set(ZIG_LINK_MODE "Static")
67else()
68 set(ZIG_LINK_MODE "Dynamic")
66endif()69endif()
6770
68string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_LIB_DIR_ESCAPED "${ZIG_LIBC_LIB_DIR}")71string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_LIB_DIR_ESCAPED "${ZIG_LIBC_LIB_DIR}")
src/stage1/codegen.cpp+1-1
...@@ -8815,7 +8815,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {...@@ -8815,7 +8815,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
8815 buf_append_str(contents, "/// Deprecated: use `std.Target.current.cpu.arch.endian()`\n");8815 buf_append_str(contents, "/// Deprecated: use `std.Target.current.cpu.arch.endian()`\n");
8816 buf_append_str(contents, "pub const endian = Target.current.cpu.arch.endian();\n");8816 buf_append_str(contents, "pub const endian = Target.current.cpu.arch.endian();\n");
8817 buf_appendf(contents, "pub const output_mode = OutputMode.Obj;\n");8817 buf_appendf(contents, "pub const output_mode = OutputMode.Obj;\n");
8818 buf_appendf(contents, "pub const link_mode = LinkMode.Static;\n");8818 buf_appendf(contents, "pub const link_mode = LinkMode.%s;\n", ZIG_LINK_MODE);
8819 buf_appendf(contents, "pub const is_test = false;\n");8819 buf_appendf(contents, "pub const is_test = false;\n");
8820 buf_appendf(contents, "pub const single_threaded = %s;\n", bool_to_str(g->is_single_threaded));8820 buf_appendf(contents, "pub const single_threaded = %s;\n", bool_to_str(g->is_single_threaded));
8821 buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi);8821 buf_appendf(contents, "pub const abi = Abi.%s;\n", cur_abi);
src/stage1/config.h.in+1
...@@ -21,5 +21,6 @@...@@ -21,5 +21,6 @@
21#define ZIG_CLANG_LIBRARIES "@CLANG_LIBRARIES@"21#define ZIG_CLANG_LIBRARIES "@CLANG_LIBRARIES@"
22#define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@"22#define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@"
23#define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@"23#define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@"
24#define ZIG_LINK_MODE "@ZIG_LINK_MODE@"
2425
25#endif26#endif