Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132992 - dev-lisp/sbcl does not like --as-needed flag
Summary: dev-lisp/sbcl does not like --as-needed flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Common Lisp Bugs
URL:
Whiteboard:
Keywords:
Depends on: 326217
Blocks: as-needed
  Show dependency tree
 
Reported: 2006-05-11 03:27 UTC by Renato Crisóstomo
Modified: 2010-06-29 20:26 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Renato Crisóstomo 2006-05-11 03:27:22 UTC
Compilation with LDFLAGS="-Wl,--as-needed" goes fine, but displays errors when register-common-lisp-implementation is run.

SBCL also presents broken runtime behavior, like not finding internal packages such as SB-POSIX.

I think the best solution is to filter the flag in the ebuild.
Comment 1 Matthew Kennedy (RETIRED) gentoo-dev 2006-05-11 08:59:10 UTC
Thanks for the bug report.  I made the following change.  Please emerge --sync and check that it works for you.

Index: sbcl-0.9.12.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lisp/sbcl/sbcl-0.9.12.ebuild,v
retrieving revision 1.2
diff -u -r1.2 sbcl-0.9.12.ebuild
--- sbcl-0.9.12.ebuild  29 Apr 2006 05:55:34 -0000      1.2
+++ sbcl-0.9.12.ebuild  11 May 2006 15:55:07 -0000
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/dev-lisp/sbcl/sbcl-0.9.12.ebuild,v 1.2 2006/04/29 05:55:34 mkennedy Exp $

-inherit common-lisp-common-2 eutils
+inherit common-lisp-common-2 eutils flag-o-matic

 BV_X86=0.9.8
 BV_PPC=0.8.15
@@ -128,6 +128,8 @@
 src_compile() {
        local bindir="${WORKDIR}/sbcl-binary"

+       filter-ldflags -Wl,--as-needed --as-needed # see Bug #132992
+
        LANG=C PATH=${bindir}/src/runtime:${PATH} SBCL_HOME=${bindir}/output GNUMAKE=make \
                ./make.sh 'sbcl
                        --sysinit /dev/null
Comment 2 Jory A. Pratt 2006-05-11 16:52:15 UTC
This is not the answer, the problem does not exist on amd64 and sbcl is fine with  --as-needed, please revert the changes until such time emerge info is posted.
Comment 3 Jory A. Pratt 2006-05-11 16:54:11 UTC
(In reply to comment #0)
> Compilation with LDFLAGS="-Wl,--as-needed" goes fine, but displays errors when
> register-common-lisp-implementation is run.
> 
> SBCL also presents broken runtime behavior, like not finding internal packages
> such as SB-POSIX.
> 
> I think the best solution is to filter the flag in the ebuild.
> 

Please post your emerge info and a build log.

Comment 4 Renato Crisóstomo 2006-05-12 14:11:10 UTC
I re-emerged the unpatched version. Relevant output:

--- !empty dir /usr/lib/common-lisp/sbcl
--- !empty dir /usr/lib/common-lisp/bin
--- !empty dir /usr/lib/common-lisp
--- !empty dir /usr/lib
--- !empty dir /usr/bin
--- !empty dir /usr
--- !empty dir /etc
>>> Original instance of package unmerged safely.
/usr/lib/common-lisp/bin/sbcl.sh loading and dumping clc.
; in: LAMBDA NIL
;     (SB-KERNEL:FLOAT-WAIT)
;
; note: deleting unreachable code
;
; compilation unit finished
;   printed 1 note
; in: LAMBDA NIL
;     (SB-KERNEL:FLOAT-WAIT)
;
; note: deleting unreachable code
;
; compilation unit finished
;   printed 1 note
STYLE-WARNING: redefining INIT-COMMON-LISP-CONTROLLER-V5 in DEFUN
STYLE-WARNING: redefining COMPILE-COMMON-LISP-CONTROLLER-V5 in DEFUN
STYLE-WARNING: redefining INIT-COMMON-LISP-CONTROLLER-V4 in DEFUN
STYLE-WARNING: redefining INIT-COMMON-LISP-CONTROLLER in DEFUN
; loading system definition from /usr/lib/sbcl/sb-grovel/sb-grovel.asd into
; #<PACKAGE "ASDF1">
; registering #<SYSTEM SB-GROVEL {AA0EC21}> as SB-GROVEL
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions

Error running init-common-lisp-controller-v4: Undefined alien: "chdir"
mv: cannot stat `sbcl-new.core': No such file or directory
FAILED
>>> Regenerating /etc/ld.so.cache...
>>> dev-lisp/sbcl-0.9.12 merged.

>>> No packages selected for removal by clean.

>>> Auto-cleaning packages...

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


 * GNU info directory index is up-to-date.


My "emerge --info" output:

# emerge --info
Portage 2.1_pre10-r5 (default-linux/x86/2005.1, gcc-3.4.6, glibc-2.4-r2, 2.6.16-ck9 i686)
=================================================================
System uname: 2.6.16-ck9 i686 Intel(R) Pentium(R) M processor 1500MHz
Gentoo Base System version 1.12.0_pre19
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.rnl.ist.utl.pt/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
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'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/gentopia /usr/local/overlay"
SYNC="rsync://ftp.rnl.ist.utl.pt/gentoo-portage"
USE="x86 X a52 aac acpi alsa avahi avi berkdb bitmap-fonts bzip2 cairo cdr cli crypt dbus dri dvd dvdr emboss firefox foomaticdb fortran gdbm gif gnome gstreamer gtk gtk2 hal imlib isdnlog java jpeg kerberos libg++ libwww mad mmx mp3 mpeg ncurses nls nptl ogg oggvorbis opengl pcre pdf pdflib perl png pppd python quicktime readline reflection samba sdl session spell spl sse sse2 ssl svg theora truetype truetype-fonts type1-fonts unicode vorbis xml2 xorg xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_synaptics kernel_linux userland_GNU video_cards_nvidia video_cards_vesa"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 5 Matthew Kennedy (RETIRED) gentoo-dev 2006-05-12 23:17:37 UTC
Is really worth the effort?  From http://www.gentoo.org/proj/en/qa/asneeded.xml:

  "The flag tells the linker to link in the produced binary only the libraries 
  containing symbols actually used by the binary itself. ...
  allows the linker to avoid linking extra libraries in a binary. This not only 
  improves startup times"

The SBCL runtime links to glibc and thats it.

~$ ldd /usr/bin/sbcl 
        linux-gate.so.1 =>  (0xffffe000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7fd4000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7fc0000)
        libm.so.6 => /lib/libm.so.6 (0xb7f9c000)
        libc.so.6 => /lib/libc.so.6 (0xb7e80000)
        /lib/ld-linux.so.2 (0xb7fe7000)

Its not like you're loading some gnome app which pulls in several dozen deps.  If you want to keep this bug open, please reassign it to something not common-lisp@gentoo.org.
Comment 6 Marijn Schouten (RETIRED) gentoo-dev 2007-06-20 16:53:19 UTC
0.9.12 is not in the tree anymore. Reopen if issue persists for other versions 1.0.4 and up.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-16 16:29:51 UTC
This is NOT FIXED since it's worked around in tree.
Comment 8 Marijn Schouten (RETIRED) gentoo-dev 2009-03-11 14:22:53 UTC
Stelian has said that he will look into this.
Comment 9 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-03-27 08:45:26 UTC
I bumped sbcl recently to 1.0.36-r1. I removed in the new ebuild the --as-needed filtering, and it seems that sbcl is compiled and works flawlessly. As soon as the new ebuild(s) reach stable, I will close this bug. In the meantime, if someone wants to test it and report here, please do not hesitate.
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2010-06-29 20:26:07 UTC
(In reply to comment #9)
> I bumped sbcl recently to 1.0.36-r1. I removed in the new ebuild the
> --as-needed filtering, and it seems that sbcl is compiled and works flawlessly.
> As soon as the new ebuild(s) reach stable, I will close this bug. In the
> meantime, if someone wants to test it and report here, please do not hesitate.
> 

Bug 326217.