https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118803
Bug ID: 118803
Summary: cannot pass parameter `--save-temps` to `collect2`
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: lzsiga at freemail dot c3.hu
Target Milestone: ---
Actually, the problem is in `collect2` which is unlisted in the component-list.
I wish to examine to collect2-created `*cdtor.c` file, but I cannot as it is
deleted before collect2 exits. Option -save-temps (or --save-temps?) should
change this behavior, but I don't seem to be able to use this option.
$ g++ -Wl,--save-temps -g -shared -m64 -o libB.so -fPIC -DPIC libB.cpp; ls
-l /tmp/*cdtor.c *cdtor.c
/usr/local/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
unrecognized option '--save-temps'
/usr/local/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
use the --help option for usage information
collect2: error: ld returned 1 exit status
ls: cannot access /tmp/*cdtor.c: No such file or directory
ls: cannot access *cdtor.c: No such file or directory
$ g++ -Wl,-save-temps -g -shared -m64 -o libB.so -fPIC -DPIC libB.cpp; ls
-l /tmp/*cdtor.c *cdtor.c
/usr/local/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
Error: unable to disambiguate: -save-temps (did you mean --save-temps ?)
collect2: error: ld returned 1 exit status
ls: cannot access /tmp/*cdtor.c: No such file or directory
ls: cannot access *cdtor.c: No such file or directory