https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118803

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Lorinczy Zsigmond from comment #3)
> > On elf targets including Linux, collect2 does not produce any `*cdtor.c` 
> > files. Instead there is an elf section which gets used.
> 
> Well `strace(1)` shows the creation of the *cdtor.c file, but it is true
> that I haven't described yet the platform: it is amd64/Centos7.9, gcc-14.2
> compiled from source.
> 
> Using gcc option `-save-temps` or `--save-temps` has no effect on `collect2`.

You misunderstood the strace output; make_temp_file will create the file so it
can be deleted later on.

But with -save-temps no file is created.

There is some minor cleanup of collect2 that could improve compile time
performance (slightly) in that does not need to call make_temp_file until after
decided that the collecting of cdtor needs to happen.

Anyways as I mentioned the cdtor.c files are NOT used. Yes a temporary file is
created (but it is empty) when not using -save-temps. No file is created when
you use -save-temps.

Reply via email to