NetBSD Problem Report #44236

From  Wed Dec 15 18:37:15 2010
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 2778163B886
	for <>; Wed, 15 Dec 2010 18:37:15 +0000 (UTC)
Message-Id: <>
Date: Wed, 15 Dec 2010 18:37:14 +0000 (UTC)
Subject: gcc44 bug causing latest ImageMagick build failure on Solaris
X-Send-Pr-Version: www-1.0

>Number:         44236
>Category:       pkg
>Synopsis:       gcc44 bug causing latest ImageMagick build failure on Solaris
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 15 18:40:00 +0000 2010
>Last-Modified:  Tue Jan 04 08:30:02 +0000 2011
>Originator:     Tim
>Release:        pkgrsc HEAD
SunOS 5.10 Generic_144488-02 sun4u sparc SUNW,Sun-Fire-V440 Solaris

To get the latest ImageMagick package to build, I had to hack around this bug

The hack I used was to copy  /usr/include/complex.h to  /usr/pkg/gcc44/lib/gcc/sparc-sun-solaris2.10/4.4.4/include-fixed/
and apply the following patch:

--- /usr/include/complex.h      2004-11-23 17:11:26.000000000 -0600
+++ /usr/pkg/gcc44/lib/gcc/sparc-sun-solaris2.10/4.4.4/include-fixed/complex.h  2010-12-15 11:40:50.803494200 -0600
@@ -14,12 +14,10 @@
  * Compilation environments for Solaris must provide the _Imaginary datatype
  * and the compiler intrinsics _Complex_I and _Imaginary_I
-#define        _Complex_I      _Complex_I
+#define        _Complex_I      (__extension__ 1.0iF)
 #define        complex         _Complex
-#define        _Imaginary_I    _Imaginary_I
-#define        imaginary       _Imaginary
 #undef I
-#define        I               _Imaginary_I
+#define        I               _Complex_I

 extern float cabsf(float complex);
 extern float cargf(float complex);

Without the hack, the build fails like this:

  CC     magick/magick_libMagickCore_la-fourier.lo
magick/fourier.c: In function 'InverseFourier':
magick/fourier.c:1016: error: '_Imaginary_I' undeclared (first use in this function)
magick/fourier.c:1016: error: (Each undeclared identifier is reported only once
magick/fourier.c:1016: error: for each function it appears in.)
gmake[1]: *** [magick/magick_libMagickCore_la-fourier.lo] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/graphics/ImageMagick/work/ImageMagick-6.6.6-5'
gmake: *** [all] Error 2
*** Error code 2

bmake: stopped in /usr/pkgsrc/graphics/ImageMagick
*** Error code 1

bmake: stopped in /usr/pkgsrc/graphics/ImageMagick

cd pkgsrc/graphics/ImageMagick

From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <>
Subject: Re: pkg/44236
Date: Tue, 04 Jan 2011 09:26:48 +0100

 This bug is not only related to gcc44. I get the same error with lang/gcc34.

 And I think it would be much better if ImageMagick would work around 
 this bug. As far as I understand the thread on, complex 
 arithmetic is not standardized anyway.

 As a workaround, this patch

 --- Makefile    2011/01/04 07:56:21     1.1
 +++ Makefile    2011/01/04 07:56:38
 @@ -19,6 +19,7 @@
   GNU_CONFIGURE=         yes
   CONFIGURE_ARGS+=       --disable-assert
   CONFIGURE_ARGS+=       --with-fontconfig
 +CONFIGURE_ARGS+=       --without-fftw
   PKGCONFIG_OVERRIDE=    Magick++/lib/

 seems to exclude the problematic code. Maybe there is a more 
 fine-grained check in configure, but I prefer this to meddling around 
 with GCC header files. The above patch has to be enclosed in reasonable 
 conditionals, of course.

   Jörn Clausen                   
   Universität Bielefeld

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.