Opened 18 years ago

Closed 18 years ago

#9050 closed defect (fixed)

gimp2 fails to link, possible libpng problem.

Reported by: ectospheno@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 1.2
Keywords: Cc: waqar@…, yves@…, takanori@…
Port:

Description

Installing gimp2 with a fresh darwinports on May 22, 2006 at 6:00 p.m. EDT fails due to a link error related to libpng. The platform is a PowerPC mac running 10.4.6 with XCode 2.2.1 and Apple's X11. Reproducing the error is easy: install a fresh darwinports on a PowerPC mac and type:

  1. sudo port -v selfupdate
  2. sudo port -v install gimp2

Note that we are just installing gimp2 and ports it depends on -- nothing else. Everything proceeds nicely until the actual gimp2 install which fails with this message:

/usr/bin/ld: Undefined symbols: _png_read_destroy _png_write_destroy collect2: ld returned 1 exit status make[3]: * [png] Error 1 make[2]: * [all-recursive] Error 1 make[1]: * [all-recursive] Error 1 make: * [all] Error 2

Warning: the following items did not execute (for gimp2): com.apple.activate com.apple.build com.apple.destroot com.apple.archive com.apple.install Error: /opt/local/bin/port: Status 1 encountered during processing.

Attachments (3)

libpng-install.log (70.5 KB) - added by ectospheno@… 18 years ago.
Log of libpng install.
gimp2-install.log.gz (68.8 KB) - added by ectospheno@… 18 years ago.
Log of the gimp2 install.
png_fix.patch (957 bytes) - added by vargol@… 18 years ago.
fix for deprecated libpng API

Download all attachments as: .zip

Change History (8)

Changed 18 years ago by ectospheno@…

Attachment: libpng-install.log added

Log of libpng install.

Changed 18 years ago by ectospheno@…

Attachment: gimp2-install.log.gz added

Log of the gimp2 install.

comment:1 Changed 18 years ago by danielluke (Daniel J. Luke)

I haven't tried building gimp, but:

[gandalf:~] dluke% nm /opt/local/lib/libpng.dylib | grep png_read_destroy 00016f30 T _png_read_destroy [gandalf:~] dluke% nm /opt/local/lib/libpng.dylib | grep png_write_destroy 00019a88 T _png_write_destroy [gandalf:~] dluke% port installed | grep png

libpng @1.2.10_2+darwin_8

libpng looks like it provides those symbols, so perhaps it's just a gimp linking issue?

comment:2 Changed 18 years ago by ectospheno@…

(In reply to comment #3)

[gandalf:~] dluke% nm /opt/local/lib/libpng.dylib | grep png_read_destroy 00016f30 T _png_read_destroy [gandalf:~] dluke% nm /opt/local/lib/libpng.dylib | grep png_write_destroy 00019a88 T _png_write_destroy [gandalf:~] dluke% port installed | grep png

libpng @1.2.10_2+darwin_8

libpng looks like it provides those symbols, so perhaps it's just a gimp linking issue?

Well, it does appear gimp2 is trying to link with libpng12 and not libpng. On my machine I get this:

$ /opt/local/lib> nm libpng.dylib | grep 'destroy$' | tail -n 2 00016f40 T _png_read_destroy 00019a98 T _png_write_destroy $ /opt/local/lib> nm libpng12.dylib | grep 'destroy$' | tail -n 2 00016f40 t _png_read_destroy 00019a98 t _png_write_destroy

Am I reading that right and the two functions in question are local only in libpng12? Is that the problem?

comment:3 Changed 18 years ago by takanori@…

Cc: takanori@… added

Changed 18 years ago by vargol@…

Attachment: png_fix.patch added

fix for deprecated libpng API

comment:4 Changed 18 years ago by vargol@…

(From update of attachment 8571) As you noticed the problem is that around libpng 1.2.9 they started enforcing the public / priviate separation of the functions, and png.c was using private functions, naughty guys.

This was actually fixed in GIMP CVS a few weeks back so I've used their CVS web view to generate a patch.

Dave

comment:5 Changed 18 years ago by yves@…

Resolution: fixed
Status: newclosed

fixed in cvs -- thanks a lot !

Note: See TracTickets for help on using tickets.