Gentoo Archives: gentoo-amd64

From: Frank Peters <frank.peters@×××××××.net>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Ghostscript Problem - Need Verification [SOLVED]
Date: Tue, 14 Dec 2010 03:02:50
In Reply to: Re: [gentoo-amd64] Ghostscript Problem - Need Verification by malc
Well, the problem is solved and the solution may be of interest
to some Gentoo users.

At first I thought that I was in for some heavy debugging, but the
fault was a simple matter (simple at least superficially).

I have been using the latest gcc-4.5.1 for some time now and
I try to compile my system with all the newest optimizations, namely
the "-flto," "-floop-interchange," "-floop-strip-mine," and
"-floop-block" compiler flags which enables Graphite and LTO.
Usually I have no problems during an emerge but when I do the
temporary removal of the "-flto" option allows the emerge to finish.
So far there have been no issues with these flags.

Now, whenever a problem with software is encountered the first question
to ask is what has been changed on the system.  In my case it most
likely was the use of these compiler flags.  So, on a lark, I decided
to re-emerge ghostscript with a basic set of CFLAGS = -O2 -march=native.
It worked.  The problem I was having with all black images has
disappeared and ghostscript functions normally.

However, I really cannot consider this to be normal behavior.  Compiler
optimization should not degrade the function of a program.  Something
subtle must be at fault with the gcc compiler.  But being quite uninformed
about compiler design I cannot say much more.

Anyway, thanks again for all those who did the test.  This confirmed
that the problem was not ghostscript per se but rather a strange effect
on the ghostscript code caused by the compiler optimization.

I can now see why the Gentoo deveolpers are being so cautious by considering
these latest GCC options as being experimental.

Frank Peters


Subject Author
Re: [gentoo-amd64] Ghostscript Problem - Need Verification [SOLVED] Barry Schwartz <chemoelectric@×××××××××××××.org>