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

Bug 274965

Summary: x11-wm/ratpoison fails to compile with glibc-2.10
Product: Gentoo Linux Reporter: Robert Bradbury <robert.bradbury>
Component: Current packagesAssignee: Desktop WM Team (OBSOLETE) <desktop-wm+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: eric225125, joost.ruis, morgankevinj, vostorga
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://lists.gnu.org/archive/html/ratpoison-devel/2009-06/msg00001.html
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 270353    
Attachments: Patch allowing x11-wm/ratpoison-1.4.4 to build with glibc 2.10
Patch against current x11-wm/ratpoison-1.4.4-r1 ebuild

Description Robert Bradbury 2009-06-21 17:31:16 UTC
Ratpoison 1.4.4-r1 fails to compile with glibc-2.10 due to the redundant definition of getline() in history.c.

The ebuild needs to be changed such that if the glibc version is 2.10 or higher the definition "HAVE_GETLINE" is defined (or one of the other changes in Additional Information).

Reproducible: Always

Steps to Reproduce:
1. emerge ratpoison


Actual Results:  
gcc -DHAVE_CONFIG_H -I.   -I/usr/include/freetype2     -O2 -march=prescott -pipe -I/usr/X11R6/include -MT history.o -MD -MP -MF .deps/history.Tpo -c -o history.o history.c
history.c:78: error: static declaration of 'getline' follows non-static declaration
/usr/include/stdio.h:651: error: previous declaration of 'getline' was here


Expected Results:  
history.c should compile properly

Comment from the developer(s) was:

It seems glibc-2.10 defaults to IEEE 1003.1-2008 (which contains
getline()), unless __STRICT_ANSI__ , _POSIX_SOURCE or POSIX_C_SOURCE
are defined. Previous versions of glibc used IEEE 1003.1-2004 as a
default.
Comment 1 Robert Bradbury 2009-06-21 18:03:56 UTC
The command:
  CFLAGS+=" -DHAVE_GETLINE" emerge ratpoison
seems to allow the emerge to work with glibc-2.10.1.
Comment 2 Víctor Ostorga (RETIRED) gentoo-dev 2009-06-21 18:44:20 UTC
Created attachment 195377 [details, diff]
Patch allowing x11-wm/ratpoison-1.4.4 to build with glibc 2.10
Comment 3 Víctor Ostorga (RETIRED) gentoo-dev 2009-06-21 18:46:47 UTC
Created attachment 195378 [details, diff]
Patch against current x11-wm/ratpoison-1.4.4-r1 ebuild
Comment 4 Joost Ruis 2009-07-06 06:33:29 UTC
I can confirm the workaround suggested in #1

Comment 5 Víctor Ostorga (RETIRED) gentoo-dev 2009-08-01 23:49:15 UTC
Patch applied in portage