summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2008-06-07 16:42:32 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2008-06-07 16:42:32 +0000
commit6f21c909ab793d1595670267fcabba49ef60242f (patch)
treeb146d7c7756320b5b80a526ce7ff04b966dcd37d /eclass
parentVersion bump. (diff)
downloadgentoo-2-6f21c909ab793d1595670267fcabba49ef60242f.tar.gz
gentoo-2-6f21c909ab793d1595670267fcabba49ef60242f.tar.bz2
gentoo-2-6f21c909ab793d1595670267fcabba49ef60242f.zip
Warn when using append-ldflags to pass libraries to link to.
Libraries shouldn't be passed as LDFLAGS, the flags should be passed before the object files to link, while libraries should be passed after. Passing libraries through LDFLAGS is one of the causes of --as-needed failures.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/flag-o-matic.eclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 8c491344a909..8402e0e754d7 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.122 2008/02/18 18:20:47 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.123 2008/06/07 16:42:32 flameeyes Exp $
# @ECLASS: flag-o-matic.eclass
# @MAINTAINER:
@@ -579,6 +579,12 @@ replace-sparc64-flags() {
# Add extra <flags> to the current LDFLAGS.
append-ldflags() {
[[ -z $* ]] && return 0
+ local flag
+ for flag in "$@"; do
+ [[ ${flag} == -l* ]] && \
+ ewarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS"
+ done
+
export LDFLAGS="${LDFLAGS} $*"
return 0
}