New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #16213 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

cairo-1.6.4 on PowerPC: error: 'kCGBitmapByteOrder32Host' undeclared

Reported by: xidobix@… Owned by: ryandesign@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc:
Port:

Description (last modified by jmpp@…) (diff)

Mac OS X 10.4.11 MacPorts 1.600 gcc: powerpc-apple-darwin8-gcc-4.0.0 ...

When i try to build Gobby, it fails when building Cairo dependencies

hostname .:. /Applications/MacPorts $ sudo port -v install gobby
Password:
--->  Building cairo with target all
make  all-recursive
Making all in src
/bin/sh ../libtool --tag=CC   --mode=compile /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I..   -I/opt/local/include -I. -I/opt/local/include/freetype2 -I/opt/local/include   -I/opt/local/include   -I/opt/local/include/libpng12   -DXTHREADS -I/opt/local/include -I/usr/X11R6/include    -I/usr/X11R6/include -I/opt/local/include/pixman-1     -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -O2 -MT libcairo_la-cairo-quartz-image-surface.lo -MD -MP -MF .deps/libcairo_la-cairo-quartz-image-surface.Tpo -c -o libcairo_la-cairo-quartz-image-surface.lo `test -f 'cairo-quartz-image-surface.c' || echo './'`cairo-quartz-image-surface.c
 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -I. -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include -I/opt/local/include/libpng12 -DXTHREADS -I/opt/local/include -I/usr/X11R6/include -I/usr/X11R6/include -I/opt/local/include/pixman-1 -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -O2 -MT libcairo_la-cairo-quartz-image-surface.lo -MD -MP -MF .deps/libcairo_la-cairo-quartz-image-surface.Tpo -c cairo-quartz-image-surface.c  -fno-common -DPIC -o .libs/libcairo_la-cairo-quartz-image-surface.o
cairo-quartz-image-surface.c: In function '_cairo_quartz_create_cgimage':
cairo-quartz-image-surface.c:69: error: 'kCGBitmapByteOrder32Host' undeclared (first use in this function)
cairo-quartz-image-surface.c:69: error: (Each undeclared identifier is reported only once
cairo-quartz-image-surface.c:69: error: for each function it appears in.)
make[2]: *** [libcairo_la-cairo-quartz-image-surface.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_cairo/work/cairo-1.6.4" && make all " returned error 2
Command output: make  all-recursive
Making all in src
/bin/sh ../libtool --tag=CC   --mode=compile /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I..   -I/opt/local/include -I. -I/opt/local/include/freetype2 -I/opt/local/include   -I/opt/local/include   -I/opt/local/include/libpng12   -DXTHREADS -I/opt/local/include -I/usr/X11R6/include    -I/usr/X11R6/include -I/opt/local/include/pixman-1     -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -O2 -MT libcairo_la-cairo-quartz-image-surface.lo -MD -MP -MF .deps/libcairo_la-cairo-quartz-image-surface.Tpo -c -o libcairo_la-cairo-quartz-image-surface.lo `test -f 'cairo-quartz-image-surface.c' || echo './'`cairo-quartz-image-surface.c
 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -I. -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include -I/opt/local/include/libpng12 -DXTHREADS -I/opt/local/include -I/usr/X11R6/include -I/usr/X11R6/include -I/opt/local/include/pixman-1 -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -O2 -MT libcairo_la-cairo-quartz-image-surface.lo -MD -MP -MF .deps/libcairo_la-cairo-quartz-image-surface.Tpo -c cairo-quartz-image-surface.c  -fno-common -DPIC -o .libs/libcairo_la-cairo-quartz-image-surface.o
cairo-quartz-image-surface.c: In function '_cairo_quartz_create_cgimage':
cairo-quartz-image-surface.c:69: error: 'kCGBitmapByteOrder32Host' undeclared (first use in this function)
cairo-quartz-image-surface.c:69: error: (Each undeclared identifier is reported only once
cairo-quartz-image-surface.c:69: error: for each function it appears in.)
make[2]: *** [libcairo_la-cairo-quartz-image-surface.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Warning: the following items did not execute (for cairo): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: The following dependencies failed to build: gtk2 cairo jpeg pango Xft2 xorg-xproto xorg-util-macros shared-mime-info libxml2 libtool automake autoconf help2man p5-locale-gettext perl5.8 m4 p5-xml-parser tiff gtkmm cairomm gtksourceview gnome-vfs dbus dbus-glib desktop-file-utils popt gconf intltool gnome-common orbit2 libidl gnome-mime-data gnuregex libgnomeprint bison libart_lgpl libgnomecups libgnomeprintui gnome-icon-theme hicolor-icon-theme icon-naming-utils p5-getopt-long p5-pathtools p5-xml-simple p5-xml-namespacesupport p5-xml-sax libgnomecanvas gail libglade2 libxmlxx2 net6 gnutls libgcrypt libgpg-error libtasn1 lzo opencdk obby avahi dbus-python25 py25-gobject libxslt python25 py25-numeric gdbm libdaemon py25-gdbm py25-gtk py25-cairo py25-numpy fftw-3 py25-hashlib
Error: Status 1 encountered during processing.

Attachments

CGImage.h-ryandesign.txt Download (8.7 KB) - added by ryandesign@… 3 years ago.
CGImage.h on my system (works)
CGImage.h-dakka.akka.txt Download (8.1 KB) - added by ryandesign@… 3 years ago.
CGImage.h on Andrew's system (doesn't work)
CGImage.h-dakka.akka-ryandesign.diff Download (1.0 KB) - added by ryandesign@… 3 years ago.
Difference between Andrew's CGImage.h and mine
cairo-kCGBitmapByteOrder32Host.diff Download (1.2 KB) - added by ryandesign@… 3 years ago.
patch which could fix the Portfile

Change History

  Changed 4 years ago by blb@…

  • owner changed from macports-tickets@… to ryandesign@…
  • summary changed from Gobby fails when building Cairo to cairo-1.6.4 fails to build on 10.4.11, stopping build of gobby
  • milestone set to Port Bugs

Assigning to maintainer.

Looks like an upstream bug:  freedesktop bug 16561.

  Changed 3 years ago by ryandesign@…

  • summary changed from cairo-1.6.4 fails to build on 10.4.11, stopping build of gobby to cairo-1.6.4 on PowerPC: error: 'kCGBitmapByteOrder32Host' undeclared

  Changed 3 years ago by ryandesign@…

kCGBitmapByteOrder32Host should never be undefined in Mac OS X 10.4.x and up, but clearly for a small population of users, it is. We need to figure out why.

Can you please try this command on your system:

find /System -name '*.h' -type f -print0 2>/dev/null | xargs -0 grep -C 2 kCGBitmapByteOrder32Host            

On my system I get:

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h-#ifdef __BIG_ENDIAN__
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h-#define kCGBitmapByteOrder16Host kCGBitmapByteOrder16Big
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h:#define kCGBitmapByteOrder32Host kCGBitmapByteOrder32Big
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h-#else    /* Little endian. */
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h-#define kCGBitmapByteOrder16Host kCGBitmapByteOrder16Little
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h:#define kCGBitmapByteOrder32Host kCGBitmapByteOrder32Little
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h-#endif
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGImage.h-

This shows that kCGBitmapByteOrder32Host is defined in CGImage.h depending on the endianness of the processor. It should never be undefined. The cairo source (specifically cairo-quartz-surface.c) defines kCGBitmapByteOrder32Host if it's undefined, but there's a comment stating that this is only necessary with Mac OS X 10.3.x. Mac OS X 10.4.x and up should always have this defined.

Do you get the same output as above? I'm guessing not. Please post what you get (remembering to enclose lines of literal output in {{{ and }}} as per WikiFormatting). If you get no output, please attach your CGImage.h (at the path shown above). If you don't have that file, please check to see what the last path component is that you do have. For example, if there is no CGImage.h file, is there a Headers directory? If not, is there an A directory? and so on. For the last directory component that you do have, please show us its listing so I can compare with my system to see if you're missing anything else.

Changed 3 years ago by ryandesign@…

CGImage.h on my system (works)

Changed 3 years ago by ryandesign@…

CGImage.h on Andrew's system (doesn't work)

Changed 3 years ago by ryandesign@…

Difference between Andrew's CGImage.h and mine

  Changed 3 years ago by ryandesign@…

Another user emailed me with this problem on a 2.7-GHz dual-processor Power Mac G5 running Mac OS X 10.4.11. He sent me a copy of his CGImage.h. I attached it Download and the same file from my system Download and the diff between them Download. Very curiously, his file is simply missing the definitions of kCGBitmapByteOrderMask, kCGBitmapByteOrderDefault, kCGBitmapByteOrder16Little, kCGBitmapByteOrder32Little, kCGBitmapByteOrder16Big, kCGBitmapByteOrder32Big, kCGBitmapByteOrder16Host, and kCGBitmapByteOrder32Host. I initially though the problem might arise due to a problem when upgrading from Panther, but he says his computer was not upgraded from Panther; it originally shipped with Tiger.

Changed 3 years ago by ryandesign@…

patch which could fix the Portfile

  Changed 3 years ago by ryandesign@…

I've attached a patch Download which could fix the Portfile. That is, I can reproduce the problem on my system if I replace my working CGImage.h with Andrew's broken one, and then applying the patch to the Portfile allows it to build again. And Vladimir Vukicevic  confirms that they do intend to make such a change to cairo as well. But their reason for making the change would be to allow building with Mac OS X 10.3.x. It is still a bug that some users' CGImage.h files are missing these definitions on Mac OS X 10.4.x. Either it is an Apple bug in that Apple is providing the wrong file to some users, or it is someone else's bug if someone else is overwriting Apple's header somehow.

follow-up: ↓ 10   Changed 3 years ago by blb@…

It'd be interesting to see if the Xcode versions differ between systems with/without kCGBitmapByteOrder* definitions; FYI my Xcode 2.5 on 10.4.11 does have those definitions.

  Changed 3 years ago by ryandesign@…

Andrew reports he was using Xcode 2.0. I found using lsbom that CGImage.h is provided by DeveloperTools.pkg (a.k.a. Xcode). So I'm fairly confident that upgrading to at least Xcode 2.4.1 will be the solution. We really need #12794.

  Changed 3 years ago by ryandesign@…

  • status changed from new to closed
  • resolution set to fixed

I've modified the cairo port in r39247 to bail out if the Xcode version is not at least 2.4.1. If that doesn't fix it please re-open this ticket.

  Changed 3 years ago by jmpp@…

  • description modified (diff)

in reply to: ↑ 6   Changed 3 years ago by macports@…

Replying to blb@…:

It'd be interesting to see if the Xcode versions differ between systems with/without kCGBitmapByteOrder* definitions; FYI my Xcode 2.5 on 10.4.11 does have those definitions.

FYI: Xcode 2.4.1 on our 10.4.11 system did not have the kCGBitmapByteOrder definitions and I ended up folding in the supplied patch to get cairo to compile.

  Changed 3 years ago by anonymous

  • milestone Port Bugs deleted

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.