Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 394507

Summary: media-gfx/imagemagick-6.7.4.0 (and .3.0) with CFLAGS=-O3 - ?
Product: Gentoo Linux Reporter: Dennis Nezic <dennisn>
Component: New packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/doc/en/gcc-optimization.xml#doc_chap2
Whiteboard:
Package list:
Runtime testing required: ---

Description Dennis Nezic 2011-12-13 01:17:45 UTC
I'm not sure at which imagemagick version this compilation problem started, but at least with the latest 6.7.4.0 and 6.7.3.0, it fails to compile if I have "-O3" set. It works with "-O2".

They both fail at decorate.c: (consuming all my memory, I believe :s...)
/bin/sh ./libtool --silent --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -std=gnu99 -std=gnu99 -DHAVE_CONFIG_H -I. -I./config  -I./ltdl -I./ltdl  -I/usr/include/freetype2  -O3 -march=k8 -mtune=k8 -pipe -fomit-frame-pointer -Wall -pthread -c -o magick/magick_libMagickCore_la-decorate.lo `test -f 'magick/decorate.c' || echo './'`magick/decorate.c
x86_64-pc-linux-gnu-gcc: Internal error: Killed (program cc1)
 * ERROR: media-gfx/imagemagick-6.7.3.0 failed (compile phase):
 * ERROR: media-gfx/imagemagick-6.7.4.0 failed (compile phase):

Reproducible: Always
Comment 1 Dennis Nezic 2011-12-13 01:19:28 UTC
(Oh, I'm using gcc 4.5.3-r1)
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-13 14:34:23 UTC
1) Please post your `emerge --info' output in a comment.
2) Please attach the entire build log to this bug report.
Comment 3 Dennis Nezic 2011-12-13 14:41:04 UTC
Why? Does it compile with -O3 for you? (Even with gcc 4.5ish?)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-13 15:13:06 UTC
According to the URL, we still do not support -O3.

-O3: This is the highest level of optimization possible, and also the riskiest. It will take a longer time to compile your code with this option, and in fact it should not be used system-wide with gcc 4.x. The behavior of gcc has changed significantly since version 3.x. In 3.x, -O3 has been shown to lead to marginally faster execution times over -O2, but this is no longer the case with gcc 4.x. Compiling all your packages with -O3 will result in larger binaries that require more memory, and will significantly increase the odds of compilation failure or unexpected program behavior (including errors). The downsides outweigh the benefits; remember the principle of diminishing returns. Using -O3 is not recommended for gcc 4.x.

Also, according to the limited output you posted, the compiler got killed, probably because it ran out of memory to allocate.

Install more RAM, use MAKEOPTS with fewer jobs, remove -pipe from your CFLAGS. But don't think there's a bug to fix here.