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

Bug 544510

Summary: media-libs/netpbm-10.51.00-r2 fails to build, duplicate getline() method
Product: Gentoo Linux Reporter: Palmer Dabbelt <palmer>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Renames getline() to avoid the conflict with libc

Description Palmer Dabbelt 2015-03-25 20:31:26 UTC
media-libs/netpbm won't compile on my system any more.

Reproducible: Always

Steps to Reproduce:
1. emerge -1 ~media-libs/netpbm-10.51.00

Actual Results:  
netpbm-10.51.00 # make -j1 |& tail -n30
make -C util/ -f /var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/lib/util/Makefile \
        SRCDIR=/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00 BUILDDIR=/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00 vasprintf.o 
make[4]: Entering directory '/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/lib/util'
make[4]: 'vasprintf.o' is up to date.
make[4]: Leaving directory '/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/lib/util'
make[3]: Leaving directory '/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/lib'
x86_64-pc-linux-gnu-gcc -Wall -c -I.  -I"/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00"/importinc -I"/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00"/importinc/netpbm -I/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/converter/ppm  -DNDEBUG \
        -o xpmtoppm.o xpmtoppm.c
In file included from /usr/include/assert.h:35:0,
                 from xpmtoppm.c:34:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^
xpmtoppm.c:126:1: error: conflicting types for ‘getline’
 getline(char * const line,
 ^
In file included from /var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/importinc/netpbm/pm.h:20:0,
                 from /var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/importinc/netpbm/ppm.h:6,
                 from xpmtoppm.c:38:
/usr/include/stdio.h:678:20: note: previous declaration of ‘getline’ was here
 extern _IO_ssize_t getline (char **__restrict __lineptr,
                    ^
/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/common.mk:233: recipe for target 'xpmtoppm.o' failed
make[2]: *** [xpmtoppm.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/converter/ppm'
/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/common.mk:530: recipe for target 'ppm/all' failed
make[1]: *** [ppm/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/converter'
/var/tmp/portage/media-libs/netpbm-10.51.00-r2/work/netpbm-10.51.00/common.mk:530: recipe for target 'converter/all' faile

Expected Results:  
No build failures.

media-libs/netpbm-10.66.00 builds successfully.  I've also constructed a patch that makes media-libs/netpbm-10.51.00-r2 build that I will attach.
Comment 1 Palmer Dabbelt 2015-03-25 20:32:28 UTC
Created attachment 399774 [details, diff]
Renames getline() to avoid the conflict with libc

This file contains a static function called getline() that conflicts with the libc version.  This patch renames that function to avoid the conflict.
Comment 2 Rafał Mużyło 2015-03-26 05:19:29 UTC

*** This bug has been marked as a duplicate of bug 544404 ***