Package: pngnq
Version: 1.0-2
Severity: minor
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oneiric ubuntu-patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



*** /tmp/tmpolQ03T
In Ubuntu, the attached patch was applied to achieve the following:

  * Update fix-linker-libs.patch to allow building with --as-needed 
    (LP: #770821)

Background:

The package fails to build in Ubuntu:

gcc -I/usr/include/libpng12 -Wall --pedantic -std=gnu99 -g -O2 -g -O2 
-L/usr/lib/x86_64-linux-gnu -lpng12 -lz -lm -Wl,-Bsymbolic-functions -o pngnq  
pngnq.o neuquant32.o rwpng.o  
pngnq.o: In function `pngnq':
/build/buildd/pngnq-1.0/src/pngnq.c:518: undefined reference to `png_get_gAMA'
neuquant32.o: In function `unbiasvalue':
/build/buildd/pngnq-1.0/src/neuquant32.c:127: undefined reference to `pow'
/build/buildd/pngnq-1.0/src/neuquant32.c:128: undefined reference to `floor'
neuquant32.o: In function `initnet':
/build/buildd/pngnq-1.0/src/neuquant32.c:110: undefined reference to `pow'
/build/buildd/pngnq-1.0/src/neuquant32.c:111: undefined reference to `round'
neuquant32.o: In function `round_biased':
/build/buildd/pngnq-1.0/src/neuquant32.c:137: undefined reference to `floor'
/build/buildd/pngnq-1.0/src/neuquant32.c:137: undefined reference to `floor'
neuquant32.o: In function `learn':
/build/buildd/pngnq-1.0/src/neuquant32.c:430: undefined reference to `floor'
/build/buildd/pngnq-1.0/src/neuquant32.c:492: undefined reference to `floor'
[...]

Full buildlog at 
https://launchpadlibrarian.net/70387998/buildlog_ubuntu-natty-amd64.pngnq_1.0-2_FAILEDTOBUILD.txt.gz

The libraries are clearly in the wrong place on the link line for
- --as-needed (http://wiki.debian.org/ToolChain/DSOLinking).  This
probably doesn't affect Debian right now because --as-needed is a
positional option and only affects those libraries listed after it, but
Ubuntu's linker defaults to --as-needed right out of the gate.
Nevertheless, I believe that the debian-gcc team is tracking these
problems and wants to make Debian packages work cleanly with such a
linker.

Thanks for considering the patch.


- -- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric
  APT policy: (500, 'oneiric')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-999-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJOIzOlAAoJEGHzRCZ03mYksZgP/RVUQSkp3DKgzeeavmAE8YTe
lWd7qXq9QDpG+e9Tugfh/2mOoyuGebyAqMDkF2DLV8yXt9zmJRBsHunjkesk1b6n
aVVQbJ8SjVpVIa75pMeAXpRMpT9O1D0VU4EvGG0DcgjpBx8I/NnaV6N/HQyYd5TQ
j39yrkGF3C9r0h85QMPy9SCSQ9RSMtLu4ZbhncLKGueFmzPRYwg3TbrLW5attr3c
iAbYgmwQLzIuTf3QQ9mg38cl1b49XBW+am/OIvnSGvtu9jyKT0tfevQI/5g3Ycut
sxulKh+QBlFU6R/Jcq2ueRfaW4q22N+NNT4jiaBwuga21cuhLQZ0aER3AJe4sRu5
8hosbrowjTfVRP3BXMvVSRPauUiYWWBAWpWFZgidbfYKMXlBVlXI+jWqsJSDgM98
Y65lGMEpqpNfTQYhoCkMEkYKlt8WvNlDgxqlVwG1XkVBK9G2DyD/+TbUqehesQi0
Z2M9g/cEQTJFCj628vfgovu5Z1SQoHPcie9L4HNgiu+LFQ5cuUjl76vTp56CGT/l
EVsSOM82//OHo0p6f3IZXAEx5jx0S1tdxBt64i1mfgQQoOY5/WB2fFPUF4n4qybT
IK75LIgfryCYXd2jj/6uLdZCz6X5LJf0XYetZ2JYoqlFR3s2WTkxeNV8F052AXRH
Bg37BRL2EqC6+XeAWoIJ
=1NCD
-----END PGP SIGNATURE-----
=== modified file 'debian/patches/fix-linker-libs.patch'
--- debian/patches/fix-linker-libs.patch        2009-11-13 19:28:00 +0000
+++ debian/patches/fix-linker-libs.patch        2011-07-17 19:04:07 +0000
@@ -1,21 +1,25 @@
 diff -Nur -x '*.orig' -x '*~' pngnq-1.0/src/Makefile.am 
pngnq-1.0.new/src/Makefile.am
 --- pngnq-1.0/src/Makefile.am  2009-05-20 12:04:15.000000000 +0000
 +++ pngnq-1.0.new/src/Makefile.am      2009-11-13 20:53:12.000000000 +0000
-@@ -1,4 +1,4 @@
+@@ -1,4 +1,6 @@
 -AM_LDFLAGS = ${shell libpng-config --ldflags} -lz
 +AM_LDFLAGS = ${shell libpng-config --ldflags} -lz -lm
++pngnq_LDADD = ${shell libpng-config --libs} -lz -lm
++pngcomp_LDADD = ${shell libpng-config --libs} -lz -lm
  AM_CFLAGS = ${shell libpng-config --I_opts} -Wall --pedantic -std=gnu99
  
  bin_PROGRAMS = pngnq pngcomp
 diff -Nur -x '*.orig' -x '*~' pngnq-1.0/src/Makefile.in 
pngnq-1.0.new/src/Makefile.in
 --- pngnq-1.0/src/Makefile.in  2009-06-20 11:25:38.000000000 +0000
 +++ pngnq-1.0.new/src/Makefile.in      2009-11-13 20:53:18.000000000 +0000
-@@ -147,7 +147,7 @@
+@@ -147,7 +147,9 @@
  sharedstatedir = @sharedstatedir@
  sysconfdir = @sysconfdir@
  target_alias = @target_alias@
 -AM_LDFLAGS = ${shell libpng-config --ldflags} -lz
 +AM_LDFLAGS = ${shell libpng-config --ldflags} -lz -lm
++pngnq_LDADD = ${shell libpng-config --libs} -lz -lm
++pngcomp_LDADD = ${shell libpng-config --libs} -lz -lm
  AM_CFLAGS = ${shell libpng-config --I_opts} -Wall --pedantic -std=gnu99
  pngnq_SOURCES = pngnq.c neuquant32.c rwpng.c  neuquant32.h rwpng.h errors.h
  pngcomp_SOURCES = pngcomp.c rwpng.c colorspace.c  colorspace.h

Reply via email to