lang/gcc46 building stuff in $TMPDIR

Gerald Pfeifer gerald at pfeifer.com
Sun Jul 29 20:51:02 UTC 2012


On Sat, 9 Jun 2012, Doug Barton wrote:
>> Are you saying you actually noticed some leftovers in /tmp, or that
>> there "just" has been more at certain points in time than you would
>> expect?
> I finally had time to watch this closely, and found the culprit(s).
> While building the port creates a lot of files in /tmp (I think it's
> actually $TMP, not $TMPDIR). A lot of them are *.s files, most of which
> are small, but one of which grew to over 64M, which is what caused my
> build to fail. It also creates a variety of other files, including .o,
> .c, .ld, .le, .zip, etc.
> 
> The java OPTION also creates some pretty big jar directories, I had one
> grow to 49M, which didn't crash my build, but might blow up someone with
> a smaller /tmp.
> 
> My suggestion would be to create a directory in $WRKDIR and assign $TMP
> (or whatever the right envar is) to it.

That could be done, but has one significant drawback: those of us
who have /tmp on fastest storage, and $WRKDIR on slower storage,
could lose a lot of speed.

Also, while I understand your situation, I am very hesitant to change
any defaults given that I have not seen any other user reports, not
even upstream.


Note: according to the GCC documentation

    If `TMPDIR' is set, it specifies the directory to use for temporary
    files.  GCC uses temporary files to hold the output of one stage of
    compilation which is to be used as input to the next stage: for
    example, the output of the preprocessor, which is the input to the
    compiler proper.

Does it make a difference for you if you set TMPDIR to some location
where you have more storage?

On Tue, 10 Jul 2012, Doug Barton wrote:
> Just tried building the latest, same error. Did I misunderstand that
> something was supposed to be different?

I believe lang/gcc47 has seen a split of one large, automatically
generated, source file which is what you may have run into.  So going
for that (and I plan on moving lang/gcc to GCC 4.7 in the not too far
future) could be one option.

Another might be reducing the amount of parallel building on your
system.

Finally, you indicated that you also saw Java create a large
temporary file.  If you want to avoid building Java, the GCC
ports have an option to disable Java.  Let me actually take
this as a trigger to convert this to the new options framework.

Gerald


More information about the freebsd-ports mailing list