Building make-3.81-r1 on PPC64 fails with: error: 'PAGE_SIZE' undeclared (first use in this function) The problem is created by one of the patches applied in Gentoo. Reproducible: Always
These are the last lines of the build log: if powerpc64-unknown-linux-gnu-gcc -DLOCALEDIR=\"/usr/share/locale\" -DLIBDIR=\"/usr/lib64\" -DINCLUDEDIR=\"/usr/include\" -DHAVE_CONFIG_H -I. -I. -I. -O2 -mcpu=970 -mtune=970 -fomit-frame-pointer -pipe -MT getopt.o -MD -MP -MF ".deps/getopt.Tpo" -c -o getopt.o getopt.c; \ then mv -f ".deps/getopt.Tpo" ".deps/getopt.Po"; else rm -f ".deps/getopt.Tpo"; exit 1; fi if powerpc64-unknown-linux-gnu-gcc -DLOCALEDIR=\"/usr/share/locale\" -DLIBDIR=\"/usr/lib64\" -DINCLUDEDIR=\"/usr/include\" -DHAVE_CONFIG_H -I. -I. -I. -O2 -mcpu=970 -mtune=970 -fomit-frame-pointer -pipe -MT getopt1.o -MD -MP -MF ".deps/getopt1.Tpo" -c -o getopt1.o getopt1.c; \ then mv -f ".deps/getopt1.Tpo" ".deps/getopt1.Po"; else rm -f ".deps/getopt1.Tpo"; exit 1; fi if powerpc64-unknown-linux-gnu-gcc -DLOCALEDIR=\"/usr/share/locale\" -DLIBDIR=\"/usr/lib64\" -DINCLUDEDIR=\"/usr/include\" -DHAVE_CONFIG_H -I. -I. -I. -O2 -mcpu=970 -mtune=970 -fomit-frame-pointer -pipe -MT implicit.o -MD -MP -MF ".deps/implicit.Tpo" -c -o implicit.o implicit.c; \ then mv -f ".deps/implicit.Tpo" ".deps/implicit.Po"; else rm -f ".deps/implicit.Tpo"; exit 1; fi if powerpc64-unknown-linux-gnu-gcc -DLOCALEDIR=\"/usr/share/locale\" -DLIBDIR=\"/usr/lib64\" -DINCLUDEDIR=\"/usr/include\" -DHAVE_CONFIG_H -I. -I. -I. -O2 -mcpu=970 -mtune=970 -fomit-frame-pointer -pipe -MT job.o -MD -MP -MF ".deps/job.Tpo" -c -o job.o job.c; \ then mv -f ".deps/job.Tpo" ".deps/job.Po"; else rm -f ".deps/job.Tpo"; exit 1; fi job.c: In function 'construct_command_argv_internal': job.c:2713: error: 'PAGE_SIZE' undeclared (first use in this function) job.c:2713: error: (Each undeclared identifier is reported only once job.c:2713: error: for each function it appears in.) make[2]: *** [job.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory `/var/tmp/portage/sys-devel/make-3.81-r1/work/make-3.81' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/sys-devel/make-3.81-r1/work/make-3.81' make: *** [all] Error 2 * ERROR: sys-devel/make-3.81-r1 failed: * (no error message) * * Call stack: * ebuild.sh, line 48: Called src_compile * environment, line 2576: Called die * The specific snippet of code: * emake || die * * If you need support, post the output of 'emerge --info =sys-devel/make-3.81-r1', * the complete build log and the output of 'emerge -pqv =sys-devel/make-3.81-r1'. * The complete build log is located at '/var/tmp/portage/sys-devel/make-3.81-r1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/make-3.81-r1/temp/environment'. * S: '/var/tmp/portage/sys-devel/make-3.81-r1/work/make-3.81' >>> Failed to emerge sys-devel/make-3.81-r1, Log file: >>> '/var/tmp/portage/sys-devel/make-3.81-r1/temp/build.log'
Portage 2.2_rc62 (default/linux/powerpc/ppc64/10.0/64bit-userland, gcc-4.4.3, glibc-2.11-r1, 2.6.32 ppc64) ================================================================= System uname: Linux-2.6.32-ppc64-PPC970,_altivec_supported-with-gentoo-2.0.1 Timestamp of tree: Sat, 13 Feb 2010 01:45:02 +0000 app-shells/bash: 4.0_p37 dev-java/java-config: 2.1.10 dev-lang/python: 2.6.4 dev-util/cmake: 2.8.0 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.6.0-r1 sys-apps/sandbox: 2.2 sys-devel/autoconf: 2.13, 2.65 sys-devel/automake: 1.6.3, 1.9.6-r2, 1.10.3, 1.11.1 sys-devel/binutils: 2.20 sys-devel/gcc: 4.4.3 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.30-r1 ACCEPT_KEYWORDS="ppc64 ~ppc64" ACCEPT_LICENSE="*" CBUILD="powerpc64-unknown-linux-gnu" CFLAGS="-O2 -mcpu=970 -mtune=970 -fomit-frame-pointer -pipe" CHOST="powerpc64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -mcpu=970 -mtune=970 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.tiscali.nl/ " LDFLAGS="-Wl,-O1" LINGUAS="en" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/layman/x11 /usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X aac acl akonadi alsa altivec avahi berkdb bzip2 cairo chm cleartype cli consolekit cracklib crypt cups curl cvs cxx dbus dirac djvu dri dvd ebook faad fam fftw firefox3 flac fontconfig fortran fuse gdbm gif git gmp gnutls gpm graphite graphviz gs gtk hal ibm iconv imagemagick inotify ipv6 java javascript jpeg jpeg2k kde kpathsea lapack lcms lzma matroska mdnsresponder-compat mng modules mozilla mp3 mpeg mplayer mpx mudflap mysql ncurses network nls nptl nptlonly nsplugin objc objc++ objc-gc ogg openexr opengl openmp openssl pam pcre pdf perl png policykit postscript ppc64 ppds pppd python qt3support qt4 readline reflection rtsp samba schroedinger sdl semantic-desktop session slang smp spell spl sql ssl subversion svg sysfs syslog tcpd theora threads tiff truetype unicode usb vcd vorbis webkit x264 xcb xcomposite xinerama xml xorg xrender xv xvid zeroconf zlib" 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 authn_alias authn_anon 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 deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif 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" LINGUAS="en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nouveau" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
I am pretty confident the problem is created by the patch: make-3.81-long-cmdline.patch In particular, look at the lines: +#if defined(__linux__) /* defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) */ +#include <sys/user.h> +#include <linux/binfmts.h> +#endif + and +#ifdef MAX_ARG_STRLEN + static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ "; +#define ARG_NUMBER_DIGITS 5 +#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \ + + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2)) +#else +#define EVAL_LEN 0 Snooping around in the interwebz, it seems like the PAGE_SIZE macro, used to define MAX_ARG_STRLEN, is not defined for all the architectures. I followed the advice given here: http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg228649.html and added #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) right after the inclusion of #include <linux/binfmts.h> in job.c Probably the proper way to do this is to test with an ifdef if the macro is defined before redefining it. Anyway, after this modification make-3.81 compiles fine.
*** This bug has been marked as a duplicate of bug 301431 ***