Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73611 - hugs98 compiles on ppc (with a little loving)
Summary: hugs98 compiles on ppc (with a little loving)
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: PPC All
: High normal (vote)
Assignee: PPC Porters
Depends on:
Reported: 2004-12-06 18:34 UTC by Keri Harris
Modified: 2004-12-08 16:47 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description Keri Harris gentoo-dev 2004-12-06 18:34:26 UTC
Hugs98-2003.11 compiles correctly on ppc if optimizations are ignored when compiling the typechecking and compilation parts of hugs. -Ox in CFLAGS when compiling these parts of hugs will cause an INTERNAL ERROR: importEntity due to gcc's garbage collection. (Modules associated with the bytecode interpreter part of hugs are unaffected.)

Fortunately the upstream devs are aware of this as src/unix/ explains:

 .c@OBJ@ :
     $(CC) -c $(CFLAGS) $(OPTFLAGS) $<

 # Modules to be compiled without optimization.
 # (old comment: to avoid optimisation bugs in certain compilers.
 #               This may be overly conservative on some compilers.)
 # (The following explanation is based on a posting by Alastair Reid.)
 # These modules allocate cells on the Hugs heap and assume a conservative
 # garbage collector.  On some (especially RISC) architectures, the
 # optimizer may identify a pointer to a Cell as a common subexpression,
 # and hold that instead of the Cell.  This would then be missed by the
 # conservative garbage collector's simplistic scan of the C stack.
 # Modules associated with evaluation are safe because they don't assume
 # conservative GC (see IMPORTANT NOTICE in builtin.c).
 compiler@OBJ@ : compiler.c
     $(CC) -c $(CFLAGS) compiler.c
 module@OBJ@ : module.c
     $(CC) -c $(CFLAGS) module.c
 subst@OBJ@ : subst.c
     $(CC) -c $(CFLAGS) subst.c
 static@OBJ@ : static.c
     $(CC) -c $(CFLAGS) static.c
 type@OBJ@ : type.c
     $(CC) -c $(CFLAGS) type.c

Stripping -Ox from CFLAGS and using OPTFLAGS (which is set to -O2 in configure) allows successful compilation on ppc.

Gentoo Base System version 1.4.16
Portage 2.0.51-r3 (default-ppc-2004.2, gcc-3.4.1, glibc-, 2.6.9-gentoo-r1 ppc)
System uname: 2.6.9-gentoo-r1 ppc 7447A, altivec supported
ccache version 2.2 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-
Headers:  sys-kernel/linux26-headers-
Libtools: sys-devel/libtool-1.5.2-r7
CFLAGS="-mcpu=G4 -O2 -pipe -fomit-frame-pointer -maltivec -mabi=altivec"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /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="-mcpu=G4 -O2 -pipe -fomit-frame-pointer -maltivec -mabi=altivec"
FEATURES="autoaddcvs ccache distlocks"
USE="X alsa altivec arts berkdb cdparanoia cdr crypt cups doc dvd encode f77 foomaticdb fortran gdbm gif gimpprint gtk gtk2 imlib java jpeg kde libwww mpeg ncurses noantlr nobcel nobeanutils nobsh nocommonslogging nocommonsnet nojdepend nojoystick nojsch nojython nolog4j nooro noregexp norhino noxalan noxerces nptl oggvorbis opengl oss pam perl png ppc ppds python qt quicktime readline sdk sdl slang spell ssl tcpd tetex tiff truetype xml2 xmms xv zlib"
Comment 1 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2004-12-08 12:31:00 UTC
I've compiled hugs98 with your CFLAGS/CXXFLAGS using gcc 3.4.3 and I don't see, where your problem is. Could you please try with gcc 3.4.3 or tell us, what the exact problem is?
Comment 2 Keri Harris gentoo-dev 2004-12-08 16:47:59 UTC
Stripping -Ox works nicely. Closing.