diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2005-10-09 22:28:35 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2005-10-09 22:28:35 +0000 |
commit | 69764ed3fb7fe88ae579a48852654f4bbdf9898e (patch) | |
tree | 05b154edcc0345d4bcae27704c51d8590e85b172 /eclass | |
parent | Version bump, closes bug #104104. (diff) | |
download | gentoo-2-69764ed3fb7fe88ae579a48852654f4bbdf9898e.tar.gz gentoo-2-69764ed3fb7fe88ae579a48852654f4bbdf9898e.tar.bz2 gentoo-2-69764ed3fb7fe88ae579a48852654f4bbdf9898e.zip |
Added bindnow-flags function to find out the right flags to enable now binding on GNU and non-GNU linkers.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/flag-o-matic.eclass | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index cdabdd4a3a5b..2807a90fff7f 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 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.93 2005/09/27 01:06:47 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.94 2005/10/09 22:28:35 flameeyes Exp $ # need access to emktemp() @@ -59,6 +59,8 @@ inherit eutils toolchain-funcs multilib # notice: modern automatic specs files will also suppress -fstack-protector-all # when only -fno-stack-protector is given # +#### bindnow-flags #### +# Returns the flags to enable "now" binding in the current selected linker. # ################ DEPRECATED functions ################ # The following are still present to avoid breaking existing @@ -498,3 +500,20 @@ gcc2-flags() { export CFLAGS CXXFLAGS } + +# Gets the flags needed for "NOW" binding +bindnow-flags() { + case $($(tc-getLD) -v 2>&1 </dev/null) in + *GNU* | *'with BFD'*) # GNU ld + echo "-Wl,-z,now" ;; + *Apple*) # Darwin ld + echo "-bind_at_load" ;; + *) + # Some linkers just recognize -V instead of -v + case $($(tc-getLD) -V 2>&1 </dev/null) in + *Solaris*) # Solaris accept almost the same GNU options + echo "-Wl,-z,now" ;; + esac + ;; + esac +} |