https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110710
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:985b5a90f70c7376c771317c6c8c3bc5ef05e227 commit r15-107-g985b5a90f70c7376c771317c6c8c3bc5ef05e227 Author: Peter Damianov <peter0...@disroot.org> Date: Sun Apr 28 16:16:11 2024 -0700 Driver: Add new -truncate option This commit adds a new option to the driver that truncates one file after linking. Tested likeso: $ gcc hello.c -c $ du -h hello.o 4.0K hello.o $ gcc hello.o -truncate hello.o $ ./a.out Hello world $ du -h hello.o $ 0 hello.o $ gcc hello.o -truncate gcc: error: missing filename after '-truncate' The motivation for adding this is PR110710. It is used by lto-wrapper to truncate files in a shell-independent manner. Signed-off-by: Peter Damianov <peter0...@disroot.org> PR lto/110710 * common.opt (truncate): New internal option. * gcc.cc (totruncate_file): New global. (driver_handle_option): Handle -truncate <file>. (driver::final_actions): Truncate the file indicated.