Matthew G.
Matthew G.

Reputation: 1350

GCC creating object files with random suffix when killed

It seems that if GCC is killed at some point during compilation, it will save an in-progress object file to disk. The file has a random suffix of the form "${hostname}.${PID}.${RandomSuffix}". For example Thingy.o.linuxVM.31918.WJKwRx

I can't put an exact date for the start of this, but current version is gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

This is a frustrating problem as it messes with my ignore globs for my version control system (ie. *.o).

Is there any way I can tell gcc to stop doing this?

Upvotes: 1

Views: 74

Answers (1)

Piotr Praszmo
Piotr Praszmo

Reputation: 18320

You can avoid some temporary files by adding -pipe option. You can also set environment variable TMPDIR to instruct gcc where to create those files and then remove them all.

gcc should clean up after itself, unless you are annihilating it with SIGKILL.

Upvotes: 4

Related Questions