Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257996 - dev-libs/glib-1.2.10-r5: libraries to link to should not be passed through LDFLAGS
Summary: dev-libs/glib-1.2.10-r5: libraries to link to should not be passed through LD...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks: append-ldflags-libs
  Show dependency tree
 
Reported: 2009-02-07 10:06 UTC by Pacho Ramos
Modified: 2015-06-05 16:47 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 Pacho Ramos gentoo-dev 2009-02-07 10:06:27 UTC
I get:
WARN: unpack
Appending a library link instruction (-ldl); libraries to link to should not be passed through LDFLAGS

when merging it:
Portage 2.1.6.4 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.28-tuxonice-r1 x86_64)
=================================================================
System uname: Linux-2.6.28-tuxonice-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T9300_@_2.50GHz-with-glibc2.2.5
Timestamp of tree: Sat, 07 Feb 2009 07:40:01 +0000
distcc 3.0 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.5.2-r7
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.4.8
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer"
DISTDIR="/usr/distfiles"
FEATURES="autoaddcvs ccache collision-protect cvs distlocks fixpackages multilib-strict parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org"
LANG="es_ES.UTF-8"
LC_ALL="es_ES.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="es es_ES en_US"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
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"
PORTDIR_OVERLAY="/usr/local/portage/layman/sunrise /usr/local/portage/layman/wschlich-testing /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 amr avahi bash-completion berkdb bluetooth branding bzip2 cairo cdda cddb cdparanoia cdr cli consolekit cracklib crypt css cups daap dbus dell dirac divx djvu dts dvd dvdr dvdread dvi eds emboss emovix encode epiphany evo exif fam fbcondecor fbsplash ffmpeg flac fortran fuse galago gdbm gif glitz gmedia gnome gnome-keyring gpm gsm gstreamer gtk hal iconv ieee1394 ipv6 isdnlog java java6 jpeg jpeg2k kdeenablefinal kdehiddenvisibility kpathsea ladspa laptop latex lcms ldap libnotify lirc lzma mad midi mikmod mjpeg mmx mmxext mono moonlight mp3 mpeg mudflap multilib musepack musicbrainz nautilus ncurses network network-cron networkmanager nls nptl nptlonly ntp ogg opengl openmp pam pch pcre pdf perl png ppds pppd python qt3 qt3support qt4 quicktime readline realmedia reflection scanner schroedinger sdl session smp sms speex spell spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs t1lib tcpd theora threads tiff totem truetype unicode usb v4l2 vcd vorbis wmf wmp x264 xattr xcb xft xinetd xml xorg xulrunner xv xvid zeroconf zlib" ALSA_CARDS="hda-intel" 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 synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es es_ES en_US" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS



Reproducible: Always
Comment 1 Gilles Dartiguelongue gentoo-dev 2009-02-07 14:50:16 UTC
as glib-1 is legacy, I hope you have a patch if you want this bug fixed.
Comment 2 Pacho Ramos gentoo-dev 2009-02-07 15:43:17 UTC
No, I don't, sorry :-(

Are you sure that appending -ldl is needed? Well, I cannot check with *bsd but, at least, on amd64, it seems to build ok commenting the line.

Anyway, feel free to close this if cannot be easily fixed
Comment 3 Gilles Dartiguelongue gentoo-dev 2009-02-07 16:22:45 UTC
I didn't say it's hard to fix (it's often easy to fix). Hopefully someone in team will find the time to fix this.
Comment 4 Nico R. 2010-01-14 16:09:50 UTC
I think that adding ‘-ldl’ is not necessary. See the following command and its output:

# grep -rE '(dlerror|dlsym|dlclose|dlopen)' . | grep -vE '^\./(ltconfig|configure|ltmain\.sh|aclocal\.m4|ChangeLog|NEWS|configure\.in|gmodule/ChangeLog):' | cut -d : -f 1 | uniq
./gmodule/gmodule-dl.c


Dynamic loading is only used in gmodule/gmodule-dl.c. When this file is linked, ‘-ldl’ (or ‘-ldld’ or so) is added to the linker flags (via G_MODULE_LIBS and libgmodule_la_LIBADD). See configure.in and gmodule/Makefile.am for details.

/If/ ‘-ldl’ is needed, /but not/ added automagically, this is a bug in the detection of the necessary libraries for dynamic loading. Such a bug should be fixed in configure.in, and G_MODULE_LIBS should be set properly there.

Please comment out the ‘-ldl’ line in the ebuild and test whether the package still compiles. If it does not, the detection code must be fixed in configure.in. You may want to have a look at LT_LIB_DLLOAD from libtool (in /usr/share/aclocal/ltdl.m4), which has some code that may be of interest. If glib did not have its own code to check for the necessary libraries, I would have inserted the libtool macro (but other code may need to be changed a bit). May be worth evaluation /if/ some system requires configure.in to be changed.

I’m on x86, by the way.
Comment 5 Pacho Ramos gentoo-dev 2011-03-06 11:10:59 UTC
Maybe we could simply drop "-ldl" then :-/
Comment 6 Pacho Ramos gentoo-dev 2011-05-08 09:56:22 UTC
Looks like this was added long time ago for hardened:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/glib/glib-1.2.10-r5.ebuild?r1=1.39&r2=1.40 , not sure the reasons (if still needed)
Comment 7 Francisco Blas Izquierdo Riera gentoo-dev 2011-05-09 01:37:22 UTC
Maybe it was because it gave issues with the bind_now ld flag (probably because of unused references to symbols in the library that would otherwise leave a broken ELF).

Please make sure there are no references to any symbols in libdl in the final library before removing the flag.
Comment 8 Pacho Ramos gentoo-dev 2011-06-04 10:03:18 UTC
Since I don't have much knowledge about this, will wait for other team member opinion before touching anything (other option would probably append that flag only with USE "hardened")
Comment 9 Pacho Ramos gentoo-dev 2013-05-01 09:20:39 UTC
-	append-ldflags $(dlopen_lib)
+	sed -i "/libglib_la_LDFLAGS/i libglib_la_LIBADD = $(dlopen_lib)" Makefile.am || die

(from bug 467086)
Comment 10 Pacho Ramos gentoo-dev 2015-06-05 16:47:17 UTC
done in -r6