Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 195861 - net-misc/iputils-20070202 does not build with sys-kernel/linux-headers-2.6.23
Summary: net-misc/iputils-20070202 does not build with sys-kernel/linux-headers-2.6.23
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 196001 196049 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-14 16:17 UTC by Markus Meier
Modified: 2007-10-16 14:42 UTC (History)
7 users (show)

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


Attachments
Patch for removed OPEN_MAX constant in linux kernel (iputils-no_open_max.patch,587 bytes, patch)
2007-10-16 00:58 UTC, David 'Bombe' Roden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Meier gentoo-dev 2007-10-14 16:17:25 UTC
i686-pc-linux-gnu-gcc -O2 -march=pentium-m -fomit-frame-pointer -pipe -Wstrict-prototypes -Wall -D_GNU_SOURCE   rdisc.c  -lresolv -o rdisc
rdisc.c: In function ‘do_fork’:
rdisc.c:251: error: ‘OPEN_MAX’ undeclared (first use in this function)
rdisc.c:251: error: (Each undeclared identifier is reported only once
rdisc.c:251: error: for each function it appears in.)
make: *** [rdisc] Error 1
make: *** Waiting for unfinished jobs....

with linux-headers-2.6.23:
# grep -r OPEN_MAX /usr/include/linux/
#

with linux-headers-2.6.22-r2
# grep -r OPEN_MAX /usr/include/linux/
/usr/include/linux/limits.h:#define OPEN_MAX         256        /* # open files a process may have */


Portage 2.1.3.13 (default-linux/x86/2007.0/desktop, gcc-4.2.2, glibc-2.6.1-r0, 2.6.23 i686)
=================================================================
System uname: 2.6.23 i686 Intel(R) Pentium(R) M processor 1600MHz
Timestamp of tree: Sun, 14 Oct 2007 11:00:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.5.1-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0_rc5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner"
FEATURES="collision-protect cvs digest distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms sign strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/ http://gentoo.inode.at/"
LANG="en_GB.utf8"
LC_ALL="en_GB.utf8"
LINGUAS="en de en_GB"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://192.168.2.1/gentoo-portage"
USE="X a52 aac acl acpi alsa apache2 avahi berkdb bidi bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups curl dbus divx divx4linux dri dts dvd dvdr dvdread eds emboss encode evo exif fam ffmpeg firefox flac fortran gdbm gif gnome gnutls gpm graphviz gs gstreamer gtk hal iconv ieee1394 ipod ipv6 isdnlog java jpeg kde kdeenablefinal kerberos lcms live mad midi mikmod mmx mono mozilla mp3 mpeg mudflap ncurses nls nptl nptlonly nsplugin ntfs ogg oggvorbis openexr opengl openmp oss pam pcre pdf perl png pppd python qt qt3 qt3support qt4 quicktime readline real reflection ruby samba screen sdl session spell spl sse sse2 ssl stream svg tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb vcd vorbis win32codecs wxwindows x86 xcomposite xine xinerama xml2 xorg xprint xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev synaptics mouse keyboard" KERNEL="linux" LINGUAS="en de en_GB" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CTARGET, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Nick Devito 2007-10-14 18:29:25 UTC
I believe this is caused by linux-headers-2.6.23 removing the OPEN_MAX definition from /usr/include/linux/limits.h. I found a random post on a random mailing list that suggested replacing the limits.h stuff with this:

  #include <unistd.h>
  #define OPEN_MAX (sysconf(_SC_OPEN_MAX))

I tried it on iputils (rdisc.c) and it seemed to fix the problem, however I'm not sure how it would act on earlier linux-headers revisions.

~ Nick
Comment 2 SpanKY gentoo-dev 2007-10-15 05:46:31 UTC
one issue per bug

it's better to simply rewrite code that relies on constants ... the POSIX standard explicitly allows omitting the OPEN_MAX define

as a workaround, dropping in:
#define OPEN_MAX (sysconf(_SC_OPEN_MAX))

should work fine when OPEN_MAX is used dynamically and not as an actual hard constant (like an array size)
Comment 3 SpanKY gentoo-dev 2007-10-15 05:50:46 UTC
fixed in cvs
Comment 4 David 'Bombe' Roden 2007-10-16 00:58:58 UTC
Created attachment 133584 [details, diff]
Patch for removed OPEN_MAX constant in linux kernel

This is a better fix for the problem (taken from http://www.redhat.com/archives/fedora-extras-commits/2007-August/msg01642.html).
Comment 5 Jose daLuz 2007-10-16 01:33:26 UTC
*** Bug 196001 has been marked as a duplicate of this bug. ***
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-10-16 14:42:23 UTC
*** Bug 196049 has been marked as a duplicate of this bug. ***