Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73239 - procps fails to build on pcc with gcc-3.4.3
Summary: procps fails to build on pcc with gcc-3.4.3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: High major
Assignee: PPC Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-03 09:51 UTC by Armando Di Cianno (RETIRED)
Modified: 2005-01-06 11:18 UTC (History)
0 users

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


Attachments
Allows build to complete on ppc (ppc-make.patch,430 bytes, patch)
2004-12-03 10:09 UTC, Armando Di Cianno (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Armando Di Cianno (RETIRED) gentoo-dev 2004-12-03 09:51:55 UTC
I did a world rebuild the other day, and the only package that failed to build (and continues to fail to build) is procps.

Reproducible: Always
Steps to Reproduce:
1. emerge any rev of gcc-3.4.3
2. emerge procps
3. watch it fail

Actual Results:  
nephiliah root # emerge procps
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/procps-3.2.3-r1 to /
>>> md5 src_uri ;-) procps-3.2.3.tar.gz
>>> Unpacking source...
>>> Unpacking procps-3.2.3.tar.gz to /var/tmp/portage/procps-3.2.3-r1/work
>>> Source unpacked.
gcc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -MM -MG proc/alloc.c
proc/devname.c proc/escape.c proc/ksym.c proc/pwcache.c proc/readproc.c
proc/sig.c proc/slab.c proc/status.c proc/sysinfo.c proc/version.c
proc/whattime.c > proc/.depend
gcc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W
-Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual
-Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O1
-pipe
-mcpu=G4 -mabi=altivec -malign-natural -ftracer -fsched-spec -fstrength-reduce
-frerun-loop-opt -falign-loops -fpeel-loops -fno-delayed-branch -fschedule-insns
-freduce-all-givs -fcse-follow-jumps -fexpensive-optimizations
-Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -frename-registers
-fomit-frame-pointer
-fno-inline-functions -m64 -c -o uptime.o uptime.c
gcc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W
-Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual
-Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O1
-pipe -mcpu=G4 -mabi=altivec -malign-natural -ftracer -fsched-spec
-fstrength-reduce -frerun-loop-opt -falign-loops -fpeel-loops
-fno-delayed-branch -fschedule-insns -freduce-all-givs -fcse-follow-jumps
-fexpensive-optimizations -Wdeclaration-after-statement -Wpadded
-Wstrict-aliasing -frename-registers -fomit-frame-pointer -fno-inline-functions
-m64 -DSHARED=1 -fpic proc/alloc.c -o proc/alloc.o
gcc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W
-Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual
-Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O1
-pipe -mcpu=G4 -mabi=altivec -malign-natural -ftracer -fsched-spec
-fstrength-reduce -frerun-loop-opt -falign-loops -fpeel-loops
-fno-delayed-branch -fschedule-insns -freduce-all-givs -fcse-follow-jumps
-fexpensive-optimizations -Wdeclaration-after-statement -Wpadded
-Wstrict-aliasing -frename-registers -fomit-frame-pointer -fno-inline-functions
-m64 -DSHARED=1 -fpic proc/devname.c -o proc/devname.o
proc/alloc.c: In function `xcalloc':
proc/alloc.c:21: internal compiler error: in print_operand_address, at
config/rs6000/rs6000.c:9678
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
{standard input}: Assembler messages:
{standard input}:0: Warning: end of file not at end of a line; newline inserted
{standard input}:34: Error: syntax error; found `
proc/devname.c:52: warning: padding struct size to alignment boundary
Preprocessed source stored into
/var/tmp/portage/procps-3.2.3-r1/temp/cc3lgJYv.out file, please attach this to
your bugreport.
make: *** [proc/alloc.o] Error 1
make: *** Waiting for unfinished jobs....
proc/devname.c: In function `load_drivers':
proc/devname.c:107: internal compiler error: in print_operand_address, at
config/rs6000/rs6000.c:9678
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
{standard input}: Assembler messages:
{standard input}:0: Warning: end of file not at end of a line; newline inserted
{standard input}:40: Error: syntax error; found `
Preprocessed source stored into
/var/tmp/portage/procps-3.2.3-r1/temp/ccNl4YVP.out file, please attach this to
your bugreport.
make: *** [proc/devname.o] Error 1

!!! ERROR: sys-apps/procps-3.2.3-r1 failed.
!!! Function src_compile, Line 40, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.

Expected Results:  
The software should've actually built. :-)

I'm actually writing an article on CFLAGS on ppc at this very moment, so I'm
pretty sure it's not my CFLAGS. (Actually I'm very sure, 'cause even with
CFALGS="" this still fails).  But specifically, mine are:
---
CFLAGS="-O1 -pipe -mcpu=G4 -mabi=altivec -malign-natural -ftracer -fsched-spec
-fstrength-reduce -frerun-loop-opt -falign-loops -fpeel-loops
-fno-delayed-branch -fschedule-insns -freduce-all-givs -fcse-follow-jumps
-fexpensive-optimizations"
---
... this is only part of -O2 and -O3.

If you notice, the build adds in "-m64" for some reason.

Here is my current emerge info, but be aware I tried this with CFLAGS="" as
already stated, and gcc-3.4.3 and gcc-3.4.3-r1 (testing gcc-3.4.3-r1 atm, and,
as I said, _every_ other ebuild on the system built with it).
---Portage 2.0.51-r7 (default-linux/ppc/2004.3, gcc-3.4.3,
glibc-2.3.4.20041102-r0, 2.6.9-gentoo-r8-patches1 ppc)
=================================================================
System uname: 2.6.9-gentoo-r8-patches1 ppc 7447A, altivec supported
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.3 [2.3.3 (#1, Dec  1 2004, 23:32:43)]
dev-lang/python:     2.3.3
sys-devel/autoconf:  2.59-r5
sys-devel/automake:  1.8.5-r1
sys-devel/binutils:  2.15.90.0.3-r3
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.6.8.1-r1
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CFLAGS="-O1 -pipe -mcpu=G4 -mabi=altivec -malign-natural -ftracer -fsched-spec
-fstrength-reduce -frerun-loop-opt -falign-loops -fpeel-loops
-fno-delayed-branch -fschedule-insns -freduce-all-givs -fcse-follow-jumps
-fexpensive-optimizations"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O1 -pipe -mcpu=G4 -mabi=altivec -malign-natural -ftracer -fsched-spec
-fstrength-reduce -frerun-loop-opt -falign-loops -fpeel-loops
-fno-delayed-branch -fschedule-insns -freduce-all-givs -fcse-follow-jumps
-fexpensive-optimizations"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache cvs distlocks nostrip sandbox sfperms
userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/armando/Projects/GENTOO/gentoo-x86"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa altivec berkdb bitmap-fonts cdr cups dvd f77 flac fortran gdbm
gif gnustep gpm gstreamer gtk gtk2 guile imagemagick imlib ipv6 jack jpeg
kerberos ldap libwww mad mysql ncurses nptl nptlonly oggvorbis opengl oss pam pdflib
perl png postgres ppc python readline samba snmp speex sqlite ssl tetex tiff
truetype unicode xml xml2 zlib"
---

Marking the bug a "Major" only 'cause this is procps we're talking about -- it
shouldn't be failing!
Comment 1 Armando Di Cianno (RETIRED) gentoo-dev 2004-12-03 10:09:27 UTC
Created attachment 45214 [details, diff]
Allows build to complete on ppc

The procps Makefile is broken.	This simple patch cures the symptoms (build
failing) but not the bug (Makefile being broken).
Comment 2 Armando Di Cianno (RETIRED) gentoo-dev 2004-12-03 10:11:30 UTC
This is the code that failing:
--snip--
check_gcc = $(shell if $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) dummy.c $(ALL_LDFLAGS) $(1) -o /dev/null $(CURSES) > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
--snip--
... and then,
--snip--
m64 := $(call check_gcc,-m64,)
ALL_CFLAGS += $(m64)
--snip--

This may not even be particular to gcc-3.4.3, but possibly a kernel version, bash version, etceteras.
Comment 3 Armando Di Cianno (RETIRED) gentoo-dev 2004-12-03 10:26:02 UTC
Just for fun, let's exercise the "64-bit test" the Makefile uses, in a fresh untarred directory of the sources:

armando@nephiliah procps-3.2.3 $ for i in `ls -1 --color=never *.c`; do if gcc $i -m64 -o /dev/null > /dev/null 2>&1; then echo "$i: true"; else echo "$i: false"; fi; done
dummy.c: true
free.c: false
minimal.c: true
pgrep.c: false
pmap.c: false
skill.c: false
slabtop.c: false
sysctl.c: false
tload.c: false
top.c: false
uptime.c: false
vmstat.c: false
w.c: false
watch.c: false

... so that's 2 false positives out of 14, and one of the false positives is supposed to be the test for all this to begin with!

*sigh* I really don't know why I find this bug so damned annoying and yet amusing.
Comment 4 Armando Di Cianno (RETIRED) gentoo-dev 2004-12-04 15:44:34 UTC
procps-3.2.4 has a fix in the ebuild for this already, but procps-3.2.3-r1 is still marked as stable for ppc, and 3.2.4 is not
Comment 5 Daniel Black (RETIRED) gentoo-dev 2004-12-08 06:14:55 UTC
procps-3.2.4 marked ppc stable.
Comment 6 Albert Cahalan 2005-01-06 11:18:23 UTC
The Makefile code is derived from code found in the
kernel Makefile. It had better work.

It's interesting that your gcc randomly accepts options
that don't work.

With gcc on a non-Gentoo box, you'd get a reproducable
message sent to stderr and a proper exit code. Here is
the error message:

            cc1: invalid option `64'

I don't know how you ended up with a gcc that doesn't
bother to sanity check the command options, but you need
to get that fixed ASAP. The kernel Makefile relys on
very similar code.