aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r--libbuild2/cc/link-rule.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 9bf86e6..20c6c62 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -2892,8 +2892,6 @@ namespace build2
env_ptrs.push_back (nullptr);
}
- diag_buffer dbuf (ctx);
-
// If targeting Windows, take care of the manifest.
//
path manifest; // Manifest itself (msvc) or compiled object file.
@@ -2949,12 +2947,14 @@ namespace build2
//
process pr (rc,
args,
- -1 /* stdin */,
- 1 /* stdout */,
- dbuf.open (args[0]) /* stderr */,
- nullptr /* cwd */,
+ -1 /* stdin */,
+ 1 /* stdout */,
+ diag_buffer::pipe (ctx) /* stderr */,
+ nullptr /* cwd */,
env_ptrs.empty () ? nullptr : env_ptrs.data ());
+ diag_buffer dbuf (ctx, args[0], pr);
+
try
{
ofdstream os (move (pr.out_fd));
@@ -4038,12 +4038,14 @@ namespace build2
process pr (*ld,
args,
- 0 /* stdin */,
- 2 /* stdout */,
- dbuf.open (args[0], filter) /* stderr */,
- nullptr /* cwd */,
+ 0 /* stdin */,
+ 2 /* stdout */,
+ diag_buffer::pipe (ctx, filter /* force */) /* stderr */,
+ nullptr /* cwd */,
env_ptrs.empty () ? nullptr : env_ptrs.data ());
+ diag_buffer dbuf (ctx, args[0], pr);
+
if (filter)
msvc_filter_link (dbuf, t, ot);
@@ -4127,7 +4129,7 @@ namespace build2
if (!ctx.dry_run)
{
- run (dbuf,
+ run (ctx,
rl,
args,
1 /* finish_verbosity */,