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

Bug 259013

Summary: app-misc/beanstalkd-1.0 fails to build with -D_FORTIFY_SOURCE=2
Product: Gentoo Linux Reporter: Kevin Pyle <gentoo.8eaf7cd8e5128d8191fe>
Component: Current packagesAssignee: Caleb Tennis (RETIRED) <caleb>
Status: RESOLVED FIXED    
Severity: normal CC: flameeyes, zorry
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 259417    
Attachments: Build log of beanstalkd-1.0
Remove -Werror

Description Kevin Pyle 2009-02-14 21:40:52 UTC
While preparing the patch for bug #246902, I encountered a build failure with app-misc/beanstalkd-1.0.  My CFLAGS included -D_FORTIFY_SOURCE=2, which turns on warnings in some commonly misused library functions.  The upstream Makefile adds -Werror to CFLAGS, so those warnings became fatal.  The section of the build log showing the failure is:

cc -O2 -pipe -D_FORTIFY_SOURCE=2 -Wall -Werror -O2   -c -o beanstalkd.o beanstalkd.c
cc1: warnings being treated as errors
beanstalkd.c: In function 'daemonize':
beanstalkd.c:64: warning: ignoring return value of 'chdir', declared with attribute warn_unused_result
make: *** [beanstalkd.o] Error 1


The failed function appears to serve the same purpose as the glibc function daemon(3), so it should be possible to remove the offending function and replace it with a call to daemon().  I have no workload with which to test this application, nor do I use it, but I can write up a proposed patch if you would like.

Although I have -D_FORTIFY_SOURCE=2 in my CFLAGS explicitly, some of the gcc 4.3.x series will set it by default, so this package will likely break when gcc 4.3.x hits the tree.
Comment 1 Magnus Granberg gentoo-dev 2009-02-24 21:29:58 UTC
*** Bug 260185 has been marked as a duplicate of this bug. ***
Comment 2 Magnus Granberg gentoo-dev 2009-02-24 21:33:36 UTC
Created attachment 183078 [details]
Build log of beanstalkd-1.0
Comment 3 Peter Alfredsen (RETIRED) gentoo-dev 2009-02-25 11:30:42 UTC
*** Bug 260238 has been marked as a duplicate of this bug. ***
Comment 4 Magnus Granberg gentoo-dev 2009-02-25 23:32:57 UTC
Created attachment 183206 [details]
Remove -Werror

Compile fine when remove -Werror
Comment 5 Patrick Lauer gentoo-dev 2009-03-02 00:03:33 UTC
+  02 Mar 2009; Patrick Lauer <patrick@gentoo.org>
+  +files/beanstalkd-werror.patch, beanstalkd-1.0.ebuild:
+  Fixing -Werror failure. Patch by Magnus Granberg.