Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 248441 - dev-libs/bglibs linking dynamically fails
Summary: dev-libs/bglibs linking dynamically fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
: 281026 290833 300800 (view as bug list)
Depends on:
Blocks: 295728
  Show dependency tree
 
Reported: 2008-11-23 18:12 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2010-01-14 12:07 UTC (History)
4 users (show)

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


Attachments
Build log (bcron-0.09:20081123-175313.log,3.05 KB, text/plain)
2008-11-23 18:12 UTC, Diego Elio Pettenò (RETIRED)
Details
bglibs-1.106.ebuild (bglibs-1.106.ebuild,5.66 KB, text/plain)
2009-11-20 12:29 UTC, Thilo Bangert (RETIRED) (RETIRED)
Details
files/bglibs-1.106-parallel-fix.patch (bglibs-1.106-parallel-fix.patch,2.09 KB, text/plain)
2009-11-20 12:29 UTC, Thilo Bangert (RETIRED) (RETIRED)
Details
bglibs-1.106.ebuild (bglibs-1.106.ebuild,2.23 KB, text/plain)
2010-01-03 21:48 UTC, Thilo Bangert (RETIRED) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-23 18:12:36 UTC
Portage 2.2_rc14 (default/linux/x86/2008.0, gcc-4.1.2-asneeded, glibc-2.8_p20080602-r0, 2.6.27-gentoo-r2 i686)
=================================================================
System uname: Linux-2.6.27-gentoo-r2-i686-Quad-Core_AMD_Opteron-tm-_Processor_2350-with-glibc2.0
Timestamp of tree: Fri, 14 Nov 2008 00:37:01 +0000
distcc 3.0 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.4.4-r15, 2.5.2-r8
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r8
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.3.0-r1
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/glftpd/etc /opt/glftpd/ftp-data /opt/openfire/resources/security/ /opt/openjms/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind /var/lib/hsqldb /var/phxd /var/qmail/alias /var/qmail/control /var/spool/torque /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage-distfiles"
FEATURES="distlocks parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
INSTALL_MASK=" 	/usr/share/doc 	/usr/share/man 	/usr/share/info"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j14"
PKGDIR="/usr/portage-packages"
PORTAGE_COMPRESS=""
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups dri fortran gdbm gpm iconv ipv6 isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl sysfs tcpd unicode x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-23 18:12:47 UTC
Created attachment 173045 [details]
Build log
Comment 2 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2008-12-28 20:36:25 UTC
ok, just a small update here: you seem to be on bglibs-1.104 which started to install a shared library which seems to be preferred. the shared library is installed to /usr/lib/bglibs, which isnt in the library search path...

hhm, just add some symlinks from /usr/lib/libbg.so.1 to /usr/lib/bglibs/libbg.so ? robbat2?
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-12-28 20:38:05 UTC
Install an env.d file with an LDPATH=/usr/lib/$PN rather than doing symlink, imho.
Comment 4 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-02-02 23:46:41 UTC
works great here. do you want me to commit?

Index: bglibs-1.104.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-libs/bglibs/bglibs-1.104.ebuild,v
retrieving revision 1.2
diff -u -b -B -r1.2 bglibs-1.104.ebuild
--- bglibs-1.104.ebuild 7 Nov 2008 11:01:56 -0000       1.2
+++ bglibs-1.104.ebuild 2 Feb 2009 23:44:38 -0000
@@ -57,6 +57,9 @@
        dosym /usr/lib/bglibs /usr/lib/bglibs/lib
        dosym /usr/include/bglibs /usr/lib/bglibs/include

+       dodir /etc/env.d
+       echo "LDPATH=/usr/lib/${PN}" > ${D}/etc/env.d/99bglibs
+
        dodoc ANNOUNCEMENT NEWS README ChangeLog TODO VERSION
        dohtml doc/html/*
        docinto latex
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-02-02 23:56:06 UTC
It doesn't seem to me like the proper solution.

a) it does not work at the first install because the library cannot be found in the system and the library path;
b) why installing to a sub-directory if the libraries are added by default to the library path?
c) if the libraries are internal,almost certainyl what is wanted is rpath rather than setting the library path.
Comment 6 Peter Stuge 2009-10-28 02:15:32 UTC
bglibs are not really internal, please no rpath, I think installing in /usr/lib would be fine but there are a lot of files:

$ find /usr/lib/bglibs -type f|sort
/usr/lib/bglibs/crypt.lib
/usr/lib/bglibs/dl.lib
/usr/lib/bglibs/libbg-adt.a
/usr/lib/bglibs/libbg-base64.a
/usr/lib/bglibs/libbg-cdb.a
/usr/lib/bglibs/libbg-cli.a
/usr/lib/bglibs/libbg-crc.a
/usr/lib/bglibs/libbg-crypto.a
/usr/lib/bglibs/libbg-dict.a
/usr/lib/bglibs/libbg-fmt.a
/usr/lib/bglibs/libbg-installer.a
/usr/lib/bglibs/libbg-instcheck.a
/usr/lib/bglibs/libbg-instshow.a
/usr/lib/bglibs/libbg-iobuf.a
/usr/lib/bglibs/libbg-misc.a
/usr/lib/bglibs/libbg-msg.a
/usr/lib/bglibs/libbg-net.a
/usr/lib/bglibs/libbg-path.a
/usr/lib/bglibs/libbg-str.a
/usr/lib/bglibs/libbg-sysdeps.a
/usr/lib/bglibs/libbg-sysdeps.la
/usr/lib/bglibs/libbg-sysdeps.so.1.1.0
/usr/lib/bglibs/libbg-unix.a
/usr/lib/bglibs/libbg.a
/usr/lib/bglibs/libbg.la
/usr/lib/bglibs/libbg.so.1.1.0
/usr/lib/bglibs/libpwcmp-module.a
/usr/lib/bglibs/libpwcmp.a
/usr/lib/bglibs/libvmailmgr.a
/usr/lib/bglibs/m.lib
/usr/lib/bglibs/net.lib
/usr/lib/bglibs/rt.lib
/usr/lib/bglibs/s.lib
/usr/lib/bglibs/shadow.lib
/usr/lib/bglibs/socket.lib
Comment 7 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-11-20 12:29:26 UTC
Created attachment 210700 [details]
bglibs-1.106.ebuild

this is a version bump and a suggestion to fix the linking issue.

ChangeLog
   - version bump to 1.106
   - forward port patch (attached in a minute) - removes the dynamic static lib split
   - EAPI=2
   - install libs into /usr/lib
   - create symlinks from the old location
   - delete .la files

robbat2: could you check the dynamic/static split stuff.  as now there are only .la libraries left, the original fix no longer works. but is it still broken on prallell builds? works fine here (-j3)

there are some mystical .lib files which are installed into /usr/lib/ like
$ cat /usr/lib/dl.lib
-ldl
$

they could possibly just be removed as well?!
thanks for your feedback.

kind regards
Thilo



--- bglibs-1.104.ebuild 2009-09-25 14:12:22.000000000 +0200                                               
+++ bglibs-1.106.ebuild 2009-11-20 13:15:39.000000000 +0100                                               
@@ -2,6 +2,8 @@                                                                                           
 # Distributed under the terms of the GNU General Public License v2                                       
 # $Header: /var/cvsroot/gentoo-x86/dev-libs/bglibs/bglibs-1.104.ebuild,v 1.3 2009/09/23 17:16:03 patrick Exp $
                                                                                                               
+EAPI="2"                                                                                                      
+                                                                                                              
 inherit toolchain-funcs eutils multilib                                                                       
                                                                                                               
 DESCRIPTION="Bruce Guenters Libraries Collection"                                                             
@@ -14,9 +16,8 @@                                                                                              
 IUSE=""                                                                                                       
 DEPEND=""                                                                                                     
                                                                                                               
-src_unpack() {                                                                                                
-       unpack ${A}                                                                                            
-       epatch "${FILESDIR}"/bglibs-1.104-parallel-fix.patch                                                   
+src_prepare() {                                                                                               
+       epatch "${FILESDIR}"/${PN}-1.106-parallel-fix.patch                                                    
        # disable tests as we want them manually                                                               
        sed -i \                                                                                               
                -e '/^all:/s|selftests||' \                                                                    
@@ -34,14 +35,11 @@                                                                                            
                                                                                                               
 src_compile() {                                                                                               
        echo "${D}/usr/bin" > conf-bin                                                                         
-       echo "${D}/usr/$(get_libdir)/bglibs" > conf-lib                                                        
+       echo "${D}/usr/$(get_libdir)" > conf-lib                                                               
        echo "${D}/usr/include/bglibs" > conf-include                                                          
        echo "${D}/usr/share/man" > conf-man                                                                   
        echo "$(tc-getCC) ${CFLAGS}" > conf-cc                                                                 
        echo "$(tc-getCC) ${LDFLAGS}" > conf-ld                                                                
-       # Fails if we do parallel build of shared+static at the same time                                      
-       emake libs-shared || die                                                                               
-       emake libs-static || die                                                                               
        emake || die                                                                                           
 }                                                                                                             
                                                                                                               
@@ -57,8 +55,83 @@                                                                                             
        dosym /usr/lib/bglibs /usr/lib/bglibs/lib                                                              
        dosym /usr/include/bglibs /usr/lib/bglibs/include                                                      
                                                                                                               
+       #make backwards compatible symlinks                                                                    
+       dosym /usr/lib/libbg-base64.a /usr/lib/bglibs/base64/base64.a                                          
+       dosym /usr/lib/libbg-cdb.a /usr/lib/bglibs/cdb/cdb.a                                                   
+       dosym /usr/lib/libbg-cdb.a /usr/lib/bglibs/cdb/make.a                                                  
+       dosym /usr/lib/libbg-cdb.a /usr/lib/bglibs/cdb/str.a                                                   
+       dosym /usr/lib/libbg-cli.a /usr/lib/bglibs/cli/cli.a                                                   
+       dosym /usr/lib/crypt.lib /usr/lib/bglibs/crypt.lib                                                     
+       dosym /usr/lib/libbg-crypto.a /usr/lib/bglibs/crypto/md5.a                                             
+       dosym /usr/lib/libbg-crypto.a /usr/lib/bglibs/crypto/sha256.a                                          
+       dosym /usr/lib/libbg-crypto.a /usr/lib/bglibs/crypto/sha1.a                                            
+       dosym /usr/lib/libbg-crypto.a /usr/lib/bglibs/crypto/sha512a.a                                         
+       dosym /usr/lib/libbg-dict.a /usr/lib/bglibs/dict/dict.a                                                
+       dosym /usr/lib/libbg-dict.a /usr/lib/bglibs/dict/load.a                                                
+       dosym /usr/lib/dl.lib /usr/lib/bglibs/dl.lib                                                           
+       dosym /usr/lib/libbg-iobuf.a /usr/lib/bglibs/iobuf/iobuf.a                                             
+       dosym /usr/lib/libbg-iobuf.a /usr/lib/bglibs/iobuf/str.a                                               
+       dosym /usr/lib/libbg-adt.a /usr/lib/bglibs/libbg-adt.a                                                 
+       dosym /usr/lib/libbg-base64.a /usr/lib/bglibs/libbg-base64.a                                           
+       dosym /usr/lib/libbg-cdb.a /usr/lib/bglibs/libbg-cdb.a                                                 
+       dosym /usr/lib/libbg-cli.a /usr/lib/bglibs/libbg-cli.a                                                 
+       dosym /usr/lib/libbg-crc.a /usr/lib/bglibs/libbg-crc.a                                                 
+       dosym /usr/lib/libbg-crypto.a /usr/lib/bglibs/libbg-crypto.a                                           
+       dosym /usr/lib/libbg-dict.a /usr/lib/bglibs/libbg-dict.a                                               
+       dosym /usr/lib/libbg-fmt.a /usr/lib/bglibs/libbg-fmt.a                                                 
+       dosym /usr/lib/libbg-installer.a /usr/lib/bglibs/libbg-installer.a                                     
+       dosym /usr/lib/libbg-instcheck.a /usr/lib/bglibs/libbg-instcheck.a                                     
+       dosym /usr/lib/libbg-instshow.a /usr/lib/bglibs/libbg-instshow.a                                       
+       dosym /usr/lib/libbg-iobuf.a /usr/lib/bglibs/libbg-iobuf.a                                             
+       dosym /usr/lib/libbg-misc.a /usr/lib/bglibs/libbg-misc.a                                               
+       dosym /usr/lib/libbg-msg.a /usr/lib/bglibs/libbg-msg.a                                                 
+       dosym /usr/lib/libbg-net.a /usr/lib/bglibs/libbg-net.a                                                 
+       dosym /usr/lib/libbg-path.a /usr/lib/bglibs/libbg-path.a                                               
+       dosym /usr/lib/libbg-str.a /usr/lib/bglibs/libbg-str.a                                                 
+       dosym /usr/lib/libbg-sysdeps.a /usr/lib/bglibs/libbg-sysdeps.a                                         
+       dosym /usr/lib/libbg-sysdeps.so.1.1.1 /usr/lib/bglibs/libbg-sysdeps.so                                 
+       dosym /usr/lib/libbg-sysdeps.so.1.1.1 /usr/lib/bglibs/libbg-sysdeps.so.1                               
+       dosym /usr/lib/libbg-sysdeps.so.1.1.1 /usr/lib/bglibs/libbg-sysdeps.so.1.1.1                           
+       dosym /usr/lib/libbg-unix.a /usr/lib/bglibs/libbg-unix.a                                               
+       dosym /usr/lib/libbg.a /usr/lib/bglibs/libbg.a                                                         
+       dosym /usr/lib/libbg.so.1.1.1 /usr/lib/bglibs/libbg.so                                                 
+       dosym /usr/lib/libbg.so.1.1.1 /usr/lib/bglibs/libbg.so.1                                               
+       dosym /usr/lib/libbg.so.1.1.1 /usr/lib/bglibs/libbg.so.1.1.1                                           
+       dosym /usr/lib/libbg-installer.a /usr/lib/bglibs/libinstaller.a                                        
+       dosym /usr/lib/libbg-instcheck.a /usr/lib/bglibs/libinstcheck.a                                        
+       dosym /usr/lib/libbg-instshow.a /usr/lib/bglibs/libinstshow.a                                          
+       dosym /usr/lib/libpwcmp-module.a /usr/lib/bglibs/libpwcmp-module.a                                     
+       dosym /usr/lib/libpwcmp.a /usr/lib/bglibs/libpwcmp.a                                                   
+       dosym /usr/lib/libbg-sysdeps.a /usr/lib/bglibs/libsysdeps.a                                            
+       dosym /usr/lib/libvmailmgr.a /usr/lib/bglibs/libvmailmgr.a                                             
+       dosym /usr/lib/m.lib /usr/lib/bglibs/m.lib                                                             
+       dosym /usr/lib/net.lib /usr/lib/bglibs/net.lib                                                         
+       dosym /usr/lib/rt.lib /usr/lib/bglibs/rt.lib                                                           
+       dosym /usr/lib/s.lib /usr/lib/bglibs/s.lib                                                             
+       dosym /usr/lib/shadow.lib /usr/lib/bglibs/shadow.lib                                                   
+       dosym /usr/lib/socket.lib /usr/lib/bglibs/socket.lib                                                   
+       dosym /usr/lib/libbg-misc.a /usr/lib/bglibs/misc/misc.a                                                
+       dosym /usr/lib/libbg-msg.a /usr/lib/bglibs/msg/msg.a                                                   
+       dosym /usr/lib/libbg-msg.a /usr/lib/bglibs/msg/wrap.a
+       dosym /usr/lib/libbg-net.a /usr/lib/bglibs/net/ipv4.a
+       dosym /usr/lib/libbg-net.a /usr/lib/bglibs/net/resolve.a
+       dosym /usr/lib/libbg-net.a /usr/lib/bglibs/net/socket.a
+       dosym /usr/lib/libbg-path.a /usr/lib/bglibs/path/path.a
+       dosym /usr/lib/libpwcmp.a /usr/lib/bglibs/pwcmp/client.a
+       dosym /usr/lib/libpwcmp.a /usr/lib/bglibs/pwcmp/hex.a
+       dosym /usr/lib/libpwcmp-module.a /usr/lib/bglibs/pwcmp/module.a
+       dosym /usr/lib/libbg-str.a /usr/lib/bglibs/str/iter.a
+       dosym /usr/lib/libbg-str.a /usr/lib/bglibs/str/str.a
+       dosym /usr/lib/libbg-unix.a /usr/lib/bglibs/unix/nonblock.a
+       dosym /usr/lib/libbg-unix.a /usr/lib/bglibs/unix/sig.a
+       dosym /usr/lib/libvmailmgr.a /usr/lib/bglibs/vmailmgr/client.a
+       dosym /usr/lib/libvmailmgr.a /usr/lib/bglibs/vmailmgr/vpwentry.a
+
        dodoc ANNOUNCEMENT NEWS README ChangeLog TODO VERSION
        dohtml doc/html/*
        docinto latex
        dodoc doc/latex/*
+
+       rm "${D}"/usr/lib/libbg.la
+       rm "${D}"/usr/lib/libbg-sysdeps.la
 }
Comment 8 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-11-20 12:29:56 UTC
Created attachment 210701 [details]
files/bglibs-1.106-parallel-fix.patch
Comment 9 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-11-20 12:43:21 UTC
*** Bug 290833 has been marked as a duplicate of this bug. ***
Comment 10 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-11-20 12:48:56 UTC
*** Bug 281026 has been marked as a duplicate of this bug. ***
Comment 11 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-20 13:00:44 UTC
I fail to see why should we be polluting the environment with all the bglibs libraries; some are definitely *not* used by either the build-time or run-time linker (the .lib files).

rpath for runtime and LDPATH for link-time should be enough.
Comment 12 Peter Stuge 2009-11-20 16:14:21 UTC
I'm not crazy about all those symlinks. Since upstream decided to make this change I think Gentoo doesn't have to try to fix it up. I think it would be better to be careful with version numbers in ebuilds that DEPEND on bglibs. Maybe also keep one older version of bglibs around in portage? Slotted?

(In reply to comment #11)
> I fail to see why should we be polluting the environment with all the bglibs
> libraries; some are definitely *not* used by either the build-time or run-time
> linker (the .lib files).

The .lib files are something like a .pc file, they are used in the bglibs build process in order to link bglibs itself with the appropriate system libraries. In theory they are needed also by programs that link with bglibs in order to pull in those same libraries.


> rpath for runtime and LDPATH for link-time should be enough.

Please no rpath. I have had trouble with rpath because I create binpkgs with catalyst, and they get bad rpaths. I may just be ignorant here but I don't even know for sure what the point of rpath is. In Gentoo it seems to me that it is so easy to set LDPATH correctly that rpath should never be needed.

Thanks!
Comment 13 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-20 16:17:13 UTC
(In reply to comment #12)
> The .lib files are something like a .pc file, they are used in the bglibs build
> process in order to link bglibs itself with the appropriate system libraries.
> In theory they are needed also by programs that link with bglibs in order to
> pull in those same libraries.

So they are definitely *not* to be put inside the default linking path.

> Please no rpath. I have had trouble with rpath because I create binpkgs with
> catalyst, and they get bad rpaths. I may just be ignorant here but I don't even
> know for sure what the point of rpath is.

So please don't start "Please no" pleads if you have no idea what you're asking about. rpath is one of the best solutions. Binpkgs, with Catalyst or otherwise will be fine if rpath is used properly.
Comment 14 Peter Stuge 2009-11-20 16:41:00 UTC
> > The .lib files are something like a .pc file, they are used in the bglibs
> > build process in order to link bglibs itself with the appropriate system
> > libraries.
> > In theory they are needed also by programs that link with bglibs in order to
> > pull in those same libraries.
> 
> So they are definitely *not* to be put inside the default linking path.

Agree! There's no point in doing that as far as the linker is concerned. Except maybe that bglibs users will expect them to be there? I don't have much experience from those.


> > Please no rpath. I have had trouble with rpath because I create binpkgs with
> > catalyst, and they get bad rpaths. I may just be ignorant here but I don't
> > even know for sure what the point of rpath is.
> 
> So please don't start "Please no" pleads if you have no idea what you're
> asking about.

That's air. I do have an idea about what rpath does, but I am not convinced that it is of much use here. I've discussed it briefly with gcc/ld people (another issue) and they also didn't think much of it.

> rpath is one of the best solutions. Binpkgs, with Catalyst or otherwise
> will be fine if rpath is used properly.

My previous issue (which I have not had time to follow up on) is described in bug 279071 and AFAICS rpath is really useful for "internal" libraries that aren't used in other programs, but that's not bglibs, it is very much a dependency for other libraries and programs so it seems to me that using rpath in this case is not the best solution.

To me, simply putting the .a and .so files into /usr/lib looks really good.
Comment 15 Peter Stuge 2009-11-20 16:42:15 UTC
(In reply to comment #14)
> That's air.

:) Sorry. Should read "That's fair."
Comment 16 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-20 16:51:34 UTC
The problem is that there are *quite* a bit of .a files that would only be used during link-time (which can be provided with a -L path) and just a handful of .so files.

If the latter could be moved into /usr/lib and the rest kept inside a sub-directory, that would sound better. Especially considering none of those currently has a lib prefix so they won't be linked in by -l* linker scripts.

I guess the list of .a files to link together is present in the .lib files, from what you said before? If that's the case, they should probably be kept in /usr/lib/$PN and refer to /usr/lib/$PN themselves, to avoid polluting the library directory.

Note that having extraneous files in /usr/lib will slow down both build-time linking and runtime linking as the program will be searching bigger directory structures.
Comment 17 Peter Stuge 2009-11-20 17:08:58 UTC
(In reply to comment #16)
> The problem is that there are *quite* a bit of .a files that would only be
> used during link-time (which can be provided with a -L path) and just a
> handful of .so files.

Nod.

> If the latter could be moved into /usr/lib and the rest kept inside a
> sub-directory, that would sound better.

I also like this. Shared libraries were introduced earlier this year by upstream and since there are fewer of them I think it's OK to treat better.

Should the subdir be named bglibs-static or similar, to show that it is really only for the static libs?

> Especially considering none of those currently has a lib prefix so they
> won't be linked in by -l* linker scripts.
> 
> I guess the list of .a files to link together is present in the .lib files,
> from what you said before?

Sorry, no, .lib lists the system dependencies (like -lm, -lnet etc) for bglibs, not the bglibs dependencies for bglibs users.

> If that's the case, they should probably be kept in
> /usr/lib/$PN and refer to /usr/lib/$PN themselves, to avoid polluting the
> library directory.

Sounds good, as long as bglibs users are updated to find them in the right place. The upstream default is /usr/local/bglibs/lib so paths will need to be touched in bglibs users in any case.

> Note that having extraneous files in /usr/lib will slow down both build-time
> linking and runtime linking as the program will be searching bigger directory
> structures.

Nod. While that could be argued to be a fs issue :) I like trying to be gentle. In this regard it wouldn't be much better to use /usr/lib/$PN and LDPATH either, right?
Comment 18 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-11-20 17:30:56 UTC
LDPATH would only slow down search for some libraries (since the search is "first found first served" and thus libraries present in /usr/lib would hit first), and using rpath you would also not have to search in there for any other application than a bglibs user.
Comment 19 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-12-12 18:03:36 UTC
i fail to see how rpath is superior to symlinking /usr/lib/libbg.so.1 to
/usr/lib/bglibs/libbg.so (or the other way around). 

if i'm not mistaken, for rpath to work, we'd have to touch all packages depending on bglibs. the symlink will make the whole thing work as is.

anybody wanting to speak the case for rpath again and why its superior to the symlink?
thanks
Comment 20 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-12 20:51:23 UTC
If you only symlink .so files then I'm totally fine with it. If you symlink *all* files, then I'd say you should go with LIBPATH (no change needed) or rpath (changes needed to users).
Comment 21 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2010-01-03 21:48:32 UTC
Created attachment 215086 [details]
bglibs-1.106.ebuild

another year, another round.

this one installs the .so into /usr/lib and symlinks from /usr/lib/bglibs/ to the .so. unless there are any objections, i'd like to add this to the tree soonish...
--- bglibs-1.104.ebuild 2009-09-25 14:12:22.000000000 +0200                                               
+++ bglibs-1.106.ebuild 2010-01-03 13:54:43.000000000 +0100                                               
@@ -1,7 +1,9 @@                                                                                           
-# Copyright 1999-2009 Gentoo Foundation                                                                  
+# Copyright 1999-2010 Gentoo Foundation                                                                  
 # Distributed under the terms of the GNU General Public License v2                                       
 # $Header: /var/cvsroot/gentoo-x86/dev-libs/bglibs/bglibs-1.104.ebuild,v 1.3 2009/09/23 17:16:03 patrick Exp $
                                                                                                               
+EAPI="2"                                                                                                      
+                                                                                                              
 inherit toolchain-funcs eutils multilib                                                                       
                                                                                                               
 DESCRIPTION="Bruce Guenters Libraries Collection"                                                             
@@ -14,9 +16,8 @@                                                                                              
 IUSE=""                                                                                                       
 DEPEND=""                                                                                                     
                                                                                                               
-src_unpack() {                                                                                                
-       unpack ${A}                                                                                            
-       epatch "${FILESDIR}"/bglibs-1.104-parallel-fix.patch                                                   
+src_prepare() {                                                                                               
+       epatch "${FILESDIR}"/${PN}-1.106-parallel-fix.patch                                                    
        # disable tests as we want them manually                                                               
        sed -i \                                                                                               
                -e '/^all:/s|selftests||' \                                                                    
@@ -39,9 +40,6 @@                                                                                              
        echo "${D}/usr/share/man" > conf-man                                                                   
        echo "$(tc-getCC) ${CFLAGS}" > conf-cc                                                                 
        echo "$(tc-getCC) ${LDFLAGS}" > conf-ld                                                                
-       # Fails if we do parallel build of shared+static at the same time                                      
-       emake libs-shared || die                                                                               
-       emake libs-static || die                                                                               
        emake || die                                                                                           
 }

@@ -57,6 +55,20 @@
        dosym /usr/lib/bglibs /usr/lib/bglibs/lib
        dosym /usr/include/bglibs /usr/lib/bglibs/include

+       #install .so in LDPATH
+       mv "${D}"/usr/$(get_libdir)/bglibs/libbg.so.1.1.1 "${D}"/usr/$(get_libdir)/
+       mv "${D}"/usr/$(get_libdir)/bglibs/libbg-sysdeps.so.1.1.1 "${D}"/usr/$(get_libdir)/
+       dosym libbg.so.1.1.1 /usr/$(get_libdir)/libbg.so.1
+       dosym libbg.so.1.1.1 /usr/$(get_libdir)/libbg.so
+       dosym libbg-sysdeps.so.1.1.1 /usr/$(get_libdir)/libbg-sysdeps.so.1
+       dosym libbg-sysdeps.so.1.1.1 /usr/$(get_libdir)/libbg-sysdeps.so
+
+       dosym ../libbg.so.1.1.1 /usr/$(get_libdir)/bglibs/libbg.so.1.1.1
+       dosym ../libbg-sysdeps.so.1.1.1 /usr/$(get_libdir)/bglibs/libbg-sysdeps.so.1.1.1
+
+       rm "${D}"/usr/$(get_libdir)/bglibs/libbg.la
+       rm "${D}"/usr/$(get_libdir)/bglibs/libbg-sysdeps.la
+
        dodoc ANNOUNCEMENT NEWS README ChangeLog TODO VERSION
        dohtml doc/html/*
        docinto latex
Comment 22 Jacob Swanson 2010-01-13 05:22:47 UTC
*** Bug 300800 has been marked as a duplicate of this bug. ***
Comment 23 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2010-01-13 08:12:36 UTC
i've committed the posted bglibs-1.106.ebuild.
please give it a spin.
thanks
Comment 24 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2010-01-14 12:07:31 UTC
forgot to close.
thanks