Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257968 - sys-apps/netplug fails to compile (gcc 4.3.3 _FORTIFY_SOURCE problem)
Summary: sys-apps/netplug fails to compile (gcc 4.3.3 _FORTIFY_SOURCE problem)
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: No maintainer - Look at if you want to take care of it
Depends on:
Blocks: fortify-source
  Show dependency tree
Reported: 2009-02-07 00:28 UTC by Joshua S
Modified: 2009-03-01 19:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

netplug-1.2.9-warn_unused_result_write_call.patch (netplug-1.2.9-warn_unused_result_write_call.patch,630 bytes, patch)
2009-02-07 10:38 UTC, Romain Perier (RETIRED)
Details | Diff
the new ebuild which applying patch (netplug-1.2.9-r5.ebuild,1.71 KB, text/plain)
2009-02-07 10:39 UTC, Romain Perier (RETIRED)
Remove -Werror (remove_Werror.patch,375 bytes, text/plain)
2009-02-25 22:44 UTC, Magnus Granberg

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua S 2009-02-07 00:28:11 UTC
This may be something with my system but it's fails to compile netplug 1.2.9-r2, 1.2.9-r3, and 1.2.9-r4. Everything else updated/compiled fine.


Reproducible: Always

Steps to Reproduce:
1.emerge netplug

Actual Results:  
cc -O2 -mtune=i686 -pipe -Wall -Werror -std=gnu99 -DNP_ETC_DIR='"/etc/netplug"' -DNP_SCRIPT_DIR='"/etc/netplug.d"' -DNP_VERSION='"1.2.9"'   -c -o main.o main.c
cc1: warnings being treated as errors
main.c: In function 'child_handler':
main.c:164: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [main.o] Error 1

Expected Results:  
netplug compiles successfully.

Portage (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.18 i686)
System uname: Linux-2.6.18-i686-Intel-R-_Celeron-R-_CPU_2.40GHz-with-glibc2.0
Timestamp of tree: Sat, 07 Feb 2009 00:00:01 +0000
app-shells/bash:     3.2_p48
dev-lang/python:     2.4.3-r1, 2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.12
sys-apps/sandbox:    1.3.2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
CFLAGS="-O2 -mtune=i686 -pipe"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mtune=i686 -pipe"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="acl apache2 berkdb bzip2 cli cracklib crypt curl curlwrappers dri encode examples exif fortran ftp gd gdbm gif gpm iconv isdnlog jpeg midi ming mpeg mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl php png pppd python readline reflection session soap sockets speex spl ssl sysfs taglib tcpd theora unicode v4l x86 xml xorg xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Comment 1 Joshua S 2009-02-07 05:16:28 UTC
I see someone added "(gcc 4.3.3 _FORTIFY_SOURCE problem)" to the title. So is this a dup? Where should I be looking in order to get this fixed? I googled _FORTIFY_SOURCE  but didn't find much. I also looked at the other two bugs with similar _FORTIFY_SOURCE markings and didn't figure it out. Thanks for your help. 
Comment 2 Romain Perier (RETIRED) gentoo-dev 2009-02-07 10:37:55 UTC
Please find in attachment a patch which fixs issue and the new ebuild including patch.

The problem appended because write POSIX function is declared with attribute "warn_unused_result", causing following warning "main.c:164: error: ignoring return value of 'write', declared with attribute
warn_unused_result", and because the sources are compiled with -Werror CFLAGS all warnings are treated as an error, so emerge failed.

in patch:
i just get the return value of write, i checked if this last was not an error (!= -1) otherwises daemon stops with log_error message.
Comment 3 Romain Perier (RETIRED) gentoo-dev 2009-02-07 10:38:40 UTC
Created attachment 181231 [details, diff]
Comment 4 Romain Perier (RETIRED) gentoo-dev 2009-02-07 10:39:24 UTC
Created attachment 181232 [details]
the new ebuild which applying patch
Comment 5 Joshua S 2009-02-07 13:41:31 UTC
Thanks Perier, The patch+ebuild you provided did the trick.
Comment 6 Romain Perier (RETIRED) gentoo-dev 2009-02-07 14:21:23 UTC
(In reply to comment #5)
> Thanks Perier, The patch+ebuild you provided did the trick.

cool, happy to helped you ;).

@gentoo dev: the patch seems correct ? (syntaxically)
Comment 7 Magnus Granberg gentoo-dev 2009-02-25 22:44:51 UTC
Created attachment 183200 [details]
Remove -Werror

Removing the -Werror in the Makefile fix the probs.
Comment 8 Patrick Lauer gentoo-dev 2009-03-01 19:58:51 UTC
+  01 Mar 2009; Patrick Lauer <>
+  +files/netplug-1.2.9-remove-werror.patch,
+  +files/netplug-1.2.9-warn_unused_result_write_call.patch,
+  +netplug-1.2.9-r5.ebuild:
+  Fix for gcc 4.3.3 / fortify_sources, remove -Werror from Makefile. Patches
+  by Romain Perier and Magnus Granberg.