I am using the maemo Operating System and the GCC compiler. I have an error when I compile an application: there is no enough space on /tmp. I have 10% of my space free so I don't understand why this happens.. anyway, is it possible to change the GCC configuration in order to use another folder (in another partition)?
Asked
Active
Viewed 1.0k times
2 Answers
29
Set your TMPDIR
environment variable to where you want GCC to put your temporary files. Or, use the -pipe
flag to keep temporary files (except object files) in memory.

F'x
- 12,105
- 7
- 71
- 123
-
2In that case I hope you'll remember to accept the answer. @vah – oKtosiTe Feb 03 '11 at 09:50
-
1I have no environment variable named `TMPDIR` shall I make a new one? – Ahmed Akhtar Apr 13 '16 at 05:01
-
Note that the TMPDIR has to actually exist, or GCC will silently keep using `/tmp` – Michael Mrozek Feb 26 '20 at 22:39
1
Most likely your /tmp
directory is mounted as a tmpfs
filesystem. This means that the files in /tmp
are actually stored in memory, not on disk. If this is the case /tmp
will be limited to what you can fit in memory+swap, and everything in /tmp
will be lost across reboots.
Use mount
or df -T
to see how /tmp
is mounted.

Eric Seppanen
- 5,923
- 30
- 24
-
1/tmp's tmpfs is limited to a a rather small percentage of physical memory, by default, on Debian at least. – Panayiotis Karabassis Jul 08 '12 at 17:48
-
^ I don't know how things were in 2012 (though a cursory Google suggests this was the case even in 2006:), but in most cases, `/tmp` and `/dev/shm` are by default capped at a whopping 50% of available RAM, so I don't think there's much need to worry about that. – underscore_d Oct 06 '15 at 00:08