diff options
author | Peter Damianov <peter0x44@disroot.org> | 2024-04-28 16:16:11 -0700 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-05-02 12:42:33 +0200 |
commit | 985b5a90f70c7376c771317c6c8c3bc5ef05e227 (patch) | |
tree | ff83cb4fcf3dad9e3cf663ee1977aec3fa4c9047 /gcc/tree-inline.cc | |
parent | 5eb25d1561dd22316331feee92164f97ca79d1c3 (diff) | |
download | gcc-985b5a90f70c7376c771317c6c8c3bc5ef05e227.zip gcc-985b5a90f70c7376c771317c6c8c3bc5ef05e227.tar.gz gcc-985b5a90f70c7376c771317c6c8c3bc5ef05e227.tar.bz2 |
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 <peter0x44@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.
Diffstat (limited to 'gcc/tree-inline.cc')
0 files changed, 0 insertions, 0 deletions