Bug 131841 - sys-apps/parted: fix for --as-needed compilation
Bug#: 131841 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: allanonjl@gentoo.org Reported By: tom.gl@free.fr
Component: Core system
URL: 
Summary: sys-apps/parted: fix for --as-needed compilation
Keywords:  
Status Whiteboard: 
Opened: 2006-04-30 17:05 0000
Description:   Opened: 2006-04-30 17:05 0000
Parted fails to build with -Wl,--as-needed because of some unresolved symbols
in libparted. This patch makes it links against libdl to solve that. As a side
effect, it also makes qtparted compiles fine.

------- Comment #1 From TGL 2006-04-30 17:05:31 0000 -------
Created an attachment (id=85878) [details]
files/parted-1.6.25-as-needed.patch

------- Comment #2 From TGL 2006-04-30 17:06:03 0000 -------
Created an attachment (id=85879) [details]
parted-1.6.25-ebuild.patch

patch for the ebuild

------- Comment #3 From Lance Lucas 2006-05-06 02:49:09 0000 -------
works great here, also allows gparted to compile.

Gentoo Base System version 1.12.0_pre19
Portage 2.1_pre10-r3 (default-linux/amd64/2006.0, gcc-4.1.0, glibc-2.4-r2,
2.6.16-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.16-gentoo-r6 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor
3800+
ccache version 2.4 [enabled]
dev-lang/python:     2.4.3-r1
dev-util/ccache:     2.4-r1
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18
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, 2.16.92
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=athlon64 -pipe -fomit-frame-pointer -funroll-all-loops
-fpeel-loops -ftracer -funswitch-loops -funit-at-a-time -ffast-math -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env
/usr/kde/3.5/share/config /usr/kde/3.5/shutdown /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/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org"
LDFLAGS="-Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/as-needed-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac aalib acpi aim alsa artworkextra audiofile avi
bash-completion berkdb bitmap-fonts browserplugin bzip2 cairo caps cd cddb
cdparanoia cdr chroot clamav cli crypt css cups curl dbus divx4linux dv dvd
dvdr dvdread eds emboss encode esd evo exif fame ffmpeg firefox flac flash
foomaticdb fortran gd gdbm gif glitz gmp gnome gphoto2 gpm gs gstreamer gtk
gtk2 gtkhtml hal ieee1394 imagemagick imap imlib isdnlog java javascript jikes
joystick jpeg jpeg2k lcms ldap libcaca live logrotate lzo lzw lzw-tiff mad
maildir mbox memlimit mikmod mmap mng mono motif moznocompose moznoirc
moznomail moznosvg mozsvg mp3 mpeg musepack musicbrainz nautilus ncurses
network nls nptl nptlonly nsplugin nvidia offensive ogg oggvorbis openexr
opengl oss pam pcre pdf pdflib perl php pic png posix ppds pppd python qt
quicktime readline reflection sdl session smp sndfile speex spell spl sqlite
ssl svg tcltk tcpd theora threads tiff truetype truetype-fonts type1-fonts
unicode usb vcd videos vorbis wmf wxwindows xine xml xml2 xmms xorg xpm xv xvid
xvmc zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux
linguas_en userland_GNU video_cards_nvidia"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL

------- Comment #4 From Lance Lucas 2006-05-06 02:52:48 0000 -------
(In reply to comment #3)

> CXXFLAGS="-O2 -pipe"

apologies for double message, forgot i was futzing with make.conf at the time
:)  at compile time,  CXXFLAGS="${CFLAGS}"

------- Comment #5 From TGL 2006-05-14 06:14:23 0000 -------
Patch (rediffed for trunk) sent upstream (bug-partedATgnuDOTorg).

------- Comment #6 From John N. Laliberte (RETIRED) 2006-05-20 05:26:28 0000 -------
can you guys try parted 1.7.0 ?

just went in the tree and i have no issues with as-needed with that version.

thanks.

------- Comment #7 From TGL 2006-05-21 11:43:18 0000 -------
(In reply to comment #6)
> can you guys try parted 1.7.0 ?
> 
> just went in the tree and i have no issues with as-needed with that version.
> 
> thanks.
> 

I still get this (same as with 1.6.25):

make[2]: Entering directory
`/var/tmp/portage/parted-1.7.0/work/parted-1.7.0/partprobe'
if i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    
-march=pentium-m -O2 -pipe -ggdb -D_REENTRANT -D_FILE_OFFSET_BITS=64
-DLOCALEDIR="\"/usr/share/locale\"" -DLOCALEDIR="\"/usr/share/locale\"" -W
-Wall -Wno-unused -Wno-switch -Wno-format -MT partprobe.o -MD -MP -MF
".deps/partprobe.Tpo" -c -o partprobe.o partprobe.c; \
        then mv -f ".deps/partprobe.Tpo" ".deps/partprobe.Po"; else rm -f
".deps/partprobe.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link i686-pc-linux-gnu-gcc  -march=pentium-m
-O2 -pipe -ggdb -D_REENTRANT -D_FILE_OFFSET_BITS=64
-DLOCALEDIR="\"/usr/share/locale\"" -DLOCALEDIR="\"/usr/share/locale\"" -W
-Wall -Wno-unused -Wno-switch -Wno-format  -Wl,-O1 -Wl,--as-needed
-Wl,--sort-common -o partprobe  partprobe.o ../libparted/libparted.la
-lreadline  -ldl -lncurses
mkdir .libs
i686-pc-linux-gnu-gcc -march=pentium-m -O2 -pipe -ggdb -D_REENTRANT
-D_FILE_OFFSET_BITS=64 -DLOCALEDIR=\"/usr/share/locale\"
-DLOCALEDIR=\"/usr/share/locale\" -W -Wall -Wno-unused -Wno-switch -Wno-format
-Wl,-O1 -Wl,--as-needed -Wl,--sort-common -o .libs/partprobe partprobe.o 
../libparted/.libs/libparted.so -luuid -lreadline -ldl -lncurses
../libparted/.libs/libparted.so: undefined reference to `dlerror'
../libparted/.libs/libparted.so: undefined reference to `dlclose'
../libparted/.libs/libparted.so: undefined reference to `dlopen'
../libparted/.libs/libparted.so: undefined reference to `dlsym'
collect2: ld returned 1 exit status
make[2]: *** [partprobe] Error 1
make[2]: Leaving directory
`/var/tmp/portage/parted-1.7.0/work/parted-1.7.0/partprobe'

I will attach a rediffed patch.

------- Comment #8 From TGL 2006-05-21 11:43:58 0000 -------
Created an attachment (id=87204) [details]
files/parted-1.7.0-as-needed.patch

------- Comment #9 From TGL 2006-05-21 11:44:44 0000 -------
Created an attachment (id=87205) [details]
parted-1.7.0-ebuild.patch

------- Comment #10 From Lance Lucas 2006-05-24 18:55:11 0000 -------
(In reply to comment #6)
> can you guys try parted 1.7.0 ?
> 
> just went in the tree and i have no issues with as-needed with that version.
> 
> thanks.

tree version is broken for me (w/same errors as TGL); 1.7.0 using TGL's patch
allows parted to compile cleanly.  i have not done much testing of the actual
binaries though.  using binutils-2.6.93 and gcc-4.1.1 prelease (from portage).

------- Comment #11 From Lance Lucas 2006-05-24 18:56:45 0000 -------
Created an attachment (id=87448) [details]
emerge --info

------- Comment #12 From John N. Laliberte (RETIRED) 2006-05-30 11:40:07 0000 -------
thanks, looks like patch was applied in 1.7.1.

in cvs.