Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34182 - dev-lisp/gcl-2.5.3 does not work with hardened-gcc
Summary: dev-lisp/gcl-2.5.3 does not work with hardened-gcc
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-23 06:27 UTC by Peter Simons
Modified: 2003-12-09 10:34 UTC (History)
0 users

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


Attachments
shows how emerge fails to build gcl with hardened-gcc (gcl-build-log,516.19 KB, text/plain)
2003-11-23 06:29 UTC, Peter Simons
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Simons 2003-11-23 06:27:41 UTC
When hardened-gcc is enabled, the produced gcl binary will not work. Thus, the
build fails at this point:

 | ./raw_gcl ./ -libdir /var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/ < foo
 | GCL (GNU Common Lisp)  April 1994  32768 pages
 | 
 | Unrecoverable error: Segmentation violation..
 | make[1]: *** [saved_gcl] Error 134

(I'll attach the complete build log, just in case.)

When building with hardened-gcc disabled, gcl builds fine.

Reproducible: Always
Steps to Reproduce:
1. hcc -a
2. emerge gcl
3. watch it fail




Portage 2.0.49-r15 (selinux-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.21-hardened)
=================================================================
System uname: 2.4.21-hardened i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.4.3.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon -O3 -fomit-frame-pointer -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-mcpu=athlon -O3 -fomit-frame-pointer -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache autoaddcvs sfperms sandbox userpriv notitles strict"
GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo
http://ftp.snt.utwente.nl/pub/os/linux/gentoo
ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://gentoo.inode.at/source/
http://gentoo.inode.at/"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="x86 crypt ncurses selinux zlib gdbm berkdb readline guile pam libwww ssl
perl opengl mozilla altcolors curl dga doc dvd emacs ethereal leim mbox
moznocompose moznoirc moznomail moznoxft rage128 Xaw3d -arts -cups -gpm -java
-kde -motif -nls -qt -svga -xmms -tcpd -python -esd spell -slang X png gtk gif
tiff mmx xml xml2 truetype oss tetex jpeg avi oggvobis encode python plotutils
pdflib"
Comment 1 Peter Simons 2003-11-23 06:29:06 UTC
Created attachment 21139 [details]
shows how emerge fails to build gcl with hardened-gcc
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2003-11-23 09:16:31 UTC
common-lisp@gentoo.org isn't valid.
Comment 3 Matthew Kennedy (RETIRED) gentoo-dev 2003-11-24 09:02:36 UTC
this is best assigned to the gentoo-hardened team
Comment 4 Alexander Gabert (RETIRED) gentoo-dev 2003-11-24 13:20:12 UTC
can you try hardened-gcc -a and edit the ebuild to resemble CC="gcc -yet_exec -yno_propolice" or CFLAGS="-yet_exec -yno_propolice" for lisp to be built?

TIA,

Alex
Comment 5 Alexander Gabert (RETIRED) gentoo-dev 2003-12-01 15:29:49 UTC
screen fun here too
cp ../o/gcllib.a libgclp.a
cp init_gcl.lsp.in init_gcl.lsp.tmp
cat init_gcl.lsp.tmp | sed \
        -e "s,@LI-VERS@,(`cat ../majvers`.`cat ../minvers`) `date`,1" \
        -e "s,@LI-MINVERS@,`cat ../minvers`,1" \
        -e "s,@LI-MAJVERS@,`cat ../majvers`,1" \
        -e "s,@LI-CC@,\"gcc -c -Wall -DVOL=volatile -fsigned-char -fwritable-strings -pipe\",1" \
        -e "s,@LI-LD@,\"gcc -o \",1" \
        -e "s,@LI-LD-LIBS@,\" -lgcl -lm  /var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/binutils/bfd/libbfd.a /var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/binutils/libiberty/libiberty.a -lreadline -lncurses -lc -lgclp\",1" \
        -e "s,@LI-OPT-THREE@,\"-O6 -fomit-frame-pointer\",1" \
        -e "s,@LI-OPT-TWO@,\"-O\",1" \
        -e "s,@LI-INIT-LSP@,\"init_gcl.lsp\",1" >init_gcl.lsp
cp ../lsp/auto.lsp ../lsp/auto_new.lsp
[ "readline.o" = "" ] || \
        echo "(AUTOLOAD 'init-readline '|readline|)" >>../lsp/auto_new.lsp
gcc -o raw_gcl  \
        -L.   -lgcl -lm  /var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/binutils/bfd/libbfd.a /var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/binutils/libiberty/libiberty.a -lreadline -lncurses -lc -lgclp
cp init_gcl.lsp foo
echo " (in-package \"USER\")(system:save-system \"saved_gcl\")" >>foo
./raw_gcl ./ -libdir /var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/ < foo
GCL (GNU Common Lisp)  April 1994  32768 pages

Unrecoverable error: NULL_OR_ON_C_STACK macro invalid.
make[1]: *** [saved_gcl] Error 134
rm init_gcl.lsp.tmp raw_gcl
make[1]: Leaving directory `/var/tmp/portage/gcl-2.5.3/work/gcl-2.5.3/unixport'
make: *** [unixport/saved_gcl] Error 2

!!! ERROR: dev-lisp/gcl-2.5.3 failed.
!!! Function src_compile, Line 41, Exitcode 2
!!! (no error message)

i think this ebuild qualifies for gcc -yet_exec -yno_propolice just like the haskell compiler did some weeks ago - you knever know ;-)

i will edit the corresponding ebuilds when cvs is back in the game,

cya,

Alex
Comment 6 Alexander Gabert (RETIRED) gentoo-dev 2003-12-01 15:30:45 UTC
in the meantime you may try this one:
00:26:58 [/usr/local/chroots/chroot001:3254.pty-s4.epoch] epoch ~ # CC="${CC:=gcc} -yet_exec -yno_propolice" emerge -v gcl
Comment 7 Peter Simons 2003-12-02 08:05:28 UTC
I have talked to the GCL developers about this, and this is a known problem:

Camm Maguire <camm@enhanced.com> wrote:

 > While I do not have time right now to search for a solution myself,
 > if you can discover a simple one and explain it clearly to me, I'll
 > try to get it into GCL.

I managed to compile GCL manually, but it was really ugly, because the intermediate compiler needs to be chpax'ed in order for the build to succeed. I really have no idea how to turn that into an ebuild. Sorry.
Comment 8 Alexander Gabert (RETIRED) gentoo-dev 2003-12-09 10:34:34 UTC
>>> original instance of package unmerged safely.
>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...                                                                                            [ ok ]
>>> dev-lisp/gcl-2.5.3 merged.

>>> clean: No packages selected for removal.

>>> Regenerating /etc/ld.so.cache...
 * Caching service dependencies...                                                                                            [ ok ]
>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * Regenerating GNU info directory index...
 * Processed 77 info files.

19:32:28 [/usr/local/chroots/chroot001:5925.pty-s0.epoch] epoch ~ # hcc -l
 glibc: GNU C Library stable release version 2.3.2, by Roland McGrath et al.
 glibc: Compiled by GNU CC version 3.3.2 20031022 (Gentoo Linux 3.3.2-r3, propolice).
   gcc: gcc version 3.3.2 20031022 (Gentoo Linux 3.3.2-r3, propolice)
    ld: GNU ld version 2.14.90.0.7 20031029

config: hcc-3.3.2.0-x86  -  /etc/hcc.conf
*cpp:
%{posix:-D_POSIX_SOURCE} %{!D__KERNEL__: %{!DIN_GCC: %{!static: %{!nostartfiles: %{!nodefaultlibs: %{!nostdlib: %{!nostdinc: %{pie|yet_dyn: %{!nopie: %{!yet_exec: -D__PIC__ -D__pic__ -DPIC -Dpic}}} } } } } } } } %{pthread:-D_REENTRANT}
--
*cc1:
%(cc1_cpu) %{!D__KERNEL__: %{!DIN_GCC: %{!static: %{!nostartfiles: %{!nodefaultlibs: %{!nostdlib: %{!nostdinc: %{pie|yet_dyn: %{!nopie: %{!yet_exec: -fPIC -fpie}}} %{fstack-protector|fstack-protector-all: -fforce-addr} } } } } } } } %{profile:-p}
--
*endfile:
%{static|yet_exec|D__KERNEL__|DIN_GCC: crtend.o%s} %{!static: %{!yet_exec: %{!D__KERNEL__: %{!DIN_GCC: crtendS.o%s}}}} crtn.o%s
--
*link:
%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static}}} %{!D__KERNEL__: %{!DIN_GCC: %{!static: %{!nostartfiles: %{!nodefaultlibs: %{!nostdlib: %{!nostdinc: %{!shared: %{!Bshareable: %{!i: %{!r: %{pie|yet_dyn: %{!nopie: %{!yet_exec: -pie -z combreloc}}} } } } } } } } } } } }
--
*startfile:
%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:%{profile:gcrt1.o%s} %{!profile: %{static|yet_exec|D__KERNEL__|DIN_GCC: crt1.o%s} %{!static: %{!yet_exec: %{!D__KERNEL__: %{!DIN_GCC: Scrt1.o%s}}}} }}}} crti.o%s %{static:crtbeginT.o%s} %{!static: %{yet_exec|D__KERNEL__|DIN_GCC: crtbegin.o%s} %{!yet_exec: %{!D__KERNEL__: %{!DIN_GCC: crtbeginS.o%s}}} }


works here, can you report back?