From: Joel Rosdahl Date: Mon, 5 Apr 2021 17:12:10 +0000 (+0200) Subject: Disable split-dwarf code paths when outputting to /dev/null X-Git-Tag: v4.3~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4caef178e00c464c4ac80372cfa607f81d516dec;p=thirdparty%2Fccache.git Disable split-dwarf code paths when outputting to /dev/null This avoids an attempt to delete /dev/null.dwo, which is harmless but apparently flagged by the sandboxing feature of Gentoo’s build system. Fixes #833. --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index e39c4e54f..a2e600bf9 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -1107,7 +1107,14 @@ process_args(Context& ctx) } if (args_info.seen_split_dwarf) { - args_info.output_dwo = Util::change_extension(args_info.output_obj, ".dwo"); + if (args_info.output_obj == "/dev/null") { + // Outputting to /dev/null -> compiler won't write a .dwo, so just pretend + // we haven't seen the -gsplit-dwarf option. + args_info.seen_split_dwarf = false; + } else { + args_info.output_dwo = + Util::change_extension(args_info.output_obj, ".dwo"); + } } // Cope with -o /dev/null.