From 0556f5fd4e790a973a6dc0cb46127a24bd950152 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 15 Jul 2019 10:09:23 +0300 Subject: [PATCH] When compiling with -shared (a step in compiling with -live), store the C intermediary file in a different file than main (loader) file, so that debugging symbol lookup information is correct (the files are not replaced constantly with each other). --- compiler/main.v | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/main.v b/compiler/main.v index e9d647da62..a1931dc645 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -942,7 +942,7 @@ fn new_v(args[]string) *V { exit(1) } } - out_name_c := out_name.all_after('/') + '.c' + mut out_name_c := out_name.all_after('/') + '.c' mut files := []string // Add builtin files if !out_name.contains('builtin.o') { @@ -974,7 +974,12 @@ fn new_v(args[]string) *V { is_run: args.contains('run') is_repl: args.contains('-repl') build_mode: build_mode + } + + if pref.is_so { + out_name_c = out_name.all_after('/') + '_shared_lib.c' } + return &V { os: _os out_name: out_name